-
What do you want to achieve?
I’m trying to make a health bar. -
What is the issue?
The problem is that when the player’s health go down and it’s not a number under 43 it wont do anything, however if the health goes lower than 43 it will work. I tried changing the size of my bar and it just made that the bar showed effects if the health is under a lower number like 60, I don’t want to keep doing that because the bar will cover the whole screen. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
None of the solutions I’ve tried have actually worked, I tried looking in Devforum to see if anybody else had the same problem but apparently no one.
Humanoid.HealthChanged:Connect(function(dmg)
local Health = math.clamp((dmg / Humanoid.MaxHealth),0,0.417)
Healthbar:TweenSize(UDim2.fromScale(Health, Healthbar.Size.Y.Scale), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.5, false, nil)
wait(0.5)
HealthRedMeter:TweenSize(UDim2.fromScale(Health, HealthRedMeter.Size.Y.Scale),Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.5, false, nil)
end)