For Loop is skipped every time

Started by Terandox, Jun 03, 2021, 05:36 PM

Previous topic - Next topic

Terandox

I'am creating an Storage System, but im not able no get it to work, because 1 for loop is skiped every time.

I tried 36 Hours to fix it but i cant... please help

here is my code: https://pastebin.com/sdkT9bZ3

this is the skiped for loop:
for slotID,slot in pairs(myslots) do
 print("#3")
 local counterC=chests[data.id].chest.getItemDetail(slot).count
 if counterC > remainder then counterC = remainder end
 print("counterC : "..counterC)
 local debug= pushto(slot,data.id,data.name,counterC,nil,false,false,false,item)
 remainder=remainder-counterC
 end

Lupus590

Where is getSlots defined? It might be returning an empty table.