Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

How would i make a my own Heath Bar Gui? [closed]

Asked by 10 years ago

I have thought and tried many things but haven't got any of them to work. Anyone have any answers?

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by
Andalf 100
10 years ago

Depends what kind of thing you're after, but if you just want it to get smaller in comparison to the players health use something like this

PlayerGui -ScreenGui --HealthBar -- define size and set background to red ---Bar -- set size to {1, 0}, {1, 0}; ----localscript

in the localscript use this code;

local player = game.Players.LocalPlayer.Character

player.Humanoid.Changed:connect(function()
    script.Parent.Width = UDim2.new(player.Humanoid.Health/player.Humanoid.MaxHeath, 0) -- use height for vertical health bars.
end)
Ad
Log in to vote
0
Answered by 10 years ago

Well, first you have to disable the health bar in the CoreGui through an action called SetCoreGuiEnabled()

Once you've set your health bar gone; you can make your own health gui. What I personally do is use a changed function and have the 'health' gui size based on percentages of your health through the gui. Make an attempt first then put down your source here.