I'm so bad at debounces, any help?
local door = script.Parent
local main = door.Main
local button = script.Parent.MainDoor
local open = false
button.ClickDetector.MouseClick:Connect(function()
if not open then
open = true
for i = 0, 10, 0.3 do
door:SetPrimaryPartCFrame(door:GetPrimaryPartCFrame()
* CFrame.Angles(0, math.rad(math.pi*-0.85), 0))
wait()
end
else
open = false
for i = 0, 11, 0.3 do
door:SetPrimaryPartCFrame(door:GetPrimaryPartCFrame()
* CFrame.Angles(0, math.rad(math.pi*0.80), 0))
wait()
end
end
end)
