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

Convert a StringValue with the name of a color to a color3 value?

Asked by
Paldi 109
7 years ago

hello, im trying to convert a brickcolor to a color 3 value but the name of the color is held in a stringvalue

        local c = colors[i].Value --this is where the string value of the brickcolor is
        button.BackgroundColor3 = BrickColor.c.Color -- this is how im trying to convert it

right now i get the error : attempt to call field 'c' (a nil value)

any ideas on how to do this?

1 answer

Log in to vote
2
Answered by 7 years ago

change button.BackgroundColor3 = BrickColor.c.Color to Button.BackgroundColor3 = BrickColor.new(c).Color

Ad

Answer this question