How to make a number go higher with lower health

I am trying to make a system where a “rage” value goes up based on if your health is being lowered. Here’s the function for it.

chr.Humanoid.HealthChanged:connect(function(GRRRNG)
	ragelevel = math.modf(human.Health / 100)
	print("New RAGE Level: "..ragelevel)
end)

Anyone know how to make it work?

Shudnt math.modf return 2 values?. That is the integral and fractional num?

rage = Hum.MaxHealth - hum.Health

1 Like

well idk
i have no idea
havent checked how it works

And also the param provided is the new health val.

https://developer.roblox.com/en-us/api-reference/property/Humanoid/MaxHealth

Hum.MaxHealth - hum.Health this mean if health get down the rage go up

chr.Humanoid.HealthChanged:connect(function(GRRRNG)
	ragelevel = math.round(100 / human.Health)
	print("New RAGE Level: "..ragelevel)
end)