I have a door but i need a click deco tor door
01 | a = Instance.new( "ClickDetector" ) |
02 | a.Parent = game.Workspace.Part |
03 | variable = true |
04 |
05 | function 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 |
15 | end |
16 |
17 | script.Parent.ClickDetector.MouseClick:connect(onClick) |
The code above should create a one button open and close door, not tested however.