Respawning player after player dies

Ok i went threw a lot of questions and none of them seamed to actually work for me. So here is what i am planning on doing. When the player is killed by another player, the player dies and other player gets some points, then the player who was just killed gets his life back and respawns in a different location. Here is my code.

var hitPoints = 100;

function ApplyDamage (damage : float)
{
    if (hitPoints <= 0)
    {
        return;
    }
    hitPoints -= damage;
    if (hitPoints <= 0)
    {
        hitPoints += 100;
        Instantiate(gameObject.find("Respawn").transform.position, Quaternion.identity);
    }
}

Then i dont know how when someone kills you he gets points or Exp. Pleaese help me out pretty please.

1 Answer

1

http://answers.unity3d.com/questions/7521/how-to-respawn-a-game-object-after-a-certain-amount-of-time