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

How do I return a players team color?

Asked by 8 years ago

So I need to get a players Team Color for a chat GUI that I am making. But my attempt to return it in a function, is not working. Here is my code:

function getTeamColor()
    game.Players.PlayerAdded:connect(function(plr)
        print(plr.TeamColor)
        return plr.TeamColor
    end)
end

getTeamColor()

My expectation was so when I join a game, it prints the Players team color, but I get nothing in the output. Please help me with this.

Answer this question