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?

2 comments
Oh, I thought it did, good to know.
Hold on, it keeps it from being clicked two times in quick succession, but the wait for some reason screws up the script when the door is going down.