Advertisement
Guest User

scout script

a guest
Nov 20th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. local base = piece 'base'
  2. local hull = piece 'hull'
  3. local emit_gun1 = piece 'emit_gun1'
  4. local emit_gun2 = piece 'emit_gun2'
  5. local emit_thrust1 = piece 'emit_thrust1'
  6. local emit_thrust2 = piece 'emit_thrust2'
  7.  
  8. local gun
  9. local moving
  10. local GUNFLARE = 1024+0
  11. local EXPLOSION = 1025+0
  12. local SIG_AIM1 = 2
  13.  
  14. local function SmokeUnit()
  15. while true do
  16. health = select(1, Spring.GetUnitHealth(unitID) ) / select(2, Spring.GetUnitHealth(unitID) )
  17. if health < 25 then
  18. EmitSfx( hull, SFXTYPE_BLACKSMOKE )
  19. end
  20. Sleep(1500)
  21. end
  22. end
  23.  
  24. ------------------------ ACTIVATION
  25. function script.Create()
  26. gun = 1
  27. moving = false
  28. StartThread(SmokeUnit)
  29. end
  30.  
  31. function script.Activate()
  32. moving = true
  33. end
  34.  
  35. function script.StopMoving()
  36. moving = false
  37. end
  38.  
  39. --weapon 1 -----------------------------------------------------------------
  40. function script.QueryWeapon1(piecenum)
  41. if gun <= 0 then
  42. piecenum = emit_gun1
  43. else
  44. piecenum = emit_gun2
  45. end
  46. endd
  47.  
  48. function script.AimFromWeapon1 ()
  49. return hull end
  50.  
  51. function script.AimWeapon1(heading, pitch)
  52. Signal(SIG_AIM1)
  53. SetSignalMask(SIG_AIM1)
  54. return true
  55. end
  56.  
  57. function script.FireWeapon1()
  58. if gun>(-1) then
  59. EmitSfx( emit_groundflash_r, GROUNDFLASH )
  60. else
  61. EmitSfx( emit_groundflash_l, GROUNDFLASH )
  62. end
  63. gun = gun*(-1)
  64. return(1)
  65. end
  66. --------------------------------------------
  67.  
  68. function script.Killed(recentDamage, maxHealth)
  69. return(1)
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement