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: stringRead only.
Color
team.Color: Color3Score
team.Score: numberTeam score shown on the leaderboard.
FriendlyFire
team.FriendlyFire: booleanWhen true, players on this team can damage each other.
MaxPlayers
team.MaxPlayers: numberPlayer 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(): numberReturns 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.