Counting how many players are still in round

Hello there!

I have made a round system for my game, and i want to make it so that when there are 0 people still in the round, everyone gets teleported back and the round ends. I currently have a value inside the player called “InRound”, i want to know how do i see if everyone’s value is false so that i can teleport everyone back.

Any help is greatly appreciated!

Kieran.

Pretty sure you could loop through each player and count how many there are

local amount = 0
for i, v in pairs(game.Players:GetPlayers()) do
  if v.InRound.Value == true then
    amount += 1
  end
end

if amount == 0 then
  endround()
end

Although I think using teams would be a lot easier than doing this