How to add to a percentage of the health to the player

I want to add 10% back to the health of the player

I do not know how I have looked at many solutions none of them help me.

devforum [links wont work sorry!]

I have tried doing some of the code but it just gets the number not the percentage of what I want so for example I want to add 15%+ health to the player so if he has 500 max health and 250 min health then it would add 250+15%=287.5 then 287.5+15%=330.625 etc.

while true do
	
	local character = script.Parent
	local value = (character.Humanoid.Health / character.Humanoid.MaxHealth * 10)
	print("%"..value)
	character.Humanoid.Health = (character.Humanoid.Health + value)
	
	wait(15)
end

This script doesn’t work btw so you know I have tried many things I just need some help
I tested before and this just adds health by 10 I want it too add by 10%
Also forgot to mention this needs to add by only 10% and no more no less and it wont work when I do 10% or %10 just gives an error

All I need to know is how to add the percentage of 10 instead of actually adding the number 10 to the health

Based on this, it sounds to me like max health isn’t part of the equation? Doing this part should be as simple as:

character.Humanoid.Health *= 1.10  -- 10% more health

Let me know if that’s what you mean. The wording is confusing.

1 Like

Tysm!!! I am so happy :slight_smile: I needed this

1 Like