So, I created this script that's supposed to open the door using a keycard and a keycard slider.
local open = false
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 then
open = true
repeat wait()
door:SetPrimaryPartCFrame(door:GetPrimaryPartCFrame() * CFrame.new(0,0,0 + -0.1))
until door.MovingPart.CFrame == Vector3.new(-21.429,7.775,6)
end
end
end
end
end)
The door just keeps on going, and won't stop at the designated point.
