I don't know why this isn't working, it was working before. It doesn't seem to reset after I die. It did like 3 hours ago though.
game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
script.Parent.Size = UDim2.new(game.Players.LocalPlayer.Character.Humanoid.Health / game.Players.LocalPlayer.Character.Humanoid.MaxHealth,0,0,20)
script.Parent.TextLabel.Text = math.floor(game.Players.LocalPlayer.Character.Humanoid.Health)
if game.Players.LocalPlayer.Character.Humanoid.Health < 25 then
script.Parent.BackgroundColor3 = Color3.new(255,0,255)
else if game.Players.LocalPlayer.Character.Humanoid.Health > 25 then
script.Parent.BackgroundColor3 = Color3.new(0, 255, 0)
end
end
end)
while true do
if game.Players.LocalPlayer.Humanoid.Health == 100 then
script.Parent.Size = UDim2.new(1, 0, 0, 20)
script.Parent.BackgroundColor3 = Color3.new(0, 255, 0)
end
wait()
end

3 comments
What are you trying to do? Make a custom HP bar?
If it doesn't reset after you die, then did you make sure the StarterGui resets after death? Click StarterGui > Check "ResetPlayerGuiOnSpawn"
Why do you have lines 12-18? e-e