Advertisement
peacestorm

ItemInInv

Apr 14th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Player.getAmountOfItemInInv = function(id) {
  2.     let count = 0;
  3.     for(let i = 0; i < 36; i++) {
  4.         if(Player.getInventorySlot(i) == id) {
  5.             count += Player.getInventorySlotCount(i);
  6.         }
  7.     }
  8.     return count;
  9. }
  10.  
  11. //add this on top of your script, then you will be able to use Player.getAmountOfItemInInv(itemId) as a function. :)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement