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

How could I make a door clickable then it will open?

I havent tried anything yet i just wanted to know how to make a door clickable then it will open, stay open till i click it again then it closes

** UPDATE:**

Please provide a script for it, I have the door all made and I just need the script and i need to ask, Do you need to use hinges, If so which ones?

2 answers

✓ Accepted answer

Put a ClickDetector inside the door brick along with this script.

Click = 0
script.Parent.ClickDetector.MouseClick:connect(onClicked)
function onClicked(playerWhoClicked)
	if Click == 0
		script.Parent.CanCollide = true
		script.Parent.Transparency = 0.5
		Click = 1
	else
		script.Parent.CanCollide = false
		script.Parent.Transparency = 1
		Click = 0
	end
end

1 comment

0

it gave me a error :(

Please answer and if possible please do provide a script so it helps me rewrite it more and give credit to the maker, Thanks

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