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

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

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

✓ Accepted answer

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

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