Help with some weird math for my health bar

So im trying to make a health bar, and its getting confusing. The issue is, my equation gives me the OPPOSITE of the number I want (like 100=0, 25=75, 0=100, ect). Is there anyway to undo this (like maybe a function you fire with the biggest number, smallest number, and number your inverting and it returns the right number)? Thanks in advanced!

If it correlates as stated, could you not just do:
x being the returned value.

100 - x

As the value?

Also, what is your current code and goal you’re aiming to accomplish with this code?

Would you be able to provide the script you’re working with?

i dont know… i dont know why I didnt think of that…

local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid
local health = hum.Health
local maxHealth = hum.MaxHealth
local healthBar = script.Parent

healthBar.Size = UDim2.new(health/maxHealth, 0, 1, 0)