Jump to content

Recommended Posts

I have a hat mod and I would like to add durability to it (the same the Pith Hat has). The problem is I do not know what should I add to prefab to make hat lose durability when worn. Here is the mod if you would like to check it: https://steamcommunity.com/sharedfiles/filedetails/?id=1753641858&tscn=1559403242.

You have to add to:   

 

local function onequip(inst, owner, fname_override)

this part:

 

if inst.components.fueled then

inst.components.fueled:StartConsuming()

end

 

and to

 

local function onunequip(inst, owner)

this part:

 

if inst.components.fueled then

inst.components.fueled:StopConsuming()       

end

 

and this

 

        inst:AddComponent("fueled")
        inst.components.fueled.fueltype = "USAGE"
        inst.components.fueled:InitializeFuelLevel(TUNING.GASMASK_PERISHTIME)
        inst.components.fueled:SetDepletedFn(generic_perish)

 

You don`t have to use this TUNING.GASMASK_PERISHTIME, you can take an other one form the tuning file, but this one would be the same usage lost than the gasmask

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...