This is my zombie wave that repeats until all players have died, however once they all died it stops the time and gets stuck,it does not print ("end of game")

repeat wait()
		
	for i = GameLength,0,-1 do
		
		Status.Value = ""..i.." seconds ramaining, "
		
		if zombiesAlive.Value == 0 then
            zombieCount.Value = 6 * wave.Value
            zombiesAlive.Value = 6 * wave.Value
		end
		
		if #plrs == 0 then 
			-- Last person standing
			gameInProgress = false
			Status.Value = "The winner is "..plrs[1].Name
			plrs[1].leaderstats.Points.Value = plrs[1].leaderstats.Points.Value + reward
			break
			
		elseif i == 0 then
			Status.Value = "The winner is "
			wave.Value = wave.Value + 1
			for i, player in pairs(game.Players:GetPlayers()) do
				ingame = player:FindFirstChild("ingame")
				if ingame then
					if ingame.Value == true then
					player.leaderstats.Points.Value = player.leaderstats.Points.Value + 50
					end
				end

			end
			break
		end
		wait(1)
	end
	
	until gameInProgress == false or #plrs == 0
	if gameInProgress == false then break end
	
	wave.value = 0 
	print("End of game")
	ClonedMap:Destroy()
	Status.Value = "Game Ended"
	wait(2)

end

2 comments

0

Try putting the break in the "Repeat loop" and not in the for loop. Breaks can be only used once.

0

This looks similar to an AlvinBlox script...