while true do
Wait()
health = player.Character.Humanoid.Health/player.Character.Humanoid.MaxHealth
if health>=player.Character.Humanoid.MaxHealth then
health = player.Character.Humanoid.MaxHealth
end
script.Parent.Size = UDim2.new(0, health, 0, 20)
script.Parent.Parent.HPText.Text = "HP - " .. health .. "%"
end |