|
| 06 Dec 2015 02:33 PM |
When i press the button the stairs go up and sets the value to true. But when i press it again it doesnt go down? Why?
Stair1 = script.Parent.Parent.Stair1 --All the variables Stair2 = script.Parent.Parent.Stair2 Stair3 = script.Parent.Parent.Stair3 Stair4 = script.Parent.Parent.Stair4 Stair5 = script.Parent.Parent.Stair5 Stair6 = script.Parent.Parent.Stair6 Stair7 = script.Parent.Parent.Stair7 Stair8 = script.Parent.Parent.Stair8 Support1 = script.Parent.Parent.Support1 Support2 = script.Parent.Parent.Support2 Support3 = script.Parent.Parent.Support3 Support4 = script.Parent.Parent.Support4 Support5 = script.Parent.Parent.Support5 Support6 = script.Parent.Parent.Support6 Support7 = script.Parent.Parent.Support7 Support8 = script.Parent.Parent.Support8
value = script.Parent.Value var = 0 local debounce = false function onClicked(playerWhoClicked) --Checks if button is clicked if not debounce then if value.Value == false then --Is the value == false? debounce = true for i=1,80 do --Does the first Stair Stair1.CFrame = Stair1.CFrame + Vector3.new(0,0.1,0) Support1.CFrame = Support1.CFrame + Vector3.new(0,0.1,0) Stair2.CFrame = Stair2.CFrame + Vector3.new(0,0.1,0) Support2.CFrame = Support2.CFrame + Vector3.new(0,0.1,0) Stair3.CFrame = Stair3.CFrame + Vector3.new(0,0.1,0) Support3.CFrame = Support3.CFrame + Vector3.new(0,0.1,0) Stair4.CFrame = Stair4.CFrame + Vector3.new(0,0.1,0) Support4.CFrame = Support4.CFrame + Vector3.new(0,0.1,0) Stair5.CFrame = Stair5.CFrame + Vector3.new(0,0.1,0) Support5.CFrame = Support5.CFrame + Vector3.new(0,0.1,0) Stair6.CFrame = Stair6.CFrame + Vector3.new(0,0.1,0) Support6.CFrame = Support6.CFrame + Vector3.new(0,0.1,0) Stair7.CFrame = Stair7.CFrame + Vector3.new(0,0.1,0) Support7.CFrame = Support7.CFrame + Vector3.new(0,0.1,0) Stair8.CFrame = Stair8.CFrame + Vector3.new(0,0.1,0) Support8.CFrame = Support8.CFrame + Vector3.new(0,0.1,0) wait(0.1) end value.Value = true debounce = false print("done") end else if value.Value == true then --Is the value == true? debounce = true for i=1,80 do --Does the first Stair Stair1.CFrame = Stair1.CFrame + Vector3.new(0,-0.1,0) Support1.CFrame = Support1.CFrame + Vector3.new(0,-0.1,0) Stair2.CFrame = Stair2.CFrame + Vector3.new(0,-0.1,0) Support2.CFrame = Support2.CFrame + Vector3.new(0,-0.1,0) Stair3.CFrame = Stair3.CFrame + Vector3.new(0,-0.1,0) Support3.CFrame = Support3.CFrame + Vector3.new(0,-0.1,0) Stair4.CFrame = Stair4.CFrame + Vector3.new(0,-0.1,0) Support4.CFrame = Support4.CFrame + Vector3.new(0,-0.1,0) Stair5.CFrame = Stair5.CFrame + Vector3.new(0,-0.1,0) Support5.CFrame = Support5.CFrame + Vector3.new(0,-0.1,0) Stair6.CFrame = Stair6.CFrame + Vector3.new(0,-0.1,0) Support6.CFrame = Support6.CFrame + Vector3.new(0,-0.1,0) Stair7.CFrame = Stair7.CFrame + Vector3.new(0,-0.1,0) Support7.CFrame = Support7.CFrame + Vector3.new(0,-0.1,0) Stair8.CFrame = Stair8.CFrame + Vector3.new(0,-0.1,0) Support8.CFrame = Support8.CFrame + Vector3.new(0,-0.1,0) wait(0.1) end value.Value = false debounce = false end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
#code game.Workspace.littelbigblox.Head:Remove() |
|
|
| Report Abuse |
|
|
| 06 Dec 2015 02:39 PM |
b
#code game.Workspace.littelbigblox.Head:Remove() |
|
|
| Report Abuse |
|
|
| 06 Dec 2015 02:50 PM |
b2
#code game.Workspace.littelbigblox.Head:Remove() |
|
|
| Report Abuse |
|
|
| 06 Dec 2015 03:01 PM |
b3
#code game.Workspace.littelbigblox.Head:Remove() |
|
|
| Report Abuse |
|
RymasterE
|
  |
| Joined: 11 Sep 2008 |
| Total Posts: 1418 |
|
|
| 06 Dec 2015 03:14 PM |
| Upload the script and the set it's supposed to manipulate as a model and I'll look into it. |
|
|
| Report Abuse |
|
|
| 06 Dec 2015 03:14 PM |
b4
#code game.Workspace.littelbigblox.Head:Remove() |
|
|
| Report Abuse |
|
|
| 06 Dec 2015 03:15 PM |
What do you mean?
#code game.Workspace.littelbigblox.Head:Remove() |
|
|
| Report Abuse |
|