so I have to ask this question a second time since nobody answered my last one
so I made a health GUI and it works perfectly fine but there is one slight problem it wont regenerate every 3 seconds like add 1 health every 3 seconds or something and it still wont work
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)

1 comment
set a variable for the players service, localplayer, character, humanoid, and health please, also indent