game:GetService('Teams'):GetChildren()
I want to remove a team from this table(I think this is a table) But I don't know how to do so.
Attempt 1 (Using table.remove())
Code :
local team = game:GetService("Teams"):GetChildren() table.remove(team , "Lobby")
Output :
ServerScriptService.Script:2: bad argument #2 to 'remove' (number expected, got string)
Attempt 2 (Finding the position and then removing it with table.remove())
Code :
local team = game:GetService("Teams"):GetChildren() print(team)
Output :
table: 0xe3a8b27dd6e99e38
Help is really appreciated!!!
Sadly, Roblox doens't supply a way to get the index of an item from an array. But you can use this workaround:
local teams = game:GetService("Teams"):GetChildren() local team = teams.Lobby for key,value in pairs (teams) do if team then table.remove(teams,team) end end
Even then, why would you want to remove the team?