What is in the title..
local health = player.Character.Humanoid.Health script.Parent.Size = UDim2.new(0.health*3.63,0,2.3,0)
Offset
wasn't doing very well so I changed the values to scale
.
But when I try to add a 0.health
it gives me the error saying:
Malformed number
How do I fix that?
Thanks!
Hmm, you're getting the error because you used 0.health which is not a real number.
Try this:
local health = player.Character.Humanoid.Health local maxHealth = player.Character.Humanoid.MaxHealth script.Parent.Size = UDim2.new((health / maxHealth)*3.63,0,2.3,0)
UDim2.new(0.health*3.63,0,2.3,0)
is wrong.
You better use UDim2.new(health/(10 ^ tonumber(#tostring(health)))*3.63, 0, 2.3, 0)