Reposted due to no answers after 4 weeks.
So, I have been trying to make a sword fighting typed game, with only one person doing it at a time. I have added a leaderstat value named "Status" to show when each player would take their turn (ex. Fighter 1, Fighter 2, Fighter 3, etc.) and I have a working script (will be provided) that can identify fighter 1 first, and fighter 2 second. Once they get identified, they just need to get teamed, and then another script takes over and runs them through the whole game. After a bit of time using that script, I noticed that some people do leave the game for whatever reason, and I wanted to add a fix that can jump from Fighter 1 to Fighter 3, so long as Fighter 2 no longer exists in the game. Every fix I have tried only seems to A) break with no problems in the output B) get Fighter 2 to go before Fighter 1 or C) somehow runs all players at the same time even though the game is only compatible for 1 player. Does anybody have a fix?
Note that this is my first project using active leaderboard scripting, and that any fixes you may have will need to be explained very simplified / broken down for me. Thanks!
Here is the working part of the script.
local players = game.Players:GetChildren()
for i = 1,#players do
local stats = players[i]:WaitForChild("leaderstats")
local Status = stats:WaitForChild("Status")
if players[i].stats.Status.Value == "Fighter "..game.Workspace.StatScript.Fighter.Value then -- This what the strategy I originally used. After the first player finishes, the value goes up by 1, and when the game restarts, the value goes back to 1.
players[i].Team = game.Teams["Current Fighter"]
script.Script.Disabled = false -- As long as the above command works and the player is teamed, this script being enabled should take care of the whole game.
end
end

2 comments
I don't see the problem, you said it was the working part, can you post the part that doesnt work? Also, why dont you use ''for i, v in pairs(game.Players:GetChildren())"
I had given that a try before this script, and nothing was coming out of it. This script I have provided has the most working history, but anytime I add an elseif to line 5 saying that fighter value doesn't exist, it crashes and burns. With that being said, I have no idea which method of elseif would be the most efficient if working. Would you happen to have a solution?