Main Menu Java Coding Help

Hello, I know that usually main menu coding is simple but for some reason my scripts are never working. So, can someone help me with some code for a simple main menu. Like so that if the player hits Play it goes to level1 and if the player hits credits an animation happens. Any help would be great! Thanks!

OnGui(){
if(Rect(GUI.Button(20,20,100,30),“Play”))

{
    Application.LoadLevel("Level1");
}
}