Hello fellow users, today I tried to make a folder check for my round system, everything works fine but I wan't to do when every player dies the game endes, and I tried those scripts:
local rep = game:GetService("ReplicatedStorage")
local playerInGames = rep.PlayersInGame
local matchRunning = rep.Variables:WaitForChild("matchRunning")
if playerInGames < 1 and matchRunning.Value == true then
print"game ended, all players died."
end
I tried this also:
function isEmpty(t)
return next(t) ~= nil
end
The first try gave the error: "attempt to compare Instance and number "
Please help xD, Have a nice day!

2 comments
didn't work, i did a print to check and it said it was with things inside when clearly wasn't
Then try #playerInGames:GetChildren() == 0