local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Human = Character:WaitForChild("Humanoid")
local HealthFrame = script.Parent
Human.HealthChanged:Connect(function(Health)
HealthFrame.Size = UDim2.new(Health/Human.MaxHealth,0,1,0)
end)
✓ ANSWER ACCEPTED
Why is my health bar stuck at full bar after several death?
1 answer
✓ Accepted answer
Try connecting your HealthChanged event to CharacterAdded event:
Player.CharacterAdded:connect(function(character)
local Human = character:WaitForChild('Humanoid')
Human.HealthChanged:Connect(function(Health)
HealthFrame.Size = UDim2.new(Health/Human.MaxHealth,0,1,0)
end
end)
After placing this code, you won't need your Character variable (line 2) and Human (line 3).
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you so much!