Search the Community
Showing results for tags 'recipes'.
Found 4 results
-
So I'm working on making code for a character a friend of mine is making where the character is not able to equip any torso clothes or even craft them, but he's able to craft backpacks and armors and can also use them. The equipping part is done, but the problem I'm having is with the code for removing recipes, as I'm trying to remove the recipes that do not include the backpack tag, do not count as armor but also are body slot items. However it keeps giving me an error in the line with removing the recipes and says that components is a "nil value". The removal of recipes code: -- Removing every clothing recipes that exists for this character inst.components.builder.ignorelist = { } function inst.components.builder:AddIgnoreRecipe( recname ) self.ignorelist[ recname ] = recname end function inst.components.builder:RemoveIgnoreRecipe( recname ) self.ignorelist[ recname ] = nil end local old_CanLearn = inst.components.builder.CanLearn function inst.components.builder:CanLearn( recname ) local ret = old_CanLearn(recname) return ret and self.ignorelist[ recname ] == nil end for k, v in pairs(AllRecipes) do if IsChestClothing(v.product) then inst.components.builder:AddIgnoreRecipe(v.name) end end The code that crashed the game: local function IsChestClothing(item) if item.components.equippable and item.components.equippable.equipslot == EQUIPSLOTS.BODY and not item:HasTag("backpack") and not item.components.armor then return true else return false end end Thanks in advance!
-
meaty stew honey cooked morsel morsel honey 22 health 60 food will edit to add more delectable meals next meal will be meaty stew a la krampus add your meals to the bottom V were the bacon lives