Pls help, I want to change a part's brick color

So I want to change a part’s Brick Color using scripts,
I tried something like this but didnt work

local TeamColor = script.Parent.Parent.Parent.TeamColor.Value

-- Part --
script.Parent.BasePart.Top.BrickColor = TeamColor

Thanks 4 reading,
The Spikey Man

Try color other than Brick color

It Still dosent work, its gray and the TeamColor.Value was Olive

1 Like

can you print out the value of TeamColor?

1 Like

Did u mean smthing like this?

workspace.Part.BrickColor = BrickColor.new("Really red")

or

local team = Instance.new("Team",game:GetService("Teams"))
team.TeamColor = BrickColor.new("Really red")

or else?

local TeamColor = script.Parent.Parent.Parent.TeamColor.Value

-- Part --
script.Parent.BasePart.Top.Color = Color3.new(TeamColor)

I think this will solve your problem.

script.Parent.Parent.Parent.TeamColor is a String Value not a part

Try this:

local TeamColor = script.Parent.Parent.Parent.TeamColor

-- Part --
script.Parent.BasePart.Top.BrickColor = TeamColor.Value
1 Like

Huh? I dont undetstand what ur saying,

isnt
this

local TeamColor = script.Parent.Parent.Parent.TeamColor.Value

-- Part --
script.Parent.BasePart.Top.BrickColor = TeamColor

and urs the same thing?

Try part.brickColor = BrickColor.new[your Value]
I might have miss spelled

That didnt work it went Black when it was suppose Become another color

Can you just switch to Color3Value?

local TeamColor = script.Parent.Parent.Parent.TeamColor.Value

-- Part --
script.Parent.BasePart.Top.Color = TeamColor

Assuming TeamColor is a Color3Value

TeamColor is a Brick Color Value

It said Workspace.Part.Script:4: attempt to index function with BrickColor

there is a difference between this

local TeamColor = script.Parent.Parent.Parent.TeamColor

-- Part --
script.Parent.BasePart.Top.BrickColor = TeamColor.Value

and this

local TeamColor = script.Parent.Parent.Parent.TeamColor.Value

-- Part --
script.Parent.BasePart.Top.BrickColor = TeamColor

you cannot put propierts on variables, in case the first code block i said its the correct one

The string needs to be one of these brick color names here:

local TeamColor = script.Parent.Parent.Parent.TeamColor

-- Part --
script.Parent.BasePart.Top.BrickColor = BrickColor.new(TeamColor.Value)

Ok so, your value must be “BrickColorValue” then set it to your wanted color

local TeamColor = script.Parent.Parent.Parent.TeamColor

-- Part --
script.Parent.BasePart.Top.BrickColor = TeamColor.Value

I tested it and it works!

Ok, what you told worked, Thanks for the help

I literally said the same thing before him in my message! :slight_smile:

1 Like