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

How can you change the color of a part using a string value?

while wait() do
color = script.Parent.Configuration.Color.Value
	script.Parent.Part.BrickColor = BrickColor.new("color")
end

I'm not sure how to properly put "color" into there without the "'s.

1 answer

If you're using a color3 value's value, just use that:

while wait() do
	local color = script.Parent.Configuration.Color.Value
	script.Parent.Part.BrickColor = BrickColor.new(color)
end

But you can use a string as well.

script.Parent.Part.BrickColor = BrickColor.new("Really red")

This is because a BrickColor can accept a string or a Color3 value.

script.Parent.Part.BrickColor = BrickColor.new("Really red")

-- or

script.Parent.Part.BrickColor = BrickColor.new(Color3.new(1,0,0))

1 comment

0

The colors as a stringvalue is based on the colors you can choose from properties.

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