Advertisement
dunkakika

Untitled

May 23rd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. function drop(self)
  2. local typ
  3. if dropList[self] ~= nil then
  4. if dropList[self].typ ~= "drop" then
  5. typ = "drop"
  6. elseif dropList[self].typ ~= "limit" then
  7. typ = "limit"
  8. end
  9. end
  10. if typ == "limit" then
  11. if dropList[self].min_level ~= nil or dropList[self].max_level ~= nil then
  12. return
  13. end
  14. if dropList[self].min_level > pc.level or dropList[self].max_level < pc.level then
  15. return
  16. end
  17. local chance,count
  18. table.foreach(dropList[self].dropps, function(i)
  19. if dropList[self].dropps[i][3] ~= nil then
  20. chance = dropList[self].dropps[i][3]
  21. else
  22. chance = 100
  23. end
  24. if dropList[self].dropps[i][2] ~= nil then
  25. count = dropList[self].dropps[i][2]
  26. else
  27. count = 1
  28. end
  29. if math.random(1, 100) < chance then
  30. game.drop_item_with_ownership(dropList[self].dropps[i][1], count)
  31. end
  32. end)
  33. elseif typ == "drop" then
  34. local chance,count
  35. table.foreach(dropList[self].dropps, function(i)
  36. if dropList[self].dropps[i][3] ~= nil then
  37. chance = dropList[self].dropps[i][3]
  38. else
  39. chance = 100
  40. end
  41. if dropList[self].dropps[i][2] ~= nil then
  42. count = dropList[self].dropps[i][2]
  43. else
  44. count = 1
  45. end
  46. if math.random(1, 100) < chance then
  47. --pc.give_item2(dropList[self].dropps[i][1], count)
  48. game.drop_item_with_ownership(dropList[self].dropps[i][1], count)
  49. end
  50. end)
  51. end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement