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!
You can try
if playerInGames:GetChildren == nil then