Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local zombieCount = game.ReplicatedStorage:WaitForChild("ZombiesRemaining")
- local zombiesAlive = game.ReplicatedStorage:WaitForChild("ZombiesAlive")
- local gameInProgress = game.ReplicatedStorage:WaitForChild("GameInProgress")
- local wave = game.ReplicatedStorage:WaitForChild("Wave")
- local roundMsg = game.ReplicatedStorage:WaitForChild("RoundMsg")
- local roundTime = game.ReplicatedStorage:WaitForChild("RoundTime")
- local finalWave = game.ReplicatedStorage:WaitForChild("FinalWave")
- local timeToWar = game.ReplicatedStorage:WaitForChild("TimeToWar")
- local counter = game.ReplicatedStorage:WaitForChild("Counter")
- local boss = game.ReplicatedStorage:WaitForChild("Boss")
- local timeAfterGame = game.ReplicatedStorage:WaitForChild("TimeAfterGame")
- while true do
- for i = timeToWar.Value, 0, -1 do
- roundMsg.Value = "Game Starting in: " .. i
- wait(1)
- end
- counter.Value = roundTime.Value
- zombieCount.Value = 5
- zombiesAlive.Value = 5
- wave.Value = 1
- gameInProgress.Value = true
- repeat
- if counter.Value == 0 then
- roundMsg.Value = "You lost!"
- game.Workspace.Zombies:ClearAllChildren()
- gameInProgress.Value = false
- else
- roundMsg.Value = "Round: " .. wave.Value .. " Time: " .. counter.Value
- wait(1)
- counter.Value = counter.Value - 1
- end
- if zombiesAlive.Value == 0 then
- wave.Value = wave.Value + 1
- if wave.Value == finalWave.Value + 1 then
- roundMsg.Value = "Congratulations, you win!!!"
- gameInProgress.Value = false
- else
- for i = timeToWar.Value, 0, -1 do
- roundMsg.Value = "Next wave in: " .. i
- wait(1)
- end
- counter.Value = roundTime.Value
- zombieCount.Value = 1 * wave.Value
- zombiesAlive.Value = 1 * wave.Value
- if wave.Value == finalWave.Value then
- local copy = boss:Clone()
- copy.Parent = game.Workspace.Zombies
- zombiesAlive.Value = zombiesAlive.Value + 1
- end
- end
- end
- until gameInProgress.Value == false
- wait(timeAfterGame.Value)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement