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

Need help finding source of crash (Loops)?

Asked by
Necrorave 560 Moderation Voter
10 years ago

I have a script I am having trouble trying to run. I understand it has an endless loop (The first while) running, but I wanted this script to always be running in the background.

I seem to be crashing anything this is compiled, which leads me to believe something else is endless in my script, but I am having trouble finding it.

start = true

while true do
    players = game.Players:GetChildren()

    repeat
        while start do
            for i = 1, #players, 1 do
                name = players[i].Name
                for x = 1, #players, 1 do
                    alive = game.Workspace:FindFirstChild(name, life)
                    if alive.Humanoid.Health == 0 then
                        players.remove(i)
                    end

                end
            end
        end
    until wait(120)
    wait(1)
end

If it is possible, can you just point out where in my script I may have messed up to cause a crash? Perhaps explain why if you know. I would really appreciate it.

Thanks! :)

Answer this question