Reverse Healthbar/Damage Bar

Hello! im trying to do a healthbar that goes up when you get damaged and goes down when you get healed, but i tried a bunch of formulas and none worked, im using TweenSize for the gui.

What i actually want

A formula with UDim2 that makes that what i wanted above.

Udim2.fromScale(GUI.SIZE.X, CURRENT_HP / TOTAL_HP)

Maybe try something like this

local reversedHealth = -(Health/MaxHeakth)

Udim2.new(Bar.Size.X, reversedHealth, Bar.Size.Y.Offset, Bar.Size.Y.Scale)

quick question GUI is the bar?

Yes It’s the bar I just edited it right now.

didn’t work :confused:
my code:

Health.Inner:TweenSize(UDim2.new(0, -(Humanoid.Health/Humanoid.MaxHealth), 0, 30), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.35, true)

Just subtract the health percentage from 1. This would make 75% health result in 25% of the bar to be filled, and so on.

local hum
UDim2.fromScale(1 - (hum.Health/hum.MaxHealth), size.Y)