We use cookies on this site to enhance your user experience
Collapse Sidebar


Show deprecated


Show deprecated

The Teams service holds a game’s Team objects. Team objects must be parented to the Teams service.

Teams offer a range of features that are useful to developers. These can broadly be divided into features that work out-of-the-box and features developers can program into their game.

Built-in team behaviour
The following functionality of Teams exists by default and does not require the developer to program any custom behaviour.

  • When part of a Team, the name above a Player's character Model will be colored to the Team/TeamColor
  • Changing Player/TeamColor will cause Player/Team switch to the Team with the corresponding Team/TeamColor
  • When using the default player list users will be grouped and displayed by team
  • Setting Player/Neutral to true will cause the Player to be dis-associated with the team, but will not change Player/Team or Player/TeamColor
  • When a Player joins a game, they will be allocated to the team with Team/AutoAssignable set to true that has the fewest players. If no auto assignable team is available, Player/Neutral will be set to true
  • When SpawnLocation/Neutral is set to false, only players whose Player/TeamColor matches SpawnLocation/TeamColor can spawn on that SpawnLocation
  • When SpawnLocation/AllowTeamChangeOnTouch is set to true, a Player's Player/TeamColor will change to SpawnLocation/TeamColor when their character touches the SpawnLocation

Optional extended team behavior
Many developers chose to add the following features to teams in their own code.

  • Implement checks for team in weapon code to prevent team killing
  • Implement doors or other features that only certain teams can use
  • Periodically reassign teams to maintain team balance




GetTeams ( )

Returns a table containing the game’s Team objects. Will only return Team objects that are parented to the Teams service.