Way to make TF2 overheal effect?

I want to make an overheal effect, but I HAVE NO IDEA how to.

Example: The heavy has a normal maximum health of 300, but overhealing him with default overheal amount changes his health to 150. Not instantly, but his max health rises. And when if he’s not being healed or after a few seconds, it’ll start to go back down to normal health.

How to achieve?

While the player is being overhealed, you could steadily increase the Humanoid’s MaxHealth and set their Health value to the new MaxHealth value.

If you want their Health to slowly rise up as their max increases, then just increase the MaxHealth and the Humanoid should start regenerating health.

oldHealth = game.workspace.playername.Humanoid.MaxHealth

for i = 300, 450, 1 do
  game.workspace.playername.Humanoid.MaxHealth = i
game.workspace.playername.Humanoid.Health = i
end

Above is the overheal
Below is when you are not getting healed but are still overhealed

repeat
game.workspace.playername.Humanoid.MaxHealth = game.workspace.playername.Humanoid.MaxHealth - 1
wait (0.5)
until game.workspace.playername.Humanoid.MaxHealth = oldHealth
end
1 Like

Can’t you just use Tween Service? repeat wait() until is just bad practice for something like over-healing.