|
| 22 Aug 2015 03:44 PM |
The code is supposed to make it have a randomized outcome every time you touch the block renamed mem. It works, however you can only touch the block one time, and then it just wont do anything again. This is the code
local stop=false script.Parent.Touched:connect(function (hit) if not stop then stop=true local val=math.random(1,3) if val==1 then game.Workspace.mem1.CanCollide=true game.Workspace.mem2.CanCollide=false game.Workspace.mem3.CanCollide=false game.Workspace.mem2.Transparency=0.25 game.Workspace.mem3.Transparency=0.25 wait(0.05) game.Workspace.mem2.Transparency=0 game.Workspace.mem3.Transparency=0 elseif val==2 then game.Workspace.mem1.CanCollide=false game.Workspace.mem2.CanCollide=true game.Workspace.mem3.CanCollide=false game.Workspace.mem1.Transparency=0.25 game.Workspace.mem3.Transparency=0.25 wait(0.05) game.Workspace.mem1.Transparency=0 game.Workspace.mem3.Transparency=0 else game.Workspace.mem1.CanCollide=false game.Workspace.mem2.CanCollide=false game.Workspace.mem3.CanCollide=true game.workspace.mem1.Transparency=0.25 game.Workspace.mem2.Transparency=0.25 wait(0.05) game.Workspace.mem1.Transparency=0 game.Workspace.mem2.Transparency=0 end end end) |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2015 03:55 PM |
| you set stop to true, then never set it back to false. |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2015 04:02 PM |
| You never really set stop to false. You left it at true. Just add at the end stop = false |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2015 04:28 PM |
| i already figured out the error a short time after posting this, but thanks anyway. |
|
|
| Report Abuse |
|
|