Advertisement
Guest User

Fire when dead script

a guest
Jan 30th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 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. }
  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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement