I have a table, basically the alive players: (This is a round script)
alive = {}
And something that checks if a player is alive, and adds them to the table.
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("InGame") then
v.InGame.Value = true
table.insert(alive, v.Name)
end
end
And then somewhere in my round script, I'm trying to end the round within 100 seconds but I want it to only end if 100 seconds have passed, or if only 1 player, or no players are alive. So this:
for time = 1,100 do
wait(1)
for i,v in pairs(game.Players:GetPlayers()) do
if v.InGame.Value == false then
table.remove(alive, i)
end
if #alive <=1 then
break
elseif #alive == 0 then
break
end
end
end
The problem is that loop never ends, how can I make it end if only 1 player's BoolValue is true, or nobodys' is true?
(I have a separate script that turns it to false when someone dies)

5 comments
Can you edit tables from separate scripts?
Yes, if the variables are declared. You can call :GetPlayers () from any script anywhere.
No I mean can I remove players from the 'alive' table in the round script, from a different script?
Nevermind, I just used in if function inside the loop, and made a variable called Breakable. It worked perfectly. I'll still accept your answer for trying to help though.
For future readers: This is a poor solution. It adds completely unnecessary complexity.