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

How do you make a door that is connected to the surfaceGui?

Right now I'm making a bed and it's up and I wanna have a like a tv screen controls that bed and gives an option to put down the bed or pull the bed back in its position how do you do it?

2 answers

Hi there! The solution you're looking for is to place a ClickDetector inside the part. The script, again inside the part, would look something like this:

script.Parent.ClickDetector.MouseClick:Connect(function()
--do stuff here
end)

the argument inside the event is the player who clicked the part, in case you were wondering :D

Create a SurfaceGui with your buttons. You will need to know how to script for this next part. Add a script wherever and connect the buttons using:

BUTTONLOCATION.MouseButton1Down:Connect(function()
	-- Code
end

Use that code attached to each button to do something. You can have it change the button color, text, run code on an external part, etc.

For extra assistance, please contact me on Discord.

Bark#4260

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