I've got a script that is placed into every team that is created just for testing purposes. I'm trying to get it to check to see that if a team is empty it will destroy that team.
Here are the things I've tried.
if #script.Parent:GetPlayers() == 0 then
script.Parent.Destroy()
end
if #script.Parent:GetPlayers() == nil then
script.Parent.Destroy()
end
Surely, either one of these should work, considering you can use team:GetPlayers() to check to see if anyone is in the team. And the # just returns the number of players.

4 comments
what
Simple question, I've tried deleting empty teams, but can't. I've posted one of my attempts.
Check your syntax.
The first version should work. Any errors?