Advertisement
Anukun_Lucifer

MainScript(EP.10)

Feb 11th, 2024
1,720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 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 mob = require(script.MobScript )
  7. local tower = require(script.TowerScript)
  8. local map = workspace.Grassland
  9.  
  10. local info = workspace.Info
  11. local gameover = false
  12.  
  13. map.Base.Humanoid.HealthChanged:Connect(function(health)
  14.     if health <= 0 then
  15.         gameover = true
  16.     end
  17. end)
  18.  
  19. for i = 3, 0, -1  do
  20.     info.Message.Value = "Game Start in ..."..i
  21.     task.wait(1)
  22. end
  23.  
  24. for wave = 1,10 do
  25.     info.Wave.Value = wave
  26.     info.Message.Value = ""
  27.    
  28.     if wave <= 2 then
  29.         mob.Spawn("Cameraman",5 * wave,map)
  30.         mob.Spawn("Zombie", 3 * wave, map)
  31.     elseif wave <= 5 then
  32.         for i = 1,5 do
  33.             mob.Spawn("Cameraman",wave,map)
  34.             mob.Spawn("Zombie", wave, map)
  35.             mob.Spawn("Naruto", 3, map)
  36.         end
  37.     elseif wave <=9 then
  38.         mob.Spawn("Cameraman",wave,map)
  39.         mob.Spawn("Zombie", wave, map)
  40.         for i= 1,5 do
  41.             mob.Spawn("Cameraman",5*(wave*0.5),map)
  42.             mob.Spawn("Naruto", 2 *(wave*0.5), map)
  43.         end
  44.     elseif wave == 10 then
  45.         mob.Spawn("Cameraman",100,map)
  46.     end
  47.  
  48.     repeat
  49.         task.wait(1)
  50.     until #map.Mob:GetChildren() == 0 or gameover
  51.  
  52.     if gameover then
  53.         info.Message.Value = "Game Over"
  54.         break
  55.     end
  56.    
  57.     for i = 5, 0, -1  do
  58.         info.Message.Value = "Game Next Wave in ..."..i
  59.         task.wait(1)
  60.     end
  61. end
Tags: Roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement