Jump to content

Is it possible to remove a custom character's max Health?


Recommended Posts

Hey!

What I mean by removing: Let's say this survivor - who has a starting/max Health of 150 - consumes a Spider Gland at full Health. This action should raise his maximum Health to 158. This "Health cap raise" should happen every time a healing action similarly fills the Health bar with excess heal.

Is this way too advanced, or is it solveable with a relatively simple local function?

If it's too overwhelming for an intermediate-leveled folk like me, just hit me with your favourite Gordon Ramsey roast.

Thanks in advance!

Link to comment
Share on other sites

think the easiest way to do it is to just listenforevent the healthdelta

  1. Check if afflicter is component.healer and amount > 0
  2. SetPercent to OldPercent and check if currenthealth + amount > maxhealth if true set maxhealth to currenthealth + amount
  3. Otherwise if the value is < 0 and attempt to reset our maxhealth to either math.max(truemaxhealth, currenthealth)
  4. You can look at how some mods change their health badge, you can probably do something similar to make it look like overheal

It might not be the most desired code, but it sure is the simplest for those who don't feel like extending functions like setval to do the same thing.

  • Like 2
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...