Created
July 5, 2013 00:49
-
-
Save danhp/5930987 to your computer and use it in GitHub Desktop.
subracts the item from inventory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i = 1, self.sellAmount do | |
playerItem, pageIndex, slotIndex = self.player.inventory:search(item) | |
if self.player.inventory.pages[pageIndex][slotIndex].quantity > 1 then | |
playerItem.quantity = playerItem.quantity - 1 | |
elseif self.player.inventory.pages[pageIndex][slotIndex].quantity == 1 then | |
self.player.inventory:removeItem(slotIndex, pageIndex) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumes sell amount is correct