Jump to content

needed scripts to character


Recommended Posts

For the mighty forum members, i need ur help with scripts to my character mod.

 

My character is mad warrior enjoying fights, so I need for him adequate Script, additionally he does not like flowers and eats only prepared food.

 

Going to the point, the character during the fight instead of losing sanity should regenerate it. By killing restore his life, as Wigfrid, able to eat only cooked food over a fire or in a pot, otherwise loses 20 sanity, the same is the collection of flowers and wearing a garland, it must result in the loss of sanity.

 

sorry for my English, I don't have too many opportunities to use it in practice

Link to comment
Share on other sites

well here's one way

	inst:ListenForEvent("entity_death", function(wrld, data) 		if data.cause == inst.prefab then			local delta = 999999999999999 -- amount			inst.components.health:DoDelta(delta)                        inst.components.sanity:DoDelta(delta)                        inst.components.hunger:DoDelta(delta)		end	end, GetWorld())

and of course you can change the amount to anything

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