Advertisement
Guest User

Fire when dead script

a guest
Jan 30th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.26 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;ON SPAWN;;;;;;;;;;;;;;;;;;;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. ;;;;;;;;Sounds to link;;;;;;;;;;
  6. {link_sound "rifle" "weapon/shot/rifle"}
  7. {link_sound "smg" "weapon/shot/smg/type2smg_burst"}
  8. {link_sound "pistol" "weapon/shot/pistol"}
  9. {link_sound "mgun" "weapon/shot/mgun/bar_burst"}
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  11.  
  12. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  13. ;;;;;;;;ON SPAWN END;;;;;;;;;;;;;;;;;;;
  14. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  15.  
  16.  
  17. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  18. ;;;;;;;;DIE WITH BLOOD;;;;;;;;;
  19. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  20. ;Change this to any number
  21. {if rand 0.9 {tags add "last_shot"}} ;When units die, their hand can twitch and the gun will fire, like in those action movies
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  23.  
  24. {if tagged "riflew" ;last_shot scarface
  25. {if rand 0.3 {delay 0.1 {call "last_shot"}}
  26. else rand 0.3 {delay 0.4 {call "last_shot"}}
  27. else {delay 0.8 {call "last_shot"}}}}
  28.  
  29. {if tagged "pistolw"
  30. {if rand 0.3 {delay 0.1 {call "last_shot"}}
  31. else rand 0.3 {delay 0.4 {call "last_shot"}}
  32. else {delay 0.8 {call "last_shot"}}}}
  33.  
  34. {if tagged "smgw"
  35. {if rand 0.3 {delay 0.1 {call "last_shot"}{delay 0.1 {call "last_shot"}}{delay 0.2 {call "last_shot"}}{delay 0.3 {call "last_shot"}}{delay 0.4 {call "last_shot"}}{delay 0.5 {call "last_shot"}}{delay 0.6 {call "last_shot"}}{delay 0.7 {call "last_shot"}}{delay 0.8 {call "last_shot"}}}
  36. else rand 0.3 {delay 0.4 {call "last_shot"}{delay 0.1 {call "last_shot"}}{delay 0.2 {call "last_shot"}}{delay 0.3 {call "last_shot"}}{delay 0.4 {call "last_shot"}}{delay 0.5 {call "last_shot"}}{delay 0.6 {call "last_shot"}}{delay 0.7 {call "last_shot"}}{delay 0.8 {call "last_shot"}}}
  37. else {delay 0.8 {call "last_shot"}{delay 0.1 {call "last_shot"}}{delay 0.2 {call "last_shot"}}{delay 0.3 {call "last_shot"}}{delay 0.4 {call "last_shot"}}{delay 0.5 {call "last_shot"}}{delay 0.6 {call "last_shot"}}{delay 0.7 {call "last_shot"}}{delay 0.8 {call "last_shot"}}}
  38. }}
  39.  
  40. {if tagged "mgunw"
  41. {if rand 0.3 {delay 0.1 {call "last_shot"}{delay 0.1 {call "last_shot"}}{delay 0.2 {call "last_shot"}}{delay 0.3 {call "last_shot"}}{delay 0.4 {call "last_shot"}}{delay 0.5 {call "last_shot"}}{delay 0.6 {call "last_shot"}}{delay 0.7 {call "last_shot"}}{delay 0.8 {call "last_shot"}}}
  42. else rand 0.3 {delay 0.4 {call "last_shot"}{delay 0.1 {call "last_shot"}}{delay 0.2 {call "last_shot"}}{delay 0.3 {call "last_shot"}}{delay 0.4 {call "last_shot"}}{delay 0.5 {call "last_shot"}}{delay 0.6 {call "last_shot"}}{delay 0.7 {call "last_shot"}}{delay 0.8 {call "last_shot"}}}
  43. else {delay 0.8 {call "last_shot"}{delay 0.1 {call "last_shot"}}{delay 0.2 {call "last_shot"}}{delay 0.3 {call "last_shot"}}{delay 0.4 {call "last_shot"}}{delay 0.5 {call "last_shot"}}{delay 0.6 {call "last_shot"}}{delay 0.7 {call "last_shot"}}{delay 0.8 {call "last_shot"}}}
  44. }}
  45. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  46. ;;;;;;;;DIE WITH BLOOD END;;;;;;;;;
  47. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  48. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  49. ;;;;;;;;Place anywhere;;;;;;;;;
  50. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  51. ;;
  52. {on "last_shot" ; this is for the people who have the jamming tutorial
  53. {if tagged "riflew" {if tagged "last_shot" {call "fire_gundead"}}}
  54. {if tagged "smgw" {if tagged "last_shot" {call "fire_gundead"}}}
  55. {if tagged "pistolw" {if tagged "last_shot" {call "fire_gundead"}}}
  56. {if tagged "mgunw" {if tagged "last_shot" {call "fire_gundead"}}}
  57. }
  58.  
  59.  
  60. {on "fire_gundead"
  61. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SOUNDS FOR WEAPON TYPE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  62. {if tagged "riflew" {play_sound "rifle"} } ;will play weapon shot sounds
  63. {if tagged "smgw" {if rand 0.75 {play_sound "smg"}} }
  64. {if tagged "pistolw" {play_sound "pistol"}}
  65. {if tagged "mgunw"{if rand 0.75 {play_sound "mgun"}} }
  66. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  67. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Fake Muzzle Flash;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  68. {view show "flashbarrel"}{view start "flashbarrel"}{delay 0.5{view pause "flashbarrel"}{view stop "flashbarrel"} } ;firing effect
  69. {spawn "bulletf" "foresight3" x {impulse forward 200 no_position}{gravity -5}} ;cx 5 2 cy 5 2 cz 5 2} } ;fire fake bullet
  70. }
  71. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  72. ;;;;;;;;Place anywhere end;;;;;;;;;
  73. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  74. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  75. ;;;;;;;;link_weapon;;;;;;;;;
  76. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  77. (define "tags_remove" ; so weapons switch their data on weapon switch.
  78. {tags remove "pistolw mgunw riflew shotgunw smgw sniperw flamew"} ;remove old tags
  79. {tags add %weap} ;
  80. )
  81.  
  82. {on "link_weapon"
  83. {if stuff "pistol"
  84. {add_view "flash_gun_small" "flashbarrel" "foresight3"}
  85. {add_view "shell_smg" "shell" "FXshell"}
  86. ("tags_remove" weap("pistolw")) ;
  87. else stuff "shotgun"
  88. {add_view "flash_gun_big" "flashbarrel" "foresight3"}
  89. {add_view "shell_shotgun" "shell" "FXshell"}
  90. ("tags_remove" weap("shotgunw")) ;
  91. else stuff "rifle"
  92. {add_view "flash_gun_small" "flashbarrel" "foresight3"}
  93. {add_view "shell_mgun" "shell" "FXshell"}
  94. ("tags_remove" weap("riflew")) ;
  95. else stuff "smg"
  96. {add_view "flash_gun_small" "flashbarrel" "foresight3"}
  97. {add_view "shell_smg" "shell" "FXshell"}
  98. ("tags_remove" weap("smgw")) ;
  99. else stuff "mgun"
  100. {add_view "flash_gun_big" "flashbarrel" "foresight3"}
  101. {add_view "shell_mgun" "shell" "FXshell"}
  102. ("tags_remove" weap("mgunw")) ;
  103. else stuff "flame_thrower"
  104. {add_view "flamer_fire" "flame" "foresight3"}
  105. {add_view "flamer_fire_barrel" "fire" "foresight3"}
  106. {view show "fire"}
  107. {view start "fire"}
  108. ("tags_remove" weap("flamew")) ;
  109. else
  110. {view hide "flashbarrel"}
  111. {view pause "flashbarrel"}
  112. {view pause "flame"}
  113. }
  114. }
  115. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  116. ;;;;;;;;link_weapon end;;;;;;;;;
  117. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132. ;;;;;;;;;;;;;;;;;;;;;;;;
  133. ;;;;;;;Blast_Hit;;;;;;;
  134. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  135.  
  136.  
  137.  
  138.  
  139. {if stuff "bullete"
  140. {if rand 0.05 ("health_damage" c(190))
  141. else rand 0.1 ("health_damage" c(25))
  142. else rand 0.1 ("health_damage" c(35))
  143. else rand 0.1 ("health_damage" c(45))
  144. else rand 0.1 ("health_damage" c(55))
  145. else rand 0.1 ("health_damage" c(65))
  146. else rand 0.1 ("health_damage" c(75))
  147. else rand 0.1 ("health_damage" c(85))
  148. else rand 0.1 ("health_damage" c(95))
  149. else rand 0.1 ("health_damage" c(105))
  150. else rand 0.1 ("health_damage" c(115))
  151. else rand 0.1 ("health_damage" c(125))
  152. else rand 0.1 ("health_damage" c(135))
  153. else ("health_damage" c(65))}
  154. }
  155.  
  156. ;;;;;;;;;;;;;;;;;;;;;;;;
  157. ;;;;;;;Blast_Hit End;;;;;;;
  158. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  159.  
  160.  
  161.  
  162.  
  163.  
  164. ;;;;;;;;;;;;;;;;;;;;;;;;;;;
  165. ;;;;;;Place Anywhere Outside of {"Human" bracket;;;;;;
  166. ;;;;;;;;;;;;;;;;;;;;;;;;;
  167. {"bulletf"
  168. {on "loop"
  169. ;{if altitude 5{delete}} ;if the height is above 5 , prevent bullet from getting to the four corners of the map lol
  170. {if not altitude 0.15{delete}} ;if the height is below 0.15, prevent bullet from getting to the ground since the animation had the gun pointed in the wrong direction. And in Snow, it causes an explosion, FIXED
  171. {spawn "bullete" "basis"{stuff_detonate}} ;else the small explosion that connects damage when you search for ;bullete
  172. {if rand 0.015 {start_sound "sonne2/effects/bullet_crack"}};{link_sound "crack" "sonne2/effects/bullet_crack"}{play_sound "crack"}} ;CTA bullet crack sounds
  173. {delay 0.001 {call "loop"}}
  174. }
  175. {on spawn
  176. {add_view "tracefa" "tracefa" "basis"}
  177. ;{add_view "bullet_tail" "bullet_tail" "basis"}
  178. {view start "tracefa"}
  179. {delay 1 {delete}}
  180. {scale from 0.05 to 0.05 time 0.1}
  181. ;{view start "tracefa"}
  182. ;no_position}
  183. ;{gravity 1}
  184. {delay 0.05 {call "loop"}{tags add "looped"}}
  185. }
  186. {on contact
  187. {if tagged "looped"
  188. {if not "contact"
  189. {set "contact" 1}
  190. {spawn "ex_bul_sm"}
  191. {delete}
  192. }}}
  193. {on ground_hit
  194. {if tagged "looped"
  195. {if not "contact"
  196. {set "contact" 1}
  197. {spawn "ex_bul_sm"}
  198. {delete}
  199. }}}
  200. }
  201. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  202. ;;;;;;Place Anywhere Outside of {"Human" bracket End;;;;;;
  203. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement