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

Help with for loop?

Asked by
iLegitus 130
9 years ago
    for i=250,1, -1 do      
        wait(1)
        tm.Value = "The Purge will end in "..i
        if game.ReplicatedStorage.ConfigurationData.HowManyPlayersAlive.Value == "0" then
            tm.Value = "The Competitors have been exterminated.."
            wait(1)
            tm.Value = "No Survivors remain.."
            wait(2.5)
            tm.Value = "Starting a new game.."
            script.ReFunctionate.Disabled = false
        else
            return
        end
    end

It loads up the first one : "The Purge will end in 250" But it doesnt seem to be doing the rest,(The HMPAL Value is how many players are alive,And when it loads up it is how many players are alive.)

But it doesnt seem to be doing 250,249,248 ect. Help?

2 answers

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

return stops absolutely everything, so the first time the condition fails the loop will stop. In this case, however, you don't even need else. It's useless, you didn't do anything with it except unintentionally stopping the loop.

Just remove else return

Ad
Log in to vote
0
Answered by 9 years ago

Try removing 'return' and just leave it like that.

Answer this question