This is in a local script with the GUI being the script's parent.
local text = script.Parent.Text
local humanoid = game.Players.LocalPlayer.Character.Humanoid
humanoid.HealthChanged:connect(function(health)
print(health)
text = health
end)
It prints the health correctly in the output, but it doesn't want to display it in in the GUI for some reason. Can someone please help me?

2 comments
Set sp to script.Parent then do sp.Text = health. You can't access the text directly, you have to change the property, not just the variable.
Thanks! It's amazing how such small pieces of errors like that prevent whole scripts from not working!