Application.Quit

I have this error:

BCE0034: Expressions in statements must only be executed for their side-effects.

On the line of a simple:

Application.Quit;

Application.Quit();

http://unity3d.com/support/documentation/ScriptReference/Application.Quit.html

You need the brackets

If your problem is still not working try this as an example

function Update(){
   if(Input.GetKey("a")){
      Application.Quit();
   }
}

this should work :)

please do note once you create the script add it to an object, if you run the script in game as soon as you make it the application will not close. To test and see if this works you need to build your game and then test it. To do so do the following:

File > Build Setting

Once you click on Build Settings a menu will pop up from here look at the first thing called " Scenes In Build" this tells you what you are building if there is nothing there the list drop should be empty look fro your right scene and place it there and then build and run the game.

now when you run it and then press the A key the application should close :)

I fixed it, thank you all.