Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to make a click detector door?

I have a door but i need a click deco tor 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.

1 comment

0

ok thx

This discussion is preserved as it was. New answers, comments, and votes are closed.