✓ Accepted answer
Your script is basically saying to repeat setting the text of CurHealth to the Humanoid Health until the Humanoid Health is what it currently is, which won't really do anything.
What you're looking for is an updater that makes CurHealth set to the Humanoid's health every time the Humanoid's health changes.
function onHealthChanged()
script.Parent.CurHealth.Text = script.Parent.Parent.Parent.Humanoid.Health
end
script.Parent.Parent.Parent.Humanoid.HealthChanged:connect(onHealthChanged)
The HealthChanged event accepts a parameter, and the value of it is the value of the health changed to (i.e. final health).
So you could also do this.
function onHealthChanged(health)
script.Parent.CurHealth.Text = health
end
script.Parent.Parent.Parent.Humanoid.HealthChanged:connect(onHealthChanged)
I hope this helps. If it doesn't, I'll give it another look.
1 comment
THANKS!!!