teams.all
function#Every team, in the order of the Teams service.
for _, team in teams.all() do print(team.name) endUse it forlisting the teams on a scoreboard, or balancing how many players each team has.
Teams and friendly fire
local teams = require("@usbx/teams")Every team, in the order of the Teams service.
for _, team in teams.all() do print(team.name) endUse it forlisting the teams on a scoreboard, or balancing how many players each team has.
Finds a team by its name, or gives nil.
local red = teams.find("Red")Use it forgrabbing the Red or Blue team so you can move players onto it.
nameName of the team.Adds a team after the others and returns it. With the name of a team that exists, it returns that team and gives it the options.
local blue = teams.create("Blue", { color = math3d.color.rgb(0, 0, 255) })Use it forsetting up the teams for a match when the round starts.
nameName of the new team, 1 to 30 characters.optionsoptionalIts color and whether joining players go on it.create callcolor · auto_assigncolorThe team's color, which is white when you leave it out.
auto_assignWhether players who join can be put on this team, which is false when you leave it out.
Fires when a player's team changes, with the player, the old team and the new team.
teams.changed:connect(function(player, _old, new) if new then print(player.name, "joined", new.name) end end)Use it forgiving players team gear or a team color whenever they switch teams.
While false, the default, Player:damage by a teammate does nothing. Writable.
teams.friendly_fire = trueUse it forfree for all modes, where teammates are allowed to hurt each other too.