Jump to content

Recommended Posts

Hello!

I'm fresh into the DST modding scene and have been working on adding custom perks to my character. He just so happens to hate rabbits, and anything rabbit-like. So I've been searching for a way for him to specifically do double damage to the only the entities under the 'rabbit', 'manrabbit', and 'bunnyman' categories, but I haven't turned anything up.

If anyone can offer some help, I'd greatly appreciate it. Thank you for reading.

There is a function in the combat component that you can use:

inst.components.combat.bonusdamagefn = function(inst, target, damage, weapon) -- Bonus damage function
	if target:HasTag("rabbit") or target:HasTag("manrabbit") then -- Check if the target has the "rabbit" or the "manrabbit" tag
		return damage -- Return the damage
	end

	return 0 -- Return no additional damage
end

Put this in your characters file under "inst:AddComponent("combat")"

1 hour ago, -t- said:

There is a function in the combat component that you can use:


inst.components.combat.bonusdamagefn = function(inst, target, damage, weapon) -- Bonus damage function
	if target:HasTag("rabbit") or target:HasTag("manrabbit") then -- Check if the target has the "rabbit" or the "manrabbit" tag
		return damage -- Return the damage
	end

	return 0 -- Return no additional damage
end

Put this in your characters file under "inst:AddComponent("combat")"

Looks like that did the trick! Thank you so much!

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