Make teams not show up if there is nobody in the said team

So I am making a game where teams are needed, but I don’t want the Player list to be cluttered with teams that have nobody in them. I was wondering if I need to make a custom playerlist to do this or if I can use the standard one to do this. I want to make the teams not show up on the playerlist if there is no one in them.

Thanks,
Em

5 Likes

hello is it on the leaderboard?

there is no way to prevent teams from appearing in the leaderboard. However, you can create a system where if there are no players in a team, then remove the team from the service, this will then remove the team from the leaderboard and only create the team when there is a player who will appear there.

How can I do that? I am not a great programmer.

https://developer.roblox.com/en-us/api-reference/enum/CoreGuiType

What is the name of the one I am looking for? Also I don’t code so I don’t know how to make the teams be removed when nobody is in it

you can ask someone to program your problem on the forum

Should I pay them for it? I can give them 100 robux to make it for me.

unfortunately you can’t disable teams, but what you can do is if there is no one in a team it will disappear, here is the link to the [CoreGui](https://developer. roblox.com/en-us/api-reference/enum/CoreGuiType)

link:CoreGuiType

I honestly have no idea what to do with that information, i’m just going to pay someone to do it, I don’t think I can do it.

the link will help you with your problem

It just tells me what coreGuis there are and how to reference it, as I said i’m not a programmer so I have no idea how to actually code it. I know basic code but thats it.

-//Services

local StarterGui = game:GetService("StarterGui")

--//Variables

--?

--//Main

StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Teams,false) -- there is no such thing as teams
1 Like

I gave you the script And, there is no CoreGuiType named “Teams”

Hi. There isn’t a way to disable teams showing up and I wouldn’t carry out the system suggested by the other user. What I would do is look into maybe creating your own scoreboard GUI. You could use youtube and other resources to learn what you need.

I’d also say it’s quite a good project if you know the basics of scripting because it teaches you UI design, client / server communication and events.

This will parent teams on client to ReplicatedStorage and parent them back if someone is in that team (suggested not changing teams on client its really a bad idea with this)

This should be a local script in StarterGui
I EDITED THE SCRIPT USE THE NEW ONE I FIXXED SOME BUGS

-- Changable --
local Team1 = game.Teams.YourTeamName
local Team2 = game.Teams.YourTeamName
local Team3 = game.Teams.YourTeamName
-- Not changable --
local Team1Number = 0
local Team2Number = 0
local Team3Number = 0

while wait() do
	Team1Number = 0
	Team2Number = 0
	Team3Number = 0
	for i,v in pairs(game.Players:GetPlayers()) do
		local TeamToAddUses = v.Team
		if TeamToAddUses == Team1 then
			Team1Number = Team1Number + 1
		elseif TeamToAddUses == Team2 then
			Team2Number = Team2Number + 1
		elseif TeamToAddUses == Team3 then
			Team3Number = Team3Number + 1
		else
			Team1.Parent = game.Teams
			Team2.Parent = game.Teams
			Team3.Parent = game.Teams
			local NewTeamToAddUSes = v.Team
			if NewTeamToAddUSes == Team1 then
				Team1Number = Team1Number + 1
			elseif NewTeamToAddUSes == Team2 then
				Team2Number = Team2Number + 1
			elseif NewTeamToAddUSes == Team3 then
				Team3Number = Team3Number + 1
			else 
			return warn("Failed instance of Team.")
			end
end
end
	if Team1Number == 0 then
		Team1.Parent = game.ReplicatedStorage
	else
		Team1.Parent = game.Teams
	end
	if Team2Number == 0 then
		Team2.Parent = game.ReplicatedStorage
	else
		Team2.Parent = game.Teams
	end
	if Team3Number == 0 then
		Team3.Parent = game.ReplicatedStorage
	else
		Team3.Parent = game.Teams
	end
end
5 Likes

Here is a simple example of a team getting removed if there are no players. You can modify this to your liking and do remember, whenever a team gets added or removed, you will need to recall this loop.

for _,v in game:GetService('Teams'):GetTeams() do
	v.PlayerRemoved:Connect(function()
		if table.getn(v:GetPlayers()) == 0 then
			v:Destroy()
		end
	end)
end
1 Like

Same thing from another post, it is currently impossible to hide teams from the playerlist. But, there is many other ways of doing it, you can prob use a BoolValue or something like that.