GUI not showing up on player destroy

GUI code works fine when tested, but when the player dies, it doesn’t shows up
i used
void OnDestroy()
{
transform.parent.gameObject.AddComponent ();
}

Your not adding any component .AddComponent takes a type