Door code help (Javascript)

I’m having a problem with my door code:

var myLevel : String;

function Update () {
	if(Input.GetButtonDown ("Interact") && function OnCollisionEnter(myCollision : Collision)) {
		if( == "Player")

And it says on line 4 “Unexpected token: myCollision”
and on the same line “expecting (, found ‘OnCollisionEnter’.”

I’m not sure what I’m doing wrong, help is appreciated"

DaveA i think he wants to push the button and collide. so itd be:

private bool entercollide = false;

void OnTriggerEnter(Collider other) {
    	if (other.gameObject.tag == "Player") {
    		entercollide = true;
    void Update () {
    		if(Input.GetButtonDown("Interact") && (entercollide)){

sorry its in C#… (im sure its easy to convert i just dont have time atm sorry)

thats how i would do it anyway