Roblox UtilitiesDevlHub Roblox Documentation

Class

Teams

NotCreatableService
Inherits
Instance › Object
Memory category
Instances

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

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.

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 2#

GetTeamsReturns a table containing the game's Team objects. Will only return Team objects that are parented to the Teams service.
RebalanceTeamsEvens the number of people on each team. This function does not work correctly and should not be used.Deprecated

GetTeams(): List<Team>#

The GetTeam function returns a table containing the game's Team objects.

Note this will only return Team objects that are directly parented to the Teams service. For this reason it is recommended developers only parent Team objects to the Teams service and not to other Instances (or to each other).

Returns
  • List<Team> — An array of Teams in the game.

RebalanceTeams(): ()#

DeprecatedDeprecated

Deprecated. This function has been deprecated and no longer functions correctly. It should not be used. Developers should instead implement their own team sorting systems.

Evens the number of people on each team. This function does not work correctly and should not be used.

Returns
  • ()

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed