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

Selection GUI not loading color?

I've figured out a lot from the Wiki but I'm still having trouble on this. I know it's supposed to be a function when clicked and stuff, but the color line isn't working...

bag = script.parent.parent.parent

function onClick()
	bag.color3 = 'Electic Blue'
end

script.Parent.MouseButton1Click:connect(onClick)

1 answer

✓ Accepted answer

Off the bat I see several issues:

1:Electric Blue is not a valid GUI color.

2:GUI colors can only be changed in the "Color3.new(R,G,B)"

3: I'm going to assume "bag" is a GUI function of some sort (button, frame, text box). "bag.color3" is a nil item. The GUI components consist of "BackgroundColor3", "BorderColor3", "TextColor3", and "TextStrokeColor3". (Capital letters are important). I'm not 100% sure which one of these you want to change, so I'm going to give an example using "BackgroundColor3"

This is what the script should look like:

bag = script.parent.parent.parent

function onClick()
    bag.BackgroundColor3 = Color3.new(25,25,255)
end

script.Parent.MouseButton1Click:connect(onClick)

Now keep in mind that that might be the exact color you had in mind, but you can change that as you please. Hope this helped, feel free to ask any questions.

1 comment

0

Actually, bag was a brick, but I'll mess with the script, thanks!

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