Checking if team has less than 10 player not working (Solved)

  1. What do you want to achieve? Keep it simple and clear!
    I’m trying to check if a team has less than 10 player

  2. What is the issue? Include screenshots / videos if possible!
    the function below:

if #game.Teams.Playing:GetPlayers() > 10 then
	print("test")
end

when played, it doesn’t print

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    its up there

you are actually checking whether the team has more then 10 players you should type “<” instead of “>”

What you are doing here is checking if there is more than 10, if 10 is the maximum you want to check for you should use “<” , which is less than, you might also want to make sure you include the 10th by seeing if its less than or equal to 10 players.

if #game.Teams.Playing:GetPlayers() <= 10 then
	print("test")
end
local __MAXNUMS = 10
for d, nums in ipairs(#game:GetService("Teams").Playing:GetPlayers()) do
 if nums <= __MAXNUMS then
   print()
 end
end

You could also use GetPropertyChangedSignal since it works with Teams.

Man, im very bad at maths

tysm for the replies though

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.