How to make a healthbar that shows different frame depending on how much health left?

Yeah. Now let me see real quick

I would assume you would add another gui with a script for each health thing you want. Lime for the 60 - 79 need another gui with a script activating it.

Then you would need a script that would deactivate the other until they are activated.

Sounds complicated. Is this really the only way?

There might be abother way, but thats the only way I know. Sorry if that did not help.

I would send screenshots but I am on phone right now. If I get any new information, I will let you know!

1 Like

Thank you, i’ll be waiting . . .

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character:WaitForChild("Humanoid")
		local hud = player.PlayerGui.Hud.ImageLabel
		local fine = hud.fine
		local fine2 = hud.fine2
		local caution = hud.caution
		local danger = hud.danger

		humanoid.HealthChanged:Connect(function(health)
			fine.Visible = health >= 80
			fine2.Visible = health >= 60 and health < 80
			caution.Visible = health >= 30 and health < 60
			danger.Visible = health < 30
		end)
	end)
end)

Just have everything in a PlayerAdded event then CharacterAdded event inside a local script instead of looping through all players.

Oh, actually no, it’s not the solution, it doesn’t work (the frames are not even showing)

You’ll need to add “WaitForChild()” to allow for the referenced UI elements to load before attempting to use them in the script, I also don’t know how the UI is organised.