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

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

Asked by 7 years ago
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

Log in to vote
0
Answered by 7 years ago

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))
0
The colors as a stringvalue is based on the colors you can choose from properties. 1000anton 38 — 7y
Ad

Answer this question