Hello, iv heard about humanoid:TakeDamage(), but is there something like humanoid:AddHealth? I know i can still do humanoid.health = humanoid.Health + number, but its the same for takedamage, but takedamage() is faster to write, is can i do the same with adding health?
Like @theking48989987 said, TakeDamage()
takes any number, positive or negative. If the number given is negative, the Humanoid
will be healed by that amount of Health
:
1 | local hum = game.Players.LocalPlayer.Character.Humanoid |
2 | hum:TakeDamage(- 10 ) -- Heals 10 HP |
However, TakeDamage()
is unique about this. There is a bug that enables you to surpass the MaxHealth
of the Humanoid
using TakeDamage()
:
1 | hum:TakeDamage(- 100 ) -- If the Humanoid already has 100 HP, they'll surpass their 100 HP limit and they will have 200 HP |
By what I know, this bug hasn't been fixed but it is indeed a unique bug.
yes, it works like humanoid:AddHealth() ex:
1 | game.Players.LocalPlayer.Character.Humanoid:TakeDamage( 60 ) |
then the humanoid has health 40