Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. local itemsTable = {}
  2. local itemCount = 0
  3. local scanItem = 5541
  4.  
  5. for i = 4000, 4100 do
  6. houseId = i
  7. print(houseId)
  8. if tonumber(getHouseOwner(houseId)) then
  9. for _, pos in pairs(getHouseTiles(houseId)) do
  10. for _, item in pairs(getTileItems(pos)) do
  11. if (isMoveable(item.uid)) then
  12. if (isContainer(item.uid)) then
  13. for _, items in ipairs(getAllItemsFromContainer(item)) do
  14. if items.itemid == scanItem then
  15. itemCount = itemCount + 1
  16. end
  17. end
  18. else
  19. if item.itemid == scanItem then
  20. itemCount = itemCount + 1
  21. end
  22. end
  23. end
  24. end
  25. end
  26. if itemCount >= 10 then
  27. table.insert(itemsTable, {houseId, itemCount})
  28. end
  29. end
  30. itemCount = 0
  31. end
  32.  
  33. for k, v in pairs(itemsTable) do
  34. print("House id: ("..v[1].."), count: ("..v[2]..")")
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement