Falling and respawning.

So I’ve been following this 1 and for the most part, everything works. But when I get to the falling and respawning part but Unity is saying the code is wrong. Does anyone know what the error is? The code I’ve been using is this;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnTriggerEnter2D (Collider2D other)
{
    if (other.gameObject.CompareTag("Player"))
        Application.LoadLevel(Application.loadedLevel);
}

}

@scribe sorry I forgot to edit this saying inwas able to fix it. Turns out the last two lines don’t work anymore. I found newer code and can do what I wanted. Thank you anyway.