Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

is there a script to open and close doors?

ok so im trying to make a door that when you click on it it will open;

i dont mean just a brick that you can walk through, im talking about moving the bricks i used to build the door in a way so it opens and closes if that makes sense.

any magical script for that? B^)

1 answer

script.Parent.ClickDetector.MouseClick:connect(function()
 for i = 1,20 do
 script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.08) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
 wait()
 end
 wait(4)
 for i = 1,20 do
 script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, -0.08) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
 wait()
 end
end


This discussion is preserved as it was. New answers, comments, and votes are closed.