How to check how many players have a value

The title explains it self pretty good. I can’t seem to figure out on how to check how many players have a certain value. I searched almost everywhere and i can’t seem to figure it out.

My best guess is that is starts with

for i, player in pairs(game.Players:GetPlayers()) do
		if player.InGame.Value == true then		
	end
end
local PlayersThatHaveTheValue = {}

for _,plr in ipairs(game:GetService("Players"):GetPlayers()) do
	if plr.InGame.Value then
		table.insert(PlayersThatHaveTheValue,plr)
	end
end
print(#PlayersThatHaveTheValue) --> the amount of players, or length of table

ooh, smart one, i didn’t think on that one. Thank you!

1 Like

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