Jump to content

how to create about regen mod


Spellmonny
 Share

Recommended Posts

Hi @Spellmonny, welcome to the forums!

If you're creating a new character, simply place this line in the fn function of your character lua file:

inst.components.health:StartRegen(AMOUNT, PERIOD)

AMOUNT being the health you want to recover and PERIOD how often in seconds.

If you want any character you play as to recover health, place it in your modmain.lua, like this:

AddPlayerPostInit(function(inst)
	if inst.components.health then
		inst.components.health:StartRegen(AMOUNT, PERIOD)
	end
end)

PS: you posted in the tutorials section. If you're looking for help with your mod, I suggest you post directly in the DS Modding section, or the DST Modding section if it's for DST.

Link to comment
Share on other sites

12 hours ago, Koro sensei said:

Where is the fn function? is it under stats?

It's the "local fn = function(inst)" in your character's prefab file, in which your character's stats are. So if you'll place the line:
inst.components.health:StartRegen(amount, period)
below your character's stats, then that should work.

  • Like 1
Link to comment
Share on other sites

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
 Share

×
  • Create New...