Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Round ends if 1 player dies?

Asked by 10 years ago

I have a round script, inside the round script I have a table: alive = {} And when the round starts, it adds all the players to that table.

Then later along the script, I have this code to end it if only 1 or no players are alive:

        for time = 1,120 do
            wait(1)
            if breakable == true then
                break
            end

            if #alive == 1 then
                breakable = true
                        end
            if #alive == 0 then
                breakable = true
                        end

            for i,v in pairs(game.Players:GetPlayers()) do
                if v.InGame.Value == false then
                    table.remove(alive, i)
                end
            end
        end

It works, but if there are 3 players in the server, and 1 person dies, it ends the round. How can I fix that?

1 answer

Log in to vote
1
Answered by
Ekkoh 635 Moderation Voter
10 years ago

What exactly do you want to happen?

Ad

Answer this question