I'm making a door which opens using Vector3 but how do I tell it to not continue moving once it has reached a set position?
LDoor = game.Workspace.OpeningD.LDoor
RDoor = game.Workspace.OpeningD.RDoor
IsRunning = true
function OpenDoor()
if IsRunning == true then
IsRunning = false
while true do
LDoor.CFrame = LDoor.CFrame - Vector3.new(0,0,0.1)
RDoor.CFrame = RDoor.CFrame + Vector3.new(0,0,0.1)
wait(0.01)
OpenDoor = false
IsRunning = false
end
end
end
script.Parent.ClickDetector.mouseClick:connect(OpenDoor)
