I have a door but i need a click deco tor door
COMMUNITY QUESTION
how to make a click detector door?
1 answer
a = Instance.new("ClickDetector")
a.Parent=game.Workspace.Part
variable = true
function onClick()
if(variable=true)then
script.Parent.Transparency=0.5
script.Parent.CanCollide=false
variable=false
end
if(variable=false)then
script.Parent.Transparency=0
script.Parent.CanCollide=true
variable=true
end
script.Parent.ClickDetector.MouseClick:connect(onClick)
The code above should create a one button open and close door, not tested however.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
ok thx