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

how to make a click detector door?

Asked by 10 years ago

I have a door but i need a click deco tor door

1 answer

Log in to vote
0
Answered by 10 years ago
01a = Instance.new("ClickDetector")
02a.Parent=game.Workspace.Part
03variable = true
04 
05function onClick()
06    if(variable=true)then
07    script.Parent.Transparency=0.5
08    script.Parent.CanCollide=false
09    variable=false
10    end
11    if(variable=false)then
12    script.Parent.Transparency=0
13    script.Parent.CanCollide=true
14    variable=true
15end
16 
17script.Parent.ClickDetector.MouseClick:connect(onClick)

The code above should create a one button open and close door, not tested however.

0
ok thx jls12345678 0 — 10y
Ad

Answer this question