Jump to content

getAllWaterFillables() returns unexpected object


valrix

Recommended Posts

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

  • 3 weeks later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...