Advertisement
Katchau01

vertical.lua

Aug 18th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. spawntimer = 0
  2. bullets = {}
  3. function OnHit(bullet)
  4.     Player.Hurt(2)
  5. end
  6.  
  7. function Update()
  8.     spawntimer = spawntimer + 1
  9.     if spawntimer%27 == 0 then
  10.         local bullet = CreateProjectile('Wandering_Eye_Vestical', Player.x, Arena.height)
  11.         bullet.SetVar('velx', 0)
  12.         bullet.SetVar('vely', -10)
  13.         table.insert(bullets, bullet)
  14.     end
  15.  
  16.     for i=1,#bullets do
  17.         local bullet = bullets[i]
  18.         local velx = bullet.GetVar('velx')
  19.         local vely = bullet.GetVar('vely')
  20.         local newposx = bullet.x + velx
  21.         local newposy = bullet.y + vely
  22.         bullet.MoveTo(newposx, newposy)
  23.     end
  24. end
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement