Service · inherits Instance
Teams
About Teams
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 behavior The following functionality of Teams exists by default and does not require the developer to program any custom behavior.
- When part of a Team, the name above a player's character
Modelwill be colored to theTeam.TeamColor - Changing
Player.TeamColorwill causePlayer.Teamswitch to the Team with the correspondingTeam.TeamColor - When using the default player list users will be grouped and displayed by team
- Setting
Player.Neutralto true will cause thePlayerto be dis-associated with the team, but will not changePlayer.TeamorPlayer.TeamColor - When a
Playerjoins a game, they will be allocated to the team withTeam.AutoAssignableset to true that has the fewest players. If no auto assignable team is available,Player.Neutralwill be set to true - When
SpawnLocation.Neutralis set to false, only players whosePlayer.TeamColormatchesSpawnLocation.TeamColorcan spawn on thatSpawnLocation - When
SpawnLocation.AllowTeamChangeOnTouchis set to true, a player'sPlayer.TeamColorwill change toSpawnLocation.TeamColorwhen their character touches theSpawnLocation
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
Methods 1
Teams also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.