Skip to Content

Team

A single team with name, color, score, friendly-fire setting and membership events.

local blue = game:GetService("Teams"):FindFirstChild("Blue")

Properties

Name

team.Name: string

Read only.

Color

team.Color: Color3

Score

team.Score: number

Team score shown on the leaderboard.

FriendlyFire

team.FriendlyFire: boolean

When true, players on this team can damage each other.

MaxPlayers

team.MaxPlayers: number

Player cap. 0 means unlimited. Read only.

Methods

AddScore

team:AddScore(amount: number)

Adds amount to Score.

GetPlayers

team:GetPlayers(): { Player }

Returns the players on the team.

GetPlayerCount

team:GetPlayerCount(): number

Returns the number of players on the team.

Destroy

team:Destroy()

Removes the team.

Events

PlayerAdded

team.PlayerAdded(player: Player)

Fires when a player is added to the team.

blue.PlayerAdded:Connect(function(player)
	player:SendMessage("You joined Blue!")
end)

PlayerRemoved

team.PlayerRemoved(player: Player)

Fires when a player is removed from the team.

On this page