Advertisement
peacestorm

addOrDropItem

Apr 15th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. Player.addOrDropItem = function(id, amount, data) {
  2. let count_before = Player.getAmountOfItemInInv(id);
  3. Player.addItemInventory(id, amount, data);
  4. let count_after = Player.getAmountOfItemInInv(id);
  5. if(!(count_after > count_before)) {
  6. Level.dropItem(getPlayerX(), getPlayerY(), getPlayerZ(), 0, id, amount, data);
  7. }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement