Jump to content

Recommended Posts

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.

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

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