I've placed prints throughout the script and the print showed up in the function but not inside any of the if statements. Any help you can provide is appreciated.
local player = script.Parent.Parent.Parent.Parent.Parent
local character = player.Character
local health = character.Humanoid.Health
function Hearts()
if health == 0 then
script.Parent.Heart1.ImageTransparency = 0.5
else
script.Parent.Heart1.ImageTransparency = 0
end
--
if health >= 25 and health <= 49 then
script.Parent.Heart2.ImageTransparency = 0.5
else
script.Parent.Heart2.ImageTransparency = 0
end
--
if health >= 50 and health <= 74 then
script.Parent.Heart2.ImageTransparency = 0.5
else
script.Parent.Heart2.ImageTransparency = 0
end
--
if health >= 75 and health <= 99 then
script.Parent.Heart2.ImageTransparency = 0.5
else
script.Parent.Heart2.ImageTransparency = 0
end
--
end
character.Humanoid.Changed:connect(Hearts)

2 comments
Thanks, that worked perfectly!
No problem.