I'm trying to get my garage door to move up/down depending on it's status, so if the status is true, it moves up, and if it is false, it moves down.
movements=74
downmoves = -74
speed=0.1
status = false
script.Parent.Part.ClickDetector.MouseClick:connect(function()
if status == false then
for i=1,movements do
wait(0.01)
script.Parent.Door:SetPrimaryPartCFrame(script.Parent.Door.PrimaryPart.CFrame + Vector3.new(0,speed,0))
end
status = true
elseif status == true then
for i=1,downmoves do
wait(0.01)
script.Parent.Door:SetPrimaryPartCFrame(script.Parent.Door.PrimaryPart.CFrame + Vector3.new(0,-speed,0))
end
status = false
end
end)
But, the door will go up no matter what. It will stop, but it can't come back down. How can I fix it?
