humanoid.HealthChanged:connect(function()
local hp = humanoid.Health
local hpd = hp / player.Character.Humanoid.MaxHealth
local hpm = hpd * 200 <----------------------
Healthnum.Text = math.floor(hp)
Healthbar.Size = UDim2.new(0, hpm, 0, 25)
Healthbar.BackgroundColor3 = Color3.new((maxhp - hp)/100, hp/235, hp/100)
Healthbar.BorderColor3 = Color3.new((maxhp - hp)/100, hp/235, hp/100)
Healthnum.TextStrokeColor3 = Color3.new((maxhp - hp)/100, hp/235, hp/100)
end)
SOLVE EDIT: was just a silly syntax mixup on my part :p
So I was dividing hp by maxhp so that my health bar would stay the same size no matter what your maxhp is, and it works. However, if the maxhp is anything but exactly 100, it'll be around 30 pixels smaller. Could anyone explain why that happens?
test

3 comments
I'm hungry
^
^