Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me with this?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I want to make a script that changes the color of an ImageLabel when you click the "open" TextButton, and when you click another TextButton that closes the GUI, I want the ImageLabel's original color to show again. I have the first part of the code that changes the ImageLabel when you click the open TextButton, but I do not know how to change the ImageLabel's color back to normal after you click the close TextButton.

Thanks for your help everyone!

Here is the code I have:

script.Parent.MouseButton1Click:connect(function() script.Parent.ImageLabel.BackgroundColor3 = Color3.new(0,170,0) end)-- This makes the ImageLabel's color change when you click the "open" TextButton.

1 answer

Log in to vote
0
Answered by
DevChris 235 Moderation Voter
10 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.
script.Parent.MouseButton1Click:connect(function() 
 script.Parent.ImageLabel.BackgroundColor3 = Color3.new(0/255,170/255,0/255) 
end)

And if you're using an ImageLabel just for background colors, then just use Frames...

Ad

Answer this question