Need help with getting team players

I’m tryna get team players that do something, from PlayerAdded then ChildAdded.

Script
game.Players.PlayerAdded:connect(function(Player)
	Player.TeamColor = "Navy blue" 
	Player.CharacterAdded:connect(function(Character)
    Player.PlayerGui.G.Enabled = true
	end)
end)
Output

17:55:30.629 - Workspace.CharacterSpawn:3: bad argument #3 (BrickColor expected, got string)

It should go through with the same color?
Need help with that solution

TeamColor is a BrickColor not a string. Try using BrickColor.new()

I want same color or Team name, not changing team color.

@SingleSided
If i do this

Player.TeamColor = BrickColor.new(“Bright violet”)

It change the Teamcolor, i want the current TeamColor or Team

So you want to check what teamcolor the player has?
(Really sorry about the badly written code. I’m on mobile) If that’s the case, you can try:

If Player.TeamColor == BrickColor.new(“BRICKCOLORHERE”) then
–do something here
end

1 Like

Thank you very much, I needed this.

PS, nifty little trick, BrickColors have a name property that you can use if you ever need the actual name of the colour (you probably won’t) or you want to do a lazy comparison.

if player.TeamColor.Name == "Brick color string" then

Neat, yeah? Just another way of doing it.

1 Like

Still even what @Ashtonrife10 posted, thank for your support tho.