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

How do I create a click detector door?

Asked by 10 years ago

So it's like a town then you press a door to open it, then you go in and you press it again to close it.

3 answers

Log in to vote
0
Answered by 10 years ago

This is a request, which is against the rules, so I will not create a door for you. However, I will give you the basics on how to create such a door.

The door in question should contain two things: a ClickDetector and a Script. The ClickDetector will be used to detect when the door is clicked, and the script will execute code when the door is clicked. To make a script trigger when it's Parent (the door) is clicked, you should use the MouseClick event.

script.Parent.ClickDetector.MouseClick:connect(FUNCTION_NAME)

Now all you have to do is define a function that will run a line of code that makes the door "open". This can be achieved in many ways, the most basic and easiest method being setting the door's CanCollide property to false (enabling players to walk though it) and the door's Transparency property to 1 (making the door invisible). Don't forget to add code that distinguishes whether the door is open or not so that you can make the door closed upon clicking it again.

A great article on the Roblox Wiki demonstrates a simple way to create a door that uses clicks. If you have any questions regarding my answer, just ask! You can upvote and accept my answer if you found it helpful.

Ad
Log in to vote
0
Answered by 10 years ago

There's tons of them on free models.

Log in to vote
0
Answered by 10 years ago

So I created a gate of my own version. So now?

Answer this question