Advertisement
RedDeadlyCreeper

Acoustic Decoy

Dec 29th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. @name Acoustic Decoy V1.0
  2. @inputs Fire Seat:entity
  3. @outputs DelayLeft
  4. @persist DecoysLeft Fuses:array NoiseMakers:array SIndex DelayLeft
  5. @trigger Fire
  6. if(first()|dupefinished())
  7. {
  8. DecoysLeft=10
  9. }
  10. if(~Fire&Fire&DecoysLeft&!DelayLeft)
  11. {
  12. DelayLeft=10
  13. DecoysLeft--
  14. entity():soundPlay("Launch",1.9,"acf_extra/cannons/mortars-launchers/smoke_launcher_40mm.wav")
  15. soundPitch("Launch",90)
  16. soundVolume("Launch",0.7)
  17.  
  18. Noisy=propSpawn("models/sprops/trans/exhaust/tip_1.mdl",(entity():toWorld(vec(0,0,-5))),(entity():toWorld(ang(90,0,0))),0)
  19. #Noisy:propGravity(0)
  20. #Noisy:setBouyancy(0)
  21. Noisy:setMass(20)
  22. #Noisy:applyForce(vec(0,0,-850))
  23. Noisy:setTrails(15,15,2, "trails/smoke", vec(255,255,255),100)
  24. Noisy:propFreeze(0)
  25.  
  26. Fuses:pushNumber(20)
  27. Noisy:soundPlay(SIndex,20,"ambient/gas/steam2.wav")
  28. soundPitch(SIndex,70)
  29. soundVolume(SIndex,1)
  30. SIndex++
  31. NoiseMakers:pushEntity(Noisy)
  32. Seat:hintDriver("Acoustic Decoy Dispensed",3)
  33. }
  34.  
  35. if(NoiseMakers:count()>0|DelayLeft)
  36. {
  37. interval(200)
  38. for(I=1,NoiseMakers:count())
  39. {
  40. NoiseMaker=NoiseMakers[I,entity]
  41. FTime=Fuses[I,number]-0.2
  42. Fuses[I,number]=FTime
  43. if(FTime<=0)
  44. {
  45. NoiseMaker:propDelete()
  46. }
  47. if(!(NoiseMaker:isValid()))
  48. {
  49. Fuses:removeNumber(I)
  50. NoiseMakers:removeEntity(I)
  51. }
  52. if(NoiseMaker:isUnderWater())
  53. {
  54. #NoiseMaker:applyForce(vec(0,0,-1)-NoiseMaker:vel()*20)
  55. NoiseMaker:applyForce(-NoiseMaker:vel()*vec(0,0,40))
  56. }
  57.  
  58. }
  59. if(DelayLeft&!(~Fire))
  60. {
  61. DelayLeft-=0.2
  62. if(DelayLeft<=0)
  63. {
  64. DelayLeft=0
  65. Seat:hintDriver("Acoustic Decoy Reloaded",3)
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement