Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function StartWaves()
- Status:FireAllClients("Current Wave : ".. Wave.Value)
- for i,v in pairs(game.Players:GetPlayers()) do
- local char = v.Character
- if char then
- local pt = char:findFirstChild("PlayerTag")
- if pt == nil then
- char:MoveTo(game.Workspace.MapHolder.Map.Spawns.Spawn.Position)
- end
- end
- end
- for i = 1,Wave.Value * math.ceil(game.Players.NumPlayers / 2) do
- wait(3.5)
- local zombies = game.ReplicatedStorage:findFirstChild("Zombies"):GetChildren()
- if zombies then
- local chooserandom = zombies[math.random(1,#zombies)]
- local chosenzombie = chooserandom:clone()
- chosenzombie.Parent = game.Workspace:findFirstChild("Zombies")
- chosenzombie:makeJoints()
- chosenzombie:MoveTo(game.Workspace.MapHolder.Map.ZombieSpawner.Position + Vector3.new(math.random(-15,15), 5, math.random(-15,15)))
- local stats = chosenzombie:findFirstChild("Stats")
- stats.Cash.Value = stats.Cash.Value + Wave.Value
- stats.Damage.Value = stats.Damage.Value + Wave.Value
- stats.Health.Value = 100 * Wave.Value
- stats.Speed.Value = stats.Speed.Value + Wave.Value / 5
- local health = stats.Health.Value
- chosenzombie.Zombie.MaxHealth = health
- chosenzombie.Zombie.Health = health
- chosenzombie.Zombie.WalkSpeed = stats.Speed.Value
- end
- end
- repeat wait() until #ZombieModel:GetChildren() == 0 or aliveCheck() == false
- if aliveCheck() == false then
- Status:FireAllClients("All players killed!")
- TeleportHome()
- else
- Wave.Value = Wave.Value + 1
- ZombieModel:ClearAllChildren()
- StartWaves()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement