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 where when you click on it, it opens?

Asked by 4 years ago

I dont know how to script so I need help making a door where when you click on it, it opens.

0
use clickdetector Friskyman321 121 — 4y

1 answer

Log in to vote
1
Answered by
CedCed6 32
4 years ago

First thing first, insert a Part in the Workspace then rename it Door and thats gonna be the door. Make sure that Anchor and CanCollide is on. Insert a Script and a ClickDetector inside the Part. Then type this in the script:

01local Door = script.Parent
02 
03local ClickDetector = script.Parent.ClickDetector
04 
05local HoverSelectionBox = Instance.new("SelectionBox", Door)
06    HoverSelectionBox.Visible = false
07 
08 
09local ClickDoorFunction = function()
10    Door.CanCollide = not Door.CanCollide
11 
12    Door.Transparency = not Door.CanCollide and 0.5 or 0
13end
14 
15 
View all 33 lines...

And now your done! Make sure to test it if it works!

If it did not work please comment/reply

Ad

Answer this question