Jump to content

Is there a way to run a function on crafting of an item?


Recommended Posts

Buildable as well, if possible. I found this:

local function onequip_green(inst, owner)     owner.AnimState:OverrideSymbol("swap_body", "torso_amulets", "greenamulet")    owner.components.builder.ingredientmod = TUNING.GREENAMULET_INGREDIENTMOD    inst.onitembuild = function()        inst.components.finiteuses:Use(1)    end    inst:ListenForEvent("consumeingredients", inst.onitembuild, owner)end

and the "consumeingredients" seems to be close to what I need, but it's not quite because my mod would need to reference the prefab being built.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...