We use cookies on this site to enhance your user experience

The Team class represents a faction in a Roblox place. The only valid parent for a Team is in the Teams service. Teams offer a range of features that are useful to developers that can be divided into two rough groups:

  • Features that work ‘out of the box’
  • 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 Model will be colored to the Team/TeamColor
  • Changing Player/TeamColor will cause Player/Team to switch to the Team with the corresponding Team/TeamColor
  • When using the default player list users will be grouped and displayed together as a team
  • Setting Player/Neutral to true will cause the Player to be disassociated with the team, however, it 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 Behaviors

Many developers chose to add the following features to teams in their own code.

  • Implement checks in weapon code to prevent friendly fire.
  • Implement checks in doors or other features that allow only certain teams to use them
  • Periodically reassign teams to maintain team balance

Properties

Name Type Description
bool

This property determines whether Players will be automatically placed onto the Team when joining. If multiple teams have this property set to true, Roblox will attempt to even the teams out when Players are added.

BrickColor

This property sets the color of the Team. Determines the Player/TeamColor property of players who are a member of the team. Also determines the color displayed on the player list and above player’s heads.

Inherited from Instance

Archivable ClassName DataCost Name Parent RobloxLocked

Functions

Name Type Description
Objects

Returns a list of Players who are assigned to the Team. A Player is considered assigned if their Player/Team property is equal to the Team and Player/Neutral is false.

Inherited from Instance

ClearAllChildren Clone Destroy FindFirstAncestor FindFirstAncestorOfClass FindFirstAncestorWhichIsA FindFirstChild FindFirstChildOfClass FindFirstChildWhichIsA GetChildren GetDebugId GetDescendants GetFullName GetPropertyChangedSignal IsA IsAncestorOf IsDescendantOf WaitForChild

Events

Name Type Description

Fires whenever a Player is assigned to the Team. A player is considered assigned if their Player/Team property is equal to the Team and Player/Neutral is false.

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.

Inherited from Instance

AncestryChanged Changed ChildAdded ChildRemoved DescendantAdded DescendantRemoving