How to exit game ?

Hello, i doesn’t speak english, sorry for my bugs. :slight_smile:
I have javascript with this code:

var levelToLoad : String;
var normalTexture : Texture2D;
var rollOverTexture : Texture2D;
var beep : AudioClip;
var QuitButton : boolean = false;

function OnMouseEnter(){
    guiTexture.texture = rollOverTexture;
}
function OnMouseExit(){
    guiTexture.texture = normalTexture; 
}

function OnMouseUp(){
    audio.PlayOneShot(beep);
    yield new WaitForSeconds(0.35);

    if(QuitButton){
        Application.Quit();
        Debug.Log("This part works!");
    }
    else{
        Application.LoadLevel(levelToLoad); 
    }
}

@script RequireComponent(AudioSource)

On object have “Quit Button”
I build project, and run it, i click on button and doesnt work.
Where is problem ?

var QuitButton : boolean = false;

  if(QuitButton){
        Application.Quit();
        Debug.Log("This part works!");
    }

You have this set to false and your checking if its true, its not so it wont quit. Assuming you have something else changing that Boolean.

Have you attached a collider to your quit object ?