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

Selection GUI not loading color?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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.

0
Actually, bag was a brick, but I'll mess with the script, thanks! VirtualFlying 55 — 8y
Ad

Answer this question