GetTeams (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>3dGen Brackets |
>Blocco No edit summary |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude>{{Method|name = GetTeams | <onlyinclude>{{Method | ||
|name = GetTeams | |||
|returns = [[Table]] ''teams'' | |returns = [[Table]] ''teams'' | ||
|description = Returns a table of all of the teams. | |description = Returns a table of all of the teams. | ||
|object = Teams | |object = Teams | ||
}}</onlyinclude> | }}</onlyinclude> | ||
{{clear floats}} | |||
{{Example|<pre> | |||
local teams = Game:GetService("Teams"):GetTeams() | |||
if #teams > 0 then | |||
print( "There are " .. #teams .. " teams." ) | |||
print( "They are as follows:" ) | |||
for i = 1, #teams do | |||
print( "Team " .. i .. ": " .. teams[i].Name ) | |||
end | |||
else | |||
print( "There are no teams!" ) | |||
end | |||
</pre> | |||
}} | |||
[[Category:Methods]] | [[Category:Methods]] |
Latest revision as of 22:28, 13 January 2011
Example
local teams = Game:GetService("Teams"):GetTeams() if #teams > 0 then print( "There are " .. #teams .. " teams." ) print( "They are as follows:" ) for i = 1, #teams do print( "Team " .. i .. ": " .. teams[i].Name ) end else print( "There are no teams!" ) end