Jump to content

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

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