Help with change brickcolor change to teamcolor

Basically, I’m trying to make a flag where the team you are in, it makes that flag part your team color. However, I may be doing it wrong because it says "Color 3 Expected, got BrickColor". I looked on the dev hub page and it says a part’s color can be changed by the brickcolor, but "TeamColor" isn’t color 3 and correctly is a brick color?

Here’s that 1 line if you are confused (Ty in advance!):
part.BrickColor = BrickColor.new(tm.TeamColor)

Ask me for more details if needed…

tm.TeamColor is a BrickColor, so you can just directly set the part’s BrickColor to that value. When constructing a new BrickColor, it expects a string value of the color to use.

part.BrickColor = tm.TeamColor
3 Likes

If you want to keep that convention, you can actually just pass its name. It’s a reinvent of the wheel and you should just be directly setting the part’s colour to the team’s colour as General_Scripter wrote though, just a heads up.

part.BrickColor = BrickColor.new(tm.TeamColor.Name)
1 Like