Goregonzola Posted January 21, 2021 Share Posted January 21, 2021 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 More sharing options...
IronHunter Posted January 21, 2021 Share Posted January 21, 2021 think the easiest way to do it is to just listenforevent the healthdelta Check if afflicter is component.healer and amount > 0 SetPercent to OldPercent and check if currenthealth + amount > maxhealth if true set maxhealth to currenthealth + amount Otherwise if the value is < 0 and attempt to reset our maxhealth to either math.max(truemaxhealth, currenthealth) 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. 2 Link to comment Share on other sites More sharing options...
-LukaS- Posted January 21, 2021 Share Posted January 21, 2021 I'm here just for the Gordon Ramsey roast. Ya donut! 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now