Basically this script is suppose to update the players health bar as their health changes. It works fine at first but whenever the player dies and respawns, the bar and text don't update. The text will just state "0/100" and the bar doesn't appear.
local function update()
local health = hum.Health
script.Parent:TweenSize(UDim2.new((health / hum.MaxHealth), .3, 1, 1), "Out", "Sine", .5)
script.Parent.Parent.Amount.Text = math.floor(hum.Health).. " / ".. hum.MaxHealth
end
hum:GetPropertyChangedSignal("Health"):Connect(function()
update()
end)

1 comment
For some reason I didn't have the UI set to "ResetOnSpawn" that seemed to have fixed it. Thanks.