RaymondFoxford Posted September 4, 2016 Share Posted September 4, 2016 Hey guys, I'm having a problem with a custom item for my character, I want it to keep the item when he dies, I figured out that I can do this with this line: Quote inst.components.inventoryitem.keepondeath = true okay, but the problem is, it only works if the character is holding the item in the equip slot, if the item is sitting on his inventory or in his bag, the item drops if he dies this is how I put the line inside the item.lua, under the local function fn() Quote inst:AddComponent("inventoryitem") inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.atlasname = "images/inventoryimages/itemmeteor.xml" inst:AddComponent("equippable") inst.components.inventoryitem.keepondeath = true inst.components.equippable:SetOnEquip( onequip ) also, can you help me to make the item specific to my character? like only my character is able to used it, and if the item is stored in a chest or is on the ground, another character won't be able to pick it up and it say something about it. I tried to follow instructions from another post with a subject similar to this, but it just didn't work. Quote inst.components.characterspecific:SetOwner("raymond") can you guys help me out? I'm almost done with my mod. Thanks ~ Link to comment https://forums.kleientertainment.com/forums/topic/69971-keepondeath-characterspecific/ 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