Need help with equation

Right, currently working on an unfinished addon and I need a little math help. I’m trying to create an equation or number of operations that would allow me to calculate someones health and charge them for a set amount. But the problem I’m running into is that the higher your health is the more it cost to get you back to 100. So It would be cheaper to get down all the way to 1 health, then buy health at 50 health. I hope I’m explaining this well.

If you health is 50 and I do some equation like:


playerHealth / 2 * -15 

then it will be cheaper the lower your health is. I need it opposite. To where the lower your health is the higher the charge will cost. I’ve tried all mathematical operators, and relational operators. Nothing seems to work. If someone could assist me with this that would be great.

Nevermind I figured it out.


playerHealth / -a + b

This basically reverts the health system… in way.