Unable to get Team Color to display on players overhead UI

I’m trying to display the players TeamColor on a GUI depending on what team they are on. All of the UI works except for the bottom bar.

– Script –
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player then
if not character.Head:FindFirstChild(“Overhead”) then
local gui = game.ServerStorage.OverheadGui.Overhead:Clone()
gui.A.TextColor = player.Team.TeamColor
gui.A.Text = player.Team.Name
gui.Parent = character.Head
gui.B.Text = player.Name
gui.C.BackgroundColor3 = Color3.new(player.Team.TeamColor)
gui.B.TextColor3 = Color3.new(255, 255, 255)
updateGui(character, player, player.Team)

		end
	end
end)

end)
– Script End –

Team.TeamColor is actually a BrickColor value. In order to get the Color3 version of a BrickColor, you have to read from the Color property of a BrickColor.

You should instead do gui.C.BackgroundColor3 = player.Team.TeamColor.Color.

2 Likes