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

BrickColor value is not changing?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

I know how to get all the parents but the problem is, the BrickColor Value named "CValue" is not changing the color value.

Part = script.Parent
BC = Part.CValue

Part.ClickDetector.MouseClick:connect(function()
    Part.BrickColor = BC.Value
    BC.Value = "Bright Red"
end)
1
You can't store strings in a BrickColorValue. Change "Bright Red" to BrickColor.new("Bright red"). Also, you should be careful with color names, as they have to be exact. LetThereBeCode 360 — 8y

1 answer

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

A BrickColorValue requires a BrickColor for a value. On line 6, you're trying to set its value to a string. Instead, write BC.Value = BrickColor.new("Bright red")

Ad

Answer this question