Have a working Java script that I want to be c#!!?!

I tried translating this to c#, but something is off. Any ideas?

var timer : float = 30;

function Update() {

		timer -= Time.deltaTime;

		if(timer <= 0)

{

		Application.LoadLevel (0);
		timer = 0;
	}

}

function OnGUI () {

GUI.Box(new Rect(375,10,100,20), “” + timer.ToString(“0”));

}

float timer = 30;

void Update()
{
...
}

void OnGUI()
{
...
}

float timer = 30;
void Update()
{
timer -= Time.deltaTime;
if(timer <= 0)
{
Application.LoadLevel (0);
timer = 0;
}
}

    void OnGUI () 
    {
        GUI.Box(new Rect(375,10,100,20), "" + timer.ToString("0"));
    }

“function” is a js word. In C#, you need to specify the return type of the function. In this case - “void” or no return type.

Here’s what that script would look like in C#.

float timer = 30;

void Update(){
     timer -= Time.deltaTime;
}

public void ChangeLevelToLevel1(){

     Application.LoadLevel(0);
     timer = 0;
}

void OnGUI(){
GUI.Box(new Rect(375,10,100,20),"" + timer.ToString("0"));
}

If you don’t mind my two cents, switch to the uGUI (4.6 GUI) system. The old one is obsolete / legacy / outdated, and for good reason.