Jump to content

Custom Item death protection


Hitboo

Recommended Posts

Im trying to create an item for a custom character. The item (for the begingn) ist planned as an live giving amulet but as passiv item like the eye bone. Can somebody help me with activating the death protection? the following bit is my current idea of how it could work but it dosent.Any Ideas qould be a help. Thanks
 

local function healOwner(inst, owner)
    if owner.components.health and owner.components.health:IsHurt()
    then
        owner.components.health:DoDelta(5,false,"mapel")
        owner.components.hunger:DoDelta(5)
    end
end

local function taskTrigger(inst, owner)
    inst.task = inst:DoPeriodicTask(0.5, function() healOwner(inst, owner) end)
end

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