Basic on collision play animation code not working

I am trying to play animation on collision, my script should be almost identical to that of will goldstones - the sounds and the door closing yet, i continue to get errors about = ; : when i replace with those it still says expecting.

var doorOpened : boolean = false; 

function OnControllerColliderHit(hit:ControllerColliderHit){ 
    if((hit.gameObject.tag == "drilldooropen") && (doorOpened == false)){
        openDoor();
    }
}

function update ()
function openDoor(); {
    doorOpened = true;                
    var drill = gameObject.FindWithTag("drilldooropen");
    drill.animation.Play("Take 001");
}

very new to unity but exp with 3ds animations the animations are fine.

Assets/Standard Assets/Camera Scripts/Opendoor.js(15,2): BCE0043: Unexpected token: function. Assets/Standard Assets/Camera Scripts/Opendoor.js(17,30): BCE0044: expecting :, found '='.}}

There are two main problems with your script:

  1. You declare a function update with nothing after it, no implementation, no semi-colon, nothing.
  2. You declare a function openDoor, followed by a semi-colon. Then you open a block with a brace. If you were trying to implement the function you just declared, you should not have ended the declaration with that semi-colon.

Here's probably what you wanted:

var doorOpened : boolean = false;

function OnControllerColliderHit(hit:ControllerColliderHit) { 
    if((hit.gameObject.tag == "drilldooropen") && !doorOpened) openDoor();
}

function openDoor() {
    doorOpened = true;                
    var drill : GameObject = gameObject.FindWithTag("drilldooropen");
    drill.animation.Play("Take 001");
}

Also, a small improvement, rather than having to find the GameObject every time, you could just pass it in:

var doorOpened : boolean = false;

function OnControllerColliderHit(hit:ControllerColliderHit) { 
    if((hit.gameObject.tag == "drilldooropen") && !doorOpened)
        openDoor(hit.gameObject);
}

function openDoor(drill : GameObject) {
    doorOpened = true;                
    drill.animation.Play("Take 001");
}

If you're going to have more than one door, your mechanism doesn't seem very scalable. Perhaps you should consider storing whether the door is open on the door rather than the door opener.