Advertisement
Daemonion

drop weapon when shot in arm

Feb 7th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. --gives a 1:3 chance of NPCs dropping their primary weapon if they are shot in the right forearm or upper right arm. Pistols cannot be dropped.
  2.  
  3. if npc and (bone_index == 33 or bone_index == 34) then
  4. rnd = math.random(1,3)
  5. if rnd == 2 then
  6. local active_item = npc:active_item()
  7. local no_drop_items = {bolt = true, wpn_knife = true, wpn_binoc = true, wpn_beretta = true, wpn_colt1911 = true, wpn_desert_eagle = true,
  8. wpn_fort = true, wpn_hpsa = true, wpn_pb = true, wpn_pm = true, wpn_sig220 = true, wpn_usp = true, wpn_walther = true}
  9. if active_item and not no_drop_items[active_item:section()] then
  10. npc:drop_item(active_item)
  11. end
  12. end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement