How to Check if there Two Player in a Folder

while true do
	wait(1)
	
	local List = game.ServerStorage.Queue
	
	for i,v in pairs(List:GetChildren()) do
			print("More than 2 players")
	end

end

So for I got the basics of the script. The folder is in Server storage. Every time a player clicks a GUI a bool value with the player name is added. I want to know how to check if there more than two bool values in the folder in server storage.

2 Likes

Just make a table and add those to the table then if it goes to the slot [3] it will be nil or use the i value which will tell you how many times

2 Likes
while true do
	wait(1)
	
	local List = game.ServerStorage.Queue
	
	for i,v in pairs(List:GetChildren()) do
		if  i >= 2 then
  	        print("More than 2 players")
	end
end
end

Check if that solves your issue.

3 Likes