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

How to make a health GUI that fills up?

Asked by 4 years ago

Hello, so I'm trying to understand how GUI's work, but it's giving me somewhat of a headache. I'm trying to make a script that fetches player health & fills for example a stamina icon. How would I go about this? Do I have to make 100 seperate decals?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

No you do not have a simple script ready for i have made a few months ago!

wait() 

local Player = game:GetService'Players'.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Human = Character:WaitForChild("Humanoid")

local HealthFrame = script.Parent

Human.HealthChanged:connect(function(Health)
    HealthFrame.Size = UDim2.new(Health/Human.MaxHealth,0,1,0)
end)

make a frame in your GUI and call it Background make the color red and then make a Frame called Positive Then inside it put a local script with the script above also can you show your attempted script maybe more people will help you with it to understand what you are attempting

Ad

Answer this question