how can i add a timer between each wave i have try a few ways nothing seems to work the way i want it to
i want to add this to the pannel and have it count down until the next wave once it hits 0 the wave will start then once they spawn the counter resets to the default delay time and resets counting down once all the zombies are dead
Text(2,12,4,"Next Round In: " .. math.floor(delay - timepassed) .. "s")
[code lang=luafunction zombiespawn_init(e)
wave = 1
Killed = 0
number_of_enemies = -1
Started = -1
Kills = 0
Score = 10000
multi = 100
end
function zombiespawn_main(e)
if GetPlayerInZone(e) == 1 and Started == - 1 then
Started =1
end
if Started == 1 then
if wave == 1 then
Spawn(103)
Spawn(107)
Spawn(105)
Spawn(106)
number_of_enemies = 10
Started = 0
end
if wave == 2 then
Spawn(117)
Spawn(118)
Spawn(104)
Spawn(111)
number_of_enemies = 15
Started = 0
end
if wave == 3 then
number_of_enemies = 20
Started = 0
end
if wave == 4 then
number_of_enemies = 25
Started = 0
end
if wave == 5 then
number_of_enemies = 30
Started = 0
end
if wave == 6 then
number_of_enemies = 35
Started = 0
end
if wave == 7 then
number_of_enemies = 40
Started = 0
end
if wave == 8 then
PromptDuration("Boss Round",10000)
number_of_enemies = 5
Started = 0
end
if wave == 9 then
PromptDuration("Boss Round 2",10000)
number_of_enemies = 10
Started = 0
end
if wave == 10 then
PromptDuration("Boss Round 3",10000)
number_of_enemies = 15
Started = 0
end
if wave == 11 then
PromptDuration("Final Boss Round",10000)
number_of_enemies = 20
Started = 0
end
if Started == 0 or Started == -1 then
PromptDuration("Round " ..wave.. " Starts",10000)
end
end
if Killed == number_of_enemies then
wave = wave + 1
Killed = 0
end
Panel(1,1,20,30)
Text(2,2,4,"Round: "..wave.." ")
Text(2,5,4,"Kills: "..Kills.." ")
Text(2,8,4,"Score: "..Score.." ")
Text(2,12,4,"Next Round In: " .. math.floor(delay - timepassed) .. "s")
end]