Advertisement
Guest User

wave

a guest
Mar 26th, 2020
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. Encounter["wavetimer"] = 12
  2. t = 0
  3. b = {}
  4. types = {}
  5.  
  6. function Update()
  7.  
  8. t = t + 1
  9. if t%15 == 0 then
  10. local type1 = CreateProjectile( 'green/arrows/arrow1' , 120 , 60 )
  11. local type2 = CreateProjectile( 'green/arrows/arrow1' , 120 , 0 )
  12. local type3 = CreateProjectile( 'green/arrows/arrow1' , 120 , -60 )
  13. local type4 = CreateProjectile( 'green/arrows/arrow1' , 120 , 30 )
  14. local type5 = CreateProjectile( 'green/arrows/arrow1' , 120 , -30 )
  15. local type6 = CreateProjectile( 'green/arrows/arrow1' , 120 , 15 )
  16. local type7 = CreateProjectile( 'green/arrows/arrow1' , 120 , -15 )
  17. local type8 = CreateProjectile( 'green/arrows/arrow1' , 120 , 45 )
  18. local type9 = CreateProjectile( 'green/arrows/arrow1' , 120 , -45 )
  19. table.insert(types,type1)
  20. table.insert(types,type2)
  21. table.insert(types,type3)
  22. table.insert(types,type4)
  23. table.insert(types,type5)
  24. table.insert(types,type6)
  25. table.insert(types,type7)
  26. table.insert(types,type8)
  27. table.insert(types,type9)
  28. local bullet = types[math.random(#types)]
  29. table.insert(b,bullet)
  30. end
  31.  
  32. for i = 1 , #b do
  33. local bullet = b[i]
  34. if bullet.isactive then
  35. bullet.Move( -4 , 0 )
  36. Audio.PlaySound("ding")
  37. if bullet.x < -80 then
  38. bullet.Remove()
  39. end
  40. end
  41. end
  42.  
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement