So I've been working on a health GUI and it all works nicely, the bar scales and everything, but the text just does not update. I'm not sure if it's an error with concatenation or what, but it just doesn't work. Thanks!
maxHealth = player.Bin.MaxHealth health = maxHealth character.Humanoid.MaxHealth = maxHealth.Value character.Humanoid.Health = health.Value character.Humanoid.HealthChanged:connect(function() hpBar:TweenSize(UDim2.new(character.Humanoid.Health/character.Humanoid.MaxHealth,0,1,0),"Out","Quad",0.5) hpLabel.Text = ""..math.floor(health.Value).."" if character.Humanoid.Health == 0 then hpBar:TweenSize(UDim2.new(0,0,1,0),"Out","Quad",0.5) hpLabel.Text = ""..math.floor(health.Value).."" end end)
If we have an int value,
local int = 55
We can make this into a string using,
local int = 55 local string = tostring(int)
Hopefully this will work,
maxHealth = player.Bin.MaxHealth health = maxHealth character.Humanoid.MaxHealth = maxHealth.Value character.Humanoid.Health = health.Value character.Humanoid.HealthChanged:connect(function() hpBar:TweenSize(UDim2.new(character.Humanoid.Health/character.Humanoid.MaxHealth,0,1,0),"Out","Quad",0.5) hpLabel.Text = tostring(math.floor(health.Value)) if character.Humanoid.Health == 0 then hpBar:TweenSize(UDim2.new(0,0,1,0),"Out","Quad",0.5) hpLabel.Text = tostring(math.floor(health.Value)) end end)
I hope I helped!
Good Luck!