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

How do I make a control panel?

I'm building a prison and I want to make a control panel room that when you press the button it locks doors. I don't know how to script it. Please help.

3 answers

Insert a ClickDetector into the Part that is the button, then use this script. Insert this script into the Part that is the button.

Part = script.Parent -- defines the part
Door = PathToDoorHere -- defines the door you want to change

Part.ClickDetector.MouseClick:connect(function() -- start event when part is clicked
	if Door.CanCollide == true then -- if door is closed we open it
		Door.Transparency = 0.6 -- makes door partially transparent
		Door.CanCollide = false -- makes players able to walk through it

	elseif Door.CanCollide == false then -- if door is open we close it
		Door.Transparency = 0 -- makes door solid again
		Door.CanCollide = true -- makes players unable to walk through it again

	end
end)

1 comment

0

This is not constructive. This player needs to learn how to script, instead of somebody giving them a big block of code..

Insert a click detector into the button, and when clicked make the doors transparent and can-collide. I am not giving you a script.

2 comments

0

You shouldn't, not a request site.

0

I know, that's why I'm not.

Use clickdetectors just google them roblox has decent documentation on them

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