On_The_Edge

Inhalte aller Container mit Lager1

Feb 23rd, 2021 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.27 KB | None | 0 0
  1. storagesum = component.proxy(component.findComponent("Lager1"))
  2.  
  3. local sum = 0
  4. local x = 0 -- Anzhal der Container auf 0
  5.  
  6. for _,m in ipairs(storagesum) do
  7. x = x +1
  8. sum = sum + m:getInventories()[1].ItemCount
  9. end
  10.  
  11.  
  12. print(sum, x) -- Summe Items, Anzahl der Container
  13.  
Add Comment
Please, Sign In to add comment