Humanoid:ChangeState does not work after the first time

You can write your topic however you want, but you need to answer these questions:

  1. I Want when the pet humanoid died, I Want to revive it after twenty seconds.

  2. The problem it does not change the Humanoid:ChangeState after the first time, MEans, If the humanoid died, It will revive, But, If he died again, Everything will work good, But He will not back alive because the Humanoid:ChangeState is not working.

Humanoid.Died:Connect(function()
	if Character["Main Pet."].Value == false then
		print(Character.Name)
		print(Humanoid:GetState())
	end
	if Humanoid.Health == 0 and Character["Main Pet."].Value == false then
		print(script.Name)
		Character["Respawn time."].Value = 20
		Character.Head["Respawn time."].Enabled = true
		repeat
			wait(1)
			Character["Respawn time."].Value -= 1
			Character.Head["Respawn time."].TextLabel.Text = Character["Respawn time."].Value
		until Character["Respawn time."].Value <= 0
		print("Passed the loop.")
		Character.Head["Respawn time."].Enabled = false
		print(Humanoid:GetState())
		Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
		Humanoid.Health = 100
		print("Should give health.")
	end
end)