Someone helped me with getting the door to slide open and STOP at an exact position, now I can't get the door to slide back and stop, it just teleports there instead of sliding.
Script
local open = false local debounce = true local beep = script.Parent.Beep script.Parent.Touched:Connect(function(hit) if hit:IsA("Part") then if hit.Name == "Handle" then if hit.Parent.Name == "Keycard" then local door = script.Parent.Parent.Parent.Parent.CDDoor.Door if open == false and debounce == true then beep:Play() open = true debounce = false for i = 1,53 do wait() door:SetPrimaryPartCFrame(door:GetPrimaryPartCFrame() * CFrame.new(0,0,-0.1)) end wait(2) debounce = true elseif open == true and debounce == true then beep:Play() open = false debounce = false for i = -1,53 do door:SetPrimaryPartCFrame(door:GetPrimaryPartCFrame() * CFrame.new(0,0,0.1)) end wait(2) debounce = true end end end end end)
What happens https://gyazo.com/c48abb017f1d72e88476d6334dc8c62e
i found your mistake at line 24-26 you don't have a wait in between the i loop at line 24. So all you would need is a wait() inside the loop