How to Make a classic Overhead Health bar in roblox

Опубликовано: 21 Май 2026
на канале: Biel_M
3,495
328

Script in the video: game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)

local gui = script.BillboardGui:Clone()
gui.Parent = character:WaitForChild("Head")

local BAR = gui.BG.BAR
local Percent = gui.BG.Percent
local NameLabel = gui.BG:WaitForChild("NameLabel")

local humanoid = character:WaitForChild("Humanoid")

NameLabel.Text = player.Name
Percent.Text = humanoid.Health.."/"..humanoid.MaxHealth

humanoid.HealthChanged:Connect(function(damage)
Percent.Text = math.floor(humanoid.Health).."/"..humanoid.MaxHealth
BAR:TweenSize(UDim2.new(damage / humanoid.MaxHealth, 0, 1, 0), "Out", "Quad", 0.2, true)
end)

end)
end)