Nuclear_Man_D

meteor_spawn.lua

Jul 3rd, 2022
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. os.loadAPI("meteor_api.lua")
  2.  
  3. if #arg < 5 then
  4. print("Usage: meteor_spawn x1 z1 x2 z2 qty")
  5. return
  6. end
  7.  
  8. x1 = tonumber(arg[1])
  9. z1 = tonumber(arg[2])
  10. x2 = tonumber(arg[3])
  11. z2 = tonumber(arg[4])
  12. qty = tonumber(arg[5])
  13.  
  14. for i=1,qty,1 do
  15. x = math.random(x1, x2)
  16. z = math.random(z1, z2)
  17. y = 50
  18. meteor_api.spawnMeteorAt(x, y, z)
  19. print("Spawned a meteor at "..tostring(x)..", "..tostring(y)..", "..tostring(z))
  20. end
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment