Pressure pads and locking doors

first of all, i have a door, and 2 seperate pressure pads. the door is automatic, so when you walk up to it, it opens, and when you walk away from it, it closes.

here is my working door script

public var doorlock : boolean = false;

function OnTriggerEnter (other : Collider){
	if(doorlock == false){
		if(other.gameObject.name == "Player"){
			animation.Play("Dooropen");
		}
	}
}

function OnTriggerExit (other : Collider){
	if(doorlock == false){
		if(other.gameObject.name == "Player"){
			animation.Play("Doorclose");
		}
	}
}

what i’m trying to do is get the first pad to lock the door [doorlock = true] and play a locking animation [“Lockon”], and the second pad to do the opposite, unlock it and play an unlocking animation [doorlock = false][“Lockoff”], through OnCollisionEnter

my question is: how do i do this?

Add this to your door script:

function LockDoor (){
    doorLock = true;
    animation.Play("Lockon");
}

function UnlockDoor (){
    doorLock = false;
    animation.Play("Lockoff");
}

and add this to your pad scripts:
Pad1:

function OnCollisionEnter (other:Collision){
    GameObject door = GameObject.Find("Door");
    door.SendMessage("LockDoor");
}

Pad2:

function OnCollisionEnter (other:Collision){
    GameObject door = GameObject.Find("Door");
    door.SendMessage("UnlockDoor");
}