Advertisement
Anukun_Lucifer

MainScript (EP07)

Nov 25th, 2023
2,297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | Gaming | 0 0
  1. local serverstorage = game:GetService("ServerStorage")
  2.  
  3. local bindables = serverstorage:WaitForChild("Bindables")
  4. local gameoverEvent = bindables:WaitForChild("GameOver")
  5.  
  6. local base = require(script.BaseScript)
  7. local mob = require(script.MobScript )
  8. local tower = require(script.TowerScript)
  9. local map = workspace.Grassland
  10.  
  11. local gameover = false
  12.  
  13. base.Setup(map, 500)
  14.  
  15. gameoverEvent.Event:Connect(function()
  16.     gameover = true
  17. end)
  18.  
  19. for wave = 1,10 do
  20.     if wave <= 2 then
  21.         mob.Spawn("Cameraman",5 * wave,map)
  22.         mob.Spawn("Zombie", 3 * wave, map)
  23.     elseif wave <= 5 then
  24.         for i = 1,5 do
  25.             mob.Spawn("Cameraman",wave,map)
  26.             mob.Spawn("Zombie", wave, map)
  27.             mob.Spawn("Naruto", 3, map)
  28.         end
  29.     elseif wave <=9 then
  30.         mob.Spawn("Cameraman",wave,map)
  31.         mob.Spawn("Zombie", wave, map)
  32.         for i= 1,5 do
  33.             mob.Spawn("Cameraman",5*(wave*0.5),map)
  34.             mob.Spawn("Naruto", 2 *(wave*0.5), map)
  35.         end
  36.     elseif wave == 10 then
  37.         mob.Spawn("Cameraman",100,map)
  38.     end
  39.    
  40.     repeat
  41.         task.wait(1)
  42.     until #map.Mob:GetChildren() == 0 or gameover
  43.    
  44.     if gameover then
  45.         print("Game Over")
  46.         break
  47.     end
  48.    
  49.     task.wait(1)
  50. end
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement