You can do this with a server script. All you need to do is add a server script and then write the following code:
1 | script.Parent.Touched:Connect( function (hit) |
2 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
5 | player.TeamColor = BrickColor.new( "Team color here" ) |
Explaining the code:
game.Players:GetPlayerFromCharacter(hit.Parent)
returns the player from the argument passed. If the argument is the character model, the player will be returned. If it is not a character model, this function returns nil
.
Since it can return nil, you check that the player exists. If it does exist, the TeamColor
property is changed to whatever color you specify, them the character is reloaded.