How to make a HEALTH BAR | Roblox Studio

Published: 27 April 2024
on channel: Itz_FloppyFish
22,557
555

In todays video I show you how to make a Health Bar in Roblox Studio. Health Bars are often used to clearly display a players health, these are seen in a number of games, obbys, driving games, FPS games and a whole lot more. So..... if you did want this type of system in your game make sure to watch to the end of the video to find out how!

I really enjoy making these videos for you all so I hope you enjoy them just as much as I do!
Have a lovely rest of your day!

Scale your GUI tutorial:    • How to SCALE GUI like a PRO | Buttons...  

Script 1 (Main Script):

local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local MainHealthBar = script.Parent
local TextLabel = script.Parent.Parent.CustomText -- Change CustomText to whatever your TextLabel which is in your bar is called.

local function updateHealth()
local BarSize = math.clamp(Humanoid.Health / Humanoid.MaxHealth, 0, 1)
MainHealthBar.Size = UDim2.new(BarSize, 0, 1, 0)
TextLabel.Text = "Health: " .. tostring(math.floor(BarSize * 100)).."%" -- You are able to adjust what is shown on the bar here.
end

updateHealth()

Humanoid:GetPropertyChangedSignal("Health"):Connect(updateHealth)
Humanoid:GetPropertyChangedSignal("MaxHealth"):Connect(updateHealth)
-- Made with love by Floppy!

-----------------------------
If you are a bit confused what to do, Feel free to create a ticket in my discord server and we can help you out!

NEW! Floppys Obby Game : https://www.roblox.com/games/14917960...

Floppys Simulator Game: https://www.roblox.com/games/13963457...

If you would like to support me even more, Super Thanks and becoming a Member is also another way to show your appreciation!

🌟 Floppys Discord Server:   / discord  
🌟 Floppys Roblox Game : https://www.roblox.com/games/11301003...

Roblox Studio Tutorial
Roblox Studio
Studio Tutorials


Watch video How to make a HEALTH BAR | Roblox Studio online without registration, duration hours minute second in high quality. This video was added by user Itz_FloppyFish 27 April 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 22,557 once and liked it 555 people.