PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

PlayerRemoved

Fires whenever a Player is removed from a Team. This can be due to the Player leaving the game, Player/Neutral being set to true or the Player joining a different team.

This event is team specific and will only fire when a Player leaves the specific Team. Any function connected to this event will be passed the Player object of the player who left the team. For example:

Team.PlayerRemoved:Connect(function(player)
	print(player.Name.." has left the team")
end)

Parameters

Name Type Default Description

The Player removed.


Code Samples


Simple Team Rebalance

This code sample includes a simple example of how to re-balance teams. When Team.AutoAssignable is set to true players will be added to Teams in a balanced fashion. However as Players leave the game this can lead to unbalanced teams as players are not reallocated. This code keeps track of the number of players in each team and, when players leave will check to see if the teams need re-balancing.