Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Container:CountItemsOfID(id)
- local count = 0
- for spot = 0, self:ItemCount() do
- local item = self:GetItemData(spot)
- if (item.id == id) then
- count = count + math.max(item.count, 1)
- end
- end
- return count
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement