
378 Views
27 Executions
Vertical health bar
Universal Script 📌
ZalePublished 5
6 months ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local CoreGui = game:GetService("CoreGui")
local RunService = game:GetService("RunService")
local function formatHealth(val)
local rounded = math.round(val * 10) / 10 -- Rounds to 1 decimal place first
if rounded % 1 == 0 then
return string.format("%.0f", rounded) -- Absolutely no decimal for whole numbers
else
return string.format("%.1f", rounded) -- Exactly one decimal for others
end
end
local function createHealthBar(character)
local humanoid = character:WaitForChild("Humanoid", 5)
local head = character:WaitForChild("Head", 5)
if not humanoid or not head then return end
if CoreGui:FindFirstChild(character.Name .. "_HealthBar") then
CoreGui[character.Name .. "_HealthBar"]:Destroy()
end
local billboard = Instance.new("BillboardGui")
billboard.Name = character.Name .. "_HealthBar"
billboard.Parent = CoreGui
billboard.Adornee = head
billboard.Size = UDim2.new(4, 0, 6, 0)
billboard.AlwaysOnTop = true
billboard.ExtentsOffset = Vector3.new(2.8, 1, 0) -- Far right of head
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0.06, 0, 0.6, 0)
mainFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
mainFrame.BackgroundTransparency = 0.5
mainFrame.BorderSizePixel = 0
mainFrame.AnchorPoint = Vector2.new(0.5, 0.5)
mainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
mainFrame.Parent = billboard









Love it!! Sleek and new:)