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

Health Bar Gui wont regenerate?

Asked by 5 years ago
Edited by Rare_tendo 5 years ago

Alright, so I got help off AlvinBlox and did everything he did except there is one slight problem. Whenever I set the humanoid health low the green bar wont regenerate or go back to its original size by 2 seconds and I want it to slowly go back to its original size by 2 seconds btw I have the full script if anybody could point out what to do to make the health regenerate that would be cool, thanks:

wait(2)
game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
local redzone = game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 4
local yellowzone = game.Players.LocalPlayer.Character.Humanoid.MaxHealth / 2
if game.Players.LocalPlayer.Character.Humanoid.Health <= yellowzone then
    script.Parent.BackgroundColor3 = Color3.new(255,255,0)
end
if game.Players.LocalPlayer.Character.Humanoid.Health > yellowzone then
local brickcolor = BrickColor.new("Lime green")
local color = brickcolor.Color
script.Parent.BackgroundColor3 = color
end
if game.Players.LocalPlayer.Character.Humanoid.Health <= redzone then
script.Parent.BackgroundColor3 = Color3.new(255,0,0)
end
if game.Players.LocalPlayer.Character.Humanoid.Health > redzone then
local brickcolor = BrickColor.new("Lime green")
local color = brickcolor.Color
script.Parent.BackgroundColor3 = color
end
script.Parent.Size = UDim2.new(game.Players.LocalPlayer.Character.Humanoid.Health / game.Players.LocalPlayer.Character.Humanoid.MaxHealth,0,0,20)

end)
0
Hi, please edit your question and put your code inside a code block. Aniline_Purple 266 — 5y
0
How do I put it in the codeblock? THEGOBLINTOPLAD 0 — 5y
0
nvm I found out THEGOBLINTOPLAD 0 — 5y
0
I've edited your question, and btw don't watch AlvinBlox as he spoon-feeds code Rare_tendo 3000 — 5y
0
Who should I turn to then? THEGOBLINTOPLAD 0 — 5y

Answer this question