How can I make a door move up, like a rollerdoor?
if game.Workspace.Game.Value == true then if open==false then for i=1,100 do door.CFrame=door.CFrame + Vector3.new(0, 0.1, 0) wait(0.1) end open=true elseif open==true then for i=1,100 do door.CFrame=door.CFrame + Vector3.new(0, -0.1, 0) wait(0.1) end open=false end end
This wont work, I want it so once the Game BoolValue = true, it moves the door up and then after 10 seconds it shuts again
You can use CFrame in conjunction with a for loop and a MouseClick event on a ClickDetector, like so:
ClickDetctor.MouseClick:connect(function(p)--ClickDetector event. if open==false then for i=1,100 do--For loop, it will go 100 times. door.CFrame=door.CFrame + Vector3.new(0, 0.1, 0)--editing the doors CFrame to go up 1 tenth of a stud. wait(0.1) end open=true elseif open==true then for i=1,100 do door.CFrame=door.CFrame + Vector3.new(0, -0.1, 0) wait(0.1) end open=false end)