Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make a door open by clicking it?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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)
Ad
Log in to vote
0
Answered by 10 years ago

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.

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. CharcterKaiser 0 — 10y

Answer this question