I’ll keep this short.
I have a health bar, and I divide the player’s current health by their max health to find the size of the bar.
But it’s xScale = 0 nonetheless, and it doesn’t work. It’s supposed to show partial health bars.
Here’s my code:
function updateHealth(health)
local human : Humanoid = chr:FindFirstChild("Humanoid")
bar.health.Bar.Size = UDim2.new(health / human.MaxHealth, 0, 0, 0)
end
updateHealth
is connected to by Humanoid.HealthChanged
, and it gives it the humanoid’s health. The bar size is also calculated coorectly as I’ve given it the good ol’ print(info)
. But whenever my health changes, the bar appears empty!
No errors either.