How Do I Exit Level?

ok so im going to put like a flag at the end of every level called Exit_Flag. What i want is for when my character touches the flag it goes to the next level. Anyone could make me a script for this to work and show me what to do with it? I would really appreciate this. Thanks if you can help.

Make a trigger near your flag. When your player touches it, change level. This can be done with a simple script. You add this script to the trigger. You can then also write what level you want to load when the trigger is entered.

var nextLevel : int;

function OnTriggerEnter(collider : Collider)
{
    if (collider.CompareTag("Player"))
    {
        Application.LoadLevel(nextLevel);
    }
}

Alternatively you can add the script to the player and check if it hit the flag, that way you don't need to edit every level.

function OnControllerColliderHit(hit : ControllerColliderHit)
{
    if (hit.collider.name == "Exit_Flag")
    {
        Application.LoadLevel(Application.loadedLevel + 1);
    }
}