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.
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)
Insert a click detector into the button, and when clicked make the doors transparent and can-collide. I am not giving you a script.
Use clickdetectors just google them roblox has decent documentation on them
Closed as Not Constructive by fireboltofdeath, Redbullusa, and NotSoNorm
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?