Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is it possible to delete empty teams?

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

2

what

0

Simple question, I've tried deleting empty teams, but can't. I've posted one of my attempts.

0

Check your syntax.

0

The first version should work. Any errors?

1 answer

I do not think so. You could disable the team and make it un joinable with a script.

This discussion is preserved as it was. New answers, comments, and votes are closed.