Spellmonny

how to create about regen mod

Recommended Posts

alainmcd    886

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.

Share this post


Link to post
Share on other sites
orlyx    1
On 28.06.2017 at 12:39 PM, alainmcd said:

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

Can i use this code for lossing hp?

@alainmcd

Share this post


Link to post
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