Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Self.GetStorage = function()
- local temp = {}
- local slots = {Self.Head, Self.Armor, Self.Legs, Self.Feet, Self.Amulet, Self.Weapon, Self.Ring, Self.Shield, Self.Ammo}
- for i = 1, #slots do -- count slots
- local slot = slots[i]()
- if(slot.id > 0)then
- if not(temp[slot.id])then
- temp[slot.id] = 0
- end
- temp[slot.id] = temp[slot.id] + math.max((slot.count), 1)
- end
- end
- local cont = Container.GetFirst()
- while (cont:isOpen()) do
- for spot = 0, cont:ItemCount() - 1 do -- loop through all the items in loot backpack
- local item = cont:GetItemData(spot)
- if not(temp[item.id])then
- temp[item.id] = 0
- end
- temp[item.id] = temp[item.id] + math.max((item.count), 1)
- end
- cont = cont:GetNext()
- end
- return temp
- end
- print(table.serialize(Self.GetStorage()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement