Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. function get_item(npc, item)
  2. -- THIS IS WHERE YOU PUT YOUR CALLBACK
  3. some_script.npc_get_all_from_corpse(npc,item,lootable_table[item:section()])
  4.  
  5. if lootable_table[item:section()] == true then
  6. npc:transfer_item(item, transfer_to_npc)
  7. end
  8. end
  9.  
  10. function get_all_from_corpse(npc)
  11. printf("GET ALL FROM CORPSE")
  12.  
  13. local corpse_npc_id = db.storage[npc:id()].corpse_detection.selected_corpse_id
  14. local corpse_npc = db.storage[corpse_npc_id] and db.storage[corpse_npc_id].object
  15.  
  16. if corpse_npc == nil then
  17. return
  18. end
  19.  
  20. transfer_to_npc = npc
  21. corpse_npc:iterate_inventory(get_item, corpse_npc)
  22.  
  23. if math.random(100) > 20 then
  24. xr_sound.set_sound_play(npc:id(), "corpse_loot_begin")
  25. else
  26. xr_sound.set_sound_play(npc:id(), "corpse_loot_bad")
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement