Jump to content

Recommended Posts

Im trying to create a character with a custom item that is supposed to work like a live giving amulet but as unequipted item like the eye bone (more following when that id functional).
The problem is it seems like i cant get it to work, that the item prevents the dead (its supposed to be "uncharged" after the use for balancing)

Does anyone of you have an idea how to solve the problem?

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

Thanks I was missing the resurrector component. Now my next problem will be that the item drops on death... i already have the
    inst.components.inventoryitem.keepondeath = true
but it doesent seem to work at the moment (i havent looked much into it what could cause the drop yet)

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