I'm trying to make a Gate and it's going pretty well, and it works well too, however, the problem is the debounce variable I've set up for it is not working.
Button.MouseClick:Connect(function() if DoorDebounce == false then DoorDebounce = true if DoorIsUp then Door.Anchored = false print("Door is lowering") DownTween:Play() Door.Anchored = true DoorIsUp = false else Door.Anchored = false print("Door is opening") UpTween:Play() DoorIsUp = true Door.Anchored = true end DoorDebounce = false end end)
What am I doing wrong?
I think you forgot the wait() for the debounce to be set to false. Playing a tween doesn't wait for the tween to finish to play the rest of the code.