Advertisement
Cavitt

xenobotlib patch

Feb 17th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.23 KB | None | 0 0
  1. function Container:CountItemsOfID(id)
  2.     local count = 0
  3.     for spot = 0, self:ItemCount() do
  4.         local item = self:GetItemData(spot)
  5.         if (item.id == id) then
  6.             count = count + math.max(item.count, 1)
  7.         end
  8.     end
  9.     return count
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement