GetTeams (Method)
From Legacy Roblox Wiki
Example
This is an example of using the method above to get all the teams and remove them. Includes the generic for loop.
local teams = Game:GetService("Teams"):GetTeams() if type( teams ) == "table" 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