Hitboo Posted November 17, 2016 Share Posted November 17, 2016 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 Link to comment https://forums.kleientertainment.com/forums/topic/71789-custom-item-death-protection/ Share on other sites More sharing options...
Mobbstar Posted November 18, 2016 Share Posted November 18, 2016 (edited) I cheated a bit with the defibrillator in Industrial Resolution. It's a regular resurrector. Check the full mod for the code. Edited November 18, 2016 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/71789-custom-item-death-protection/#findComment-839065 Share on other sites More sharing options...
Hitboo Posted November 21, 2016 Author Share Posted November 21, 2016 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) Link to comment https://forums.kleientertainment.com/forums/topic/71789-custom-item-death-protection/#findComment-840108 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now