Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Acoustic Decoy V1.0
- @inputs Fire Seat:entity
- @outputs DelayLeft
- @persist DecoysLeft Fuses:array NoiseMakers:array SIndex DelayLeft
- @trigger Fire
- if(first()|dupefinished())
- {
- DecoysLeft=10
- }
- if(~Fire&Fire&DecoysLeft&!DelayLeft)
- {
- DelayLeft=10
- DecoysLeft--
- entity():soundPlay("Launch",1.9,"acf_extra/cannons/mortars-launchers/smoke_launcher_40mm.wav")
- soundPitch("Launch",90)
- soundVolume("Launch",0.7)
- Noisy=propSpawn("models/sprops/trans/exhaust/tip_1.mdl",(entity():toWorld(vec(0,0,-5))),(entity():toWorld(ang(90,0,0))),0)
- #Noisy:propGravity(0)
- #Noisy:setBouyancy(0)
- Noisy:setMass(20)
- #Noisy:applyForce(vec(0,0,-850))
- Noisy:setTrails(15,15,2, "trails/smoke", vec(255,255,255),100)
- Noisy:propFreeze(0)
- Fuses:pushNumber(20)
- Noisy:soundPlay(SIndex,20,"ambient/gas/steam2.wav")
- soundPitch(SIndex,70)
- soundVolume(SIndex,1)
- SIndex++
- NoiseMakers:pushEntity(Noisy)
- Seat:hintDriver("Acoustic Decoy Dispensed",3)
- }
- if(NoiseMakers:count()>0|DelayLeft)
- {
- interval(200)
- for(I=1,NoiseMakers:count())
- {
- NoiseMaker=NoiseMakers[I,entity]
- FTime=Fuses[I,number]-0.2
- Fuses[I,number]=FTime
- if(FTime<=0)
- {
- NoiseMaker:propDelete()
- }
- if(!(NoiseMaker:isValid()))
- {
- Fuses:removeNumber(I)
- NoiseMakers:removeEntity(I)
- }
- if(NoiseMaker:isUnderWater())
- {
- #NoiseMaker:applyForce(vec(0,0,-1)-NoiseMaker:vel()*20)
- NoiseMaker:applyForce(-NoiseMaker:vel()*vec(0,0,40))
- }
- }
- if(DelayLeft&!(~Fire))
- {
- DelayLeft-=0.2
- if(DelayLeft<=0)
- {
- DelayLeft=0
- Seat:hintDriver("Acoustic Decoy Reloaded",3)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement