This debounce doesn't work and I tried everything to fix it and it still doesn't work. PLEASE HELP!!!
local door = script.Parent.Parent.Door
pressed = false
function onClicked()
if not pressed then
pressed = true
wait()
for i = .25, 4 do
door.CFrame = door.CFrame * CFrame.new(0, i, 0)
wait(.05)
print("yas")
end
door.Transparency = 1
pressed = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
