|
| 10 Oct 2014 06:36 PM |
I need help with my sliding door script. 1.) when ever click the button twice before the door stops moving, it gets pushed even more. I need a line to stop this.
2.)How do I speed up the time for it to get from point A to point B? Script is local Debounce = false function Clicked()
if script.Value.Value == false then for i = 1,90 do wait() script.Parent.Parent.Door.CFrame = script.Parent.Parent.Door.CFrame * CFrame.new(0, 0.1, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0) end script.Value.Value = true script.Parent.BrickColor = BrickColor.new("Bright red") else for i = 1,90 do wait() script.Parent.Parent.Door.CFrame = script.Parent.Parent.Door.CFrame * CFrame.new(0, -0.1, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0) end script.Value.Value = false script.Parent.BrickColor = BrickColor.new("Bright red") end end
script.Parent.ClickDetector.MouseClick:connect(Clicked) |
|
|
| Report Abuse |
|