What is wrong with my team limit detector?

I’m not really good with GetPlayers(), but I’ve been struggling with this one script to detect if the team has at least one player on the team, if so disables the join access till that player is off

function respawned(char)
	wait()
	local player = game.Players:FindFirstChild(char.Name)
		if char:FindFirstChild("Head") ~= nil then
			for _, team in pairs(game:GetService("Teams"):GetPlayers().Manager) do
			   local players = team:GetPlayers()
			    print("Manager has " .. #players.. " players")
				if #players < 1 then
					game.ReplicatedStorage.ManagerJoinStatus.Value = true
				else
					game.ReplicatedStorage.ManagerJoinStatus.Value = false
			end
		end
	end
end

game.Workspace.ChildAdded:connect(respawned)
1 Like

Do you want to loop through all the teams or only through the players in the Manager team?

1 Like

Only for those who are the manager team. 30 characters

Then you could do:

local players = game:GetService("Teams").Manager:GetPlayers()
1 Like