Ryan Codes
Ryan Codes
  • 1
  • 53
How to make a Health Bar Gui For Beginners | Roblox Studio
In this video, we'll create a custom health bar that updates as the player's health changes. The health bar is displayed using a frame, and the size of a sub-frame adjusts based on the player's health percentage. We also disable the default Roblox health bar to ensure only your custom UI is visible.
Health Bar Script | Local Script
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local Your Parent Frame here = script.Parent
local Your Sub frame here = Your parent frame here :WaitForChild("Your Sub Frame Here")
local function updateHealth()
local healthPercent = humanoid.Health / humanoid.MaxHealth
Your sub frame here.Size = UDim2.new(healthPercent, 0, 1, 0)
end
humanoid.HealthChanged:Connect(updateHealth)
updateHealth()
Disable Roblox Health Gui | Local Script
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
#roblox #robloxgames #robloxstudio #robloxtrend
มุมมอง: 53

วีดีโอ

ความคิดเห็น

  • @Wolfygamez321
    @Wolfygamez321 หลายเดือนก่อน

    tysm it worked

  • @Ryan_Codes
    @Ryan_Codes หลายเดือนก่อน

    Scripts In The Description😁