How to change a bricks color using a BrickColorValue

I have this code:

n.BrickColor = BrickColor.new(game.Workspace.Countries[StateOwner].CountryInfo.CountryColor.Value)

Which returns the error:

Workspace.Scripts.StateOwnership:9: bad argument #1 (Color3 expected, got BrickColor)]

The weird thing is, if I do this:

n.BrickColor = BrickColor.new("Really red")

It works, but if I try using a BrickColorValue, it just returns the error shown above…

1 Like

You don’t need to type BrickColor.new() behind the value since it already has BrickColor.new() in it I believed.

n.BrickColor = game.Workspace.Countries[StateOwner].CountryInfo.CountryColor.Value

2 Likes

I recommend using BasePart.Color which is a property which require a Color3 value and allow you more flexibility with your color choices.

A typical way to go about doing this would be:

BasePart.Color = Color3.fromRGB(255, 0, 0) -- red
BasePart.Color = Color3.new(1, 0, 0) -- red
BasePart.Color = BrickColor.new("Really red").Color -- whichever brickcolor you'd like
1 Like