local plrs = game:GetService("Players") local plr = plrs.LocalPlayer local character = plr.Character or plr.CharacterAdded:wait() local hum = character:WaitForChild("Humanoid")
local health = hum.Health
local interface = {} do local playerGui = plr:WaitForChild("PlayerGui")
local gui = playerGui:WaitForChild("HealthBar")
local frame1 = gui:WaitForChild("status")
local text = frame1:WaitForChild("healthpercent")
local status = frame1:WaitForChild("overlay")
local Udim2_new = UDim2.new
function interface:UpdateHealth()
status.Size = Udim2_new(health/100,0,1,0)
text.Text = ("Health: %d / 100"):format(health)
end
end
interface:UpdateHealth() wait(.5)
It has no errors, but it isn't actually updating the text on the UI itself. Any help is appreciated :)

4 comments
while true do?
last line, you can try doing "hum.Health.Changed:connect(interface:UpdateHealth)"
try this "while wait() interface:UpdateHealth() do end will update the health. If you do while true do without a wait prob will crash studio in test or make game take forever to load.
Or like ast_raa said use humanoid.HealthChanged to detect only if the health changes instead of lagging the game.