Why doesn't the TextLabel update with the humanoid's health?
I made a sort of boss bar where it displays the boss's current health and max health. Obviously it's supposed to update whenever it's health changes, but it isn't. There are no errors either. Here's my local script:
1 | local healthLabel = script.Parent.Health |
2 | local boss = workspace:WaitForChild( "BossMan" ) |
3 | local bossHealth = boss.Humanoid.Health |
4 | local bossMaxHealth = boss.Humanoid.MaxHealth |
6 | healthLabel.Text = bossHealth .. "/" .. bossMaxHealth |
7 | boss.Humanoid.HealthChanged:Connect( function () |
8 | healthLabel.Text = bossHealth .. "/" .. bossMaxHealth |
Any help on this matter would be very appreciated.