Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with for loop?

	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

✓ Accepted answer

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.