NeddoFreddo 1058 Report post Posted August 3, 2016 (edited) heyo, I've added a custom fridge structure, and all is good except for one thing. I'd like it to only accept meats and vegetables, also not accept a specific custom prefab which happens to be meat. Thanks if you can help! Edited August 3, 2016 by NeddoFreddo tanks - thanks Share this post Link to post Share on other sites
Joachim 351 Report post Posted August 3, 2016 (edited) Inside your custom container prefab constructor function, you need to call: inst.components.container:WidgetSetup("custom_container", data) This is the code from the icebox for data: -------------------------------------------------------------------------- --[[ icebox ]] -------------------------------------------------------------------------- local data = { widget = { slotpos = {}, animbank = "ui_chest_3x3", animbuild = "ui_chest_3x3", pos = Vector3(0, 200, 0), side_align_tip = 160, }, type = "chest", } for y = 2, 0, -1 do for x = 0, 2 do table.insert(data.widget.slotpos, Vector3(80 * x - 80 * 2 + 80, 80 * y - 80 * 2 + 80, 0)) end end data.itemtestfn = function(container, item, slot) if item:HasTag("icebox_valid") then return true end --Perishable if not (item:HasTag("fresh") or item:HasTag("stale") or item:HasTag("spoiled")) then return false end --Edible for k, v in pairs(FOODTYPE) do if item:HasTag("edible_"..v) then return true end end return false end If you want it to only accept meats and vegetables, except for one custom prefab, then you mold itemtestfn into this: data.itemtestfn = function(container, item, slot) return item.components.edible and (item.components.edible.foodtype == FOODTYPE.MEAT or item.components.edible.foodtype == FOODTYPE.VEGGIE) and not item.prefab == "banned_custom_meat_prefab" end Edited August 3, 2016 by Joachim Share this post Link to post Share on other sites