Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to check players team color?

Asked by 6 years ago
player = game.Players.LocalPlayer
if player.TeamColor.BrickColor.Name == ("White") then

    print ("Working")


end

Why is this not working? Thanks.

2 answers

Log in to vote
0
Answered by 6 years ago

You do not need the .BrickColor after .TeamColor because TeamColor is already a BrickColor.

1
Thanks! MaIphas 1 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

Don't use the () around "White". Those () are for math.

But yeah what the top reply said.

You could also check the team.

if player.Team == game:GetService("Teams").TeamNameHere then
    -- Do code
end
0
Thanks for the alternative! MaIphas 1 — 6y

Answer this question