Garry's Mod Wiki

Garry's Mod Wiki

  table team.GetPlayers( number teamIndex )

Description

Returns a table with all player of the specified team.

This function returns a sequential table, meaning it should be looped with ipairs instead of pairs for efficiency reasons.

Arguments

1 number teamIndex
The team index.

Returns

1 table
A sequential table of Players that belong to the requested team.

Example

Prints all the players in a player's team.

Output: List of players.

Example

Heals all the players in a player's team.

for _, teammate in ipairs(team.GetPlayers(ply:Team())) do teammate:SetHealth(teammate:GetMaxHealth()) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...