I'm trying to make a script that when I attack a player, the damage they will get depends on my missing health. So when I have a low hp, I will deal more damage. When I have full Hp, I have no damage. Like for example: my max HP= 250 and my current HP= 150. Therefore my damage should be 100. And it should only work when I have a knife.
This is the script I'm working on:
I suck at math so I have no idea what to do next. When I tried this script, the damage being dealt is not what I was looking for. I'm new in lua scripting.