Team color changed but not actual team

The code below is supposed to change the team of a player, the player’s team color is changed but on the leaderboard, it still shows the player on the unchanged team.

player.TeamColor ="Crimson") 
print(player.TeamColor) --prints Crimson
player:LoadCharacter() --refresh the player without killing them

When I run the code, the player’s team color changes and the player’s original team still stays the same.

Is this on a local script? If so that could be the problem.

No the code is on a server script.

do something like this instead

local Team  ="Team")
local Teams = game:GetService("Teams")
Team.Name = "New Team"
Team.TeamColor ="Crimson") 
Team.Parent = Teams

# -- instead of all that the Team object could be made to exist implicitly server-side via adding through Studio
player.Team = Team 
# -- set it like that

Maybe also change the Player’s Team property to the Team object inside the Teams service?

You are only adding a new Team object, the OP may not want it to add another one, but instead assign to an existing one.