Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local serverstorage = game:GetService("ServerStorage")
- local bindables = serverstorage:WaitForChild("Bindables")
- local gameoverEvent = bindables:WaitForChild("GameOver")
- local mob = require(script.MobScript )
- local tower = require(script.TowerScript)
- local map = workspace.Grassland
- local info = workspace.Info
- local gameover = false
- map.Base.Humanoid.HealthChanged:Connect(function(health)
- if health <= 0 then
- gameover = true
- end
- end)
- for i = 3, 0, -1 do
- info.Message.Value = "Game Start in ..."..i
- task.wait(1)
- end
- for wave = 1,10 do
- info.Wave.Value = wave
- info.Message.Value = ""
- if wave <= 2 then
- mob.Spawn("Cameraman",5 * wave,map)
- mob.Spawn("Zombie", 3 * wave, map)
- elseif wave <= 5 then
- for i = 1,5 do
- mob.Spawn("Cameraman",wave,map)
- mob.Spawn("Zombie", wave, map)
- mob.Spawn("Naruto", 3, map)
- end
- elseif wave <=9 then
- mob.Spawn("Cameraman",wave,map)
- mob.Spawn("Zombie", wave, map)
- for i= 1,5 do
- mob.Spawn("Cameraman",5*(wave*0.5),map)
- mob.Spawn("Naruto", 2 *(wave*0.5), map)
- end
- elseif wave == 10 then
- mob.Spawn("Cameraman",100,map)
- end
- repeat
- task.wait(1)
- until #map.Mob:GetChildren() == 0 or gameover
- if gameover then
- info.Message.Value = "Game Over"
- break
- end
- for i = 5, 0, -1 do
- info.Message.Value = "Game Next Wave in ..."..i
- task.wait(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement