So, I attempted to make a custom health gui and I ran into a problem with the labels not correctly showing.

** What I attempted : **


wait(2)

local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid

hum.MaxHealth = 4
hum.Health = 4

function update()
	local health = hum.Health
		for _, Hearts in pairs (game.StarterGui.ScreenGui:GetChildren()) do
			local Value = Hearts.Max.Value 
			local player = game.Players.LocalPlayer
			local char = player.Character
			local hum = char.Humanoid
			--print(i,Hearts)
			--print (Value)
				
			if hum.Health >= Value then
				Hearts.Visible = true
			elseif hum.Health < Value then
				Hearts.Visible = false		
		end
	end
end		

hum.HealthChanged:connect(update)


What this does is print the names of the labels and the values inside of them. But it does not make them invisible.

I am confused because according to the image label properties the label's visible property is not checked which is what I wanted but, the labels are still appearing.

Hopefully, someone could maybe fix my code or tell me what it is I am missing with the Labels altogether .

(On a separate note, first question hype \0/ )