valrix Posted September 29, 2014 Share Posted September 29, 2014 When attempting the following code, I get a broken ComboItem instead of a table of InventoryItems:local waterFillables = player:getInventory():getAllWaterFillables();for _, fillable in ipairs(waterFillables) do if fillable:getUsedDelta() < 100 then subMenu:addOption(fillable:getName(), clickedItems, DryTowelsMenu.onWringItem, fillable, item); endend Link to comment Share on other sites More sharing options...
EnigmaGrey Posted September 30, 2014 Share Posted September 30, 2014 print (fillable:getClass()) Link to comment Share on other sites More sharing options...
valrix Posted October 1, 2014 Author Share Posted October 1, 2014 print (fillable:getClass())This fails silently, but print(waterFillables) returns java.util.ArrayList. Link to comment Share on other sites More sharing options...
valrix Posted October 19, 2014 Author Share Posted October 19, 2014 Figured out my problem. I was trying to iterate through it incorrectly, which needs to be done like this:local waterFillables = player:getInventory():getAllWaterFillables();for i = 0, waterFillables:size() - 1 do print(waterFillables:get(i));end Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now