help with script

hi everyone i just need some help with my script. its supposed to make a pickup that can only be picked up when it has collided with the player and the mouse button has been pushed how ever it dosent work. here is the script attached to the player:\

function OnTriggerEnter(other : Collider){
   if (other.CompareTag("Paper")) {
      this.GetComponent(destroyandcall).enabled=false;
   }
}

function OnTriggerExit(other : Collider){
   if (other.CompareTag("Paper")) {
      this.GetComponent(destroyandcall).enabled=true;
   }
}

and here is the script on the pickup:

var batteryPower : int = 1; //The amount of points to give, negative value takes away points instead

function OnMouseDown () {
    notecount.AlterEnergy(batteryPower);
    Destroy (gameObject);
}

please answer if you can thanks.

Which part of the script does not work?
Can you do some debugs?

I believe this does not work on JS: this.GetComponent(destroyandcall).enabled=false;

Your problem is that you are doing a GetComponent on the Player and not on the pickup.

Your code should look like this:

function OnTriggerEnter(other : Collider){
   if (other.CompareTag("Paper")) {
      other.GetComponent(destroyandcall).enabled=false;
   }
}

function OnTriggerExit(other : Collider){
   if (other.CompareTag("Paper")) {
      other.GetComponent(destroyandcall).enabled=true;
   }
}

too late I had a brainstorm earlier and i found the answer myself.
I removed the script on the player and added a sphere under the pickup, renderd the sphere invisible and set it to is trigger. then I added the players script to the sphere changed it to this:

var ranOnce : boolean = false;

function OnTriggerEnter(other : Collider){
   if (other.CompareTag("Player"))
    if (!ranOnce)
    {
        ranOnce = true;
        transform.root.gameObject.AddComponent(destroyandcall);
   }
}

function OnTriggerExit(other : Collider){
   if (other.CompareTag("Player")) {
      Destroy(transform.root.gameObject.GetComponent(destroyandcall));
   }
}

and it works perfectly!