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

How can I make a part in workspace that, when clicked, changes the color of a textlabel?

I'm trying to make a game where you're in the sewers, and you need to click on 8 valves to get out.

I have a gui set up that shows the 8 valves and if they've been clicked on yet or not. So when you do click on a valve, the background color will change from red to green.

I need help on creating a script for this, as I've tried multiple methods but haven't been able to get it to work correctly. I just need a textlabel to turn green when a part in the workspace has been clicked.

1 answer

This is very easy, you can just add a ClickDetector inside the part, then make a SurfaceGui and insert a TextLabel, then add a script inside. Using the event of the ClickDetector to know when player clicked the part then change the text color. Otherwise if you trying to make a GUI in the StarterGui, you can just insert a local script inside the GUI instead of script and then local where the part is and it ClickDetector, then just using the event ClickDetector.MouseClick:Connect(function() to find out when player click the part, then change it color.

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