Destroying an object with OnTriggerEnter

Hi, I have this piece of code, however it has three errors which i cannot solve

private  var bombspeed : float= -4f;

function Update () : void 
{
	transform.Translate( new Vector3(0f, bombspeed*Time.deltaTime, 0f) );
	if (transform.position.y < -11) 
		{
			Destroy(this.gameObject);
		}
		
	function OnTriggerEnter (Collider other ) : void 
	{
		if (other.gameObject.name == "Shark") 
		{
			gameObject.transform.rotation = Quaternion.identity;
			gameObject.transform.position = new Vector3(20f, -3f, 8f);
			Destroy(this.gameObject);
		}
	}
}

the problem lies in this part

function OnTriggerEnter (Collider other ) : void

and the errors are:

Assets/Scripts/Bomb.js(11,18): BCE0044: expecting (, found 'OnTriggerEnter'.
Assets/Scripts/Bomb.js(11,43): BCE0044: expecting ), found 'other'.
Assets/Scripts/Bomb.js(11,49): BCE0043: Unexpected token: ).

can anyone direct me on what am doing wrong?

Your OnTriggerEnter functions are within your Update…

Put them appart.

jesus xD did not see it through, i have now this error…

Assets/Scripts/Bomb.js(11,35): BCE0043: Unexpected token: other.

should i declare it in another way?

nevermind

did this:

function OnTriggerEnter ( obj : Collider  ) : void 
{
		if (obj.gameObject.name == "Shark") 
		{
			obj.gameObject.transform.rotation = Quaternion.identity;
			obj.gameObject.transform.position = new Vector3(20f, -3f, 8f);
			obj.Destroy(this.gameObject);
		}
	}

thanks a lot for your help, it works now

You seem to have also mixed UnityScript with C#…

Check the documentation on thier different syntaxes and rewrite it in the language of your choice.