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

Player not changing team?

Asked by 7 years ago

Hi all. This script is meant to change the player's team if he's in a specific rank or higher. Apparently it's not working at all. Any problems? It is in a ServerScript. I understand from the wiki that it may not return live values, but that's not a problem.

game.Players.PlayerAdded:connect(function(player)
    if player:GetRankInGroup(2641172) >= 185 then
        player.TeamColor = BrickColor.new(game.Teams["House Members"].TeamColor)
    end
    print(player:GetRankInGroup(2641172))
    player:LoadCharacter() --Respawn Character
end)

1 answer

Log in to vote
1
Answered by
einsteinK 145
7 years ago

player.TeamColor = BrickColor.new(game.Teams["House Members"].TeamColor) You just need to use game.Teams["House Members"].TeamColorbecause that already is a BrickColor. Using BrickColor.new(brickcolor) doesn't work and returns grey (default color).

Ad

Answer this question