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

How do I make a door open by clicking it?

Pretty self explanatory. I don't want it just to make CanCollide false, I want the door to like rotate like a door would.

2 answers

This would be very complex just to open a door.... You could use a loop, and CFrame though. Like you could rotate it +0.001 1000 times when it's clicked using CFrame. I really have never done this before, but here's how you would do the loop:

for i = 1,1000 -- change 1000 to however many times you want this to run
--CFrame code
end

And to make it fire on click, you will have to insert a ClickDetector inside the brick, and put this script inside the brick:

script.Parent.ClickDetector.MouseClick:connect(function()
	-- loop and CFrame code in here
end)

You can use the above answer or you could make another door but Transparency 1 and CanCollide false, then make a script that when you click the Door the Door you clicked goes Transparency 1 and CanCollide false and the other Door Transparency 0 and CanCollide true, then do a wait() command and then make it so does the other Door goes Transparency 1 and CanCollide false and the Door that you click on Transparency 0 and CanCollide true, also you need to add a ClickDetector in the Door that has the script and it disables when the Door is Transparency 1.

1 comment

0

Also you could add hinges at the top and bottom of the door but at the left side and put the door so it stretches to them and then make a script and add "while true do wait(0.1) script.Parent.Anchored = true end" that helps so that the door doesn't open then just close all the time and doesn't go bang in the ROBLOXian's face causing them to fall.

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