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)

5 comments
Hi, please edit your question and put your code inside a code block.
How do I put it in the codeblock?
nvm I found out
I've edited your question, and btw don't watch AlvinBlox as he spoon-feeds code
Who should I turn to then?