4here4 Posted February 5, 2020 Share Posted February 5, 2020 Hello, I recently made a custom character for DST, and everything seems to work fine. The only issue is, my character starts with a nightmare amulet that I want to be unbreakable only if he's the one holding it. I tried following the instructions from this thread, but I haven't been able to get it to work. I copied the code into my mod's modmain.lua and replaced "catcoonhat" with "purpleamulet", and "wilson" with "aherea", but apparently there's more to it than that, as the durability is still going down. Any help is appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/115502-tiny-bit-of-help-wanted-with-durability/ Share on other sites More sharing options...
Yakuzashi Posted February 6, 2020 Share Posted February 6, 2020 Hi. You need to implement those changes into your item. local function OnEquip(inst, owner) owner.AnimState:OverrideSymbol("swap_body", "torso_amulets", "purpleamulet") if owner:HasTag("amuletowner") then inst.components.fueled:StopConsuming() else if inst.components.fueled then inst.components.fueled:StartConsuming() end end if owner.components.sanity ~= nil then owner.components.sanity:SetInducedInsanity(inst, true) end end this part is crucial for your success. Quote if owner:HasTag("amuletowner") then The "amuletowner" tag is just an example. You can change it however you like. Just don't forget to add a tag into your [character's.name].lua local common_postinit = function(inst) inst:AddTag("amuletowner") end Cheers Link to comment https://forums.kleientertainment.com/forums/topic/115502-tiny-bit-of-help-wanted-with-durability/#findComment-1304931 Share on other sites More sharing options...
Yakuzashi Posted February 6, 2020 Share Posted February 6, 2020 Well. You are welcome Link to comment https://forums.kleientertainment.com/forums/topic/115502-tiny-bit-of-help-wanted-with-durability/#findComment-1304993 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