add is not a member of UnityEngine.Component

I know many of members have asked this question, I have tried to apply their solutions but they are not working for me. I have an object with this script :

function OnCollisionEnter (col : Collision) {
 if (col. gameObject.name == "Player"){
  var go = GameObject.Find("Player");
  go.GetComponent(testToAdd).add();
  print("You have the key"); 
  Destroy(gameObject); 
 }

}

When Player hits the object, object gets destroyed and calls a function "add" in script "testToAdd.js", whitch is attached to Player. I'm using Unity 3.2 Pro Trial and try to build game on iPad, when receive the error from topic...

Try this:

var test2add : testToAdd = go.GetComponent(testToAdd);
test2add.add();

I think it is better to declare variables:

var playerScript : testToAdd;
playerScript = go.GetComponent(testToAdd);
playerScript.add();


Better (but untested): use the information you get from collision, GameObject.Find is not necessary:

function OnCollisionEnter (col : Collision) {
  if (col.gameObject.name == "Player"){
    var playerScript : testToAdd;
    playerScript = col.gameObject.GetComponent(testToAdd);
    playerScript.add();col.gameObject.GetComponent(testToAdd).add();
    print("You have the key"); 
    Destroy(gameObject); 
 }
}

Use generics; also there's no reason to use GameObject.Find here since you already have a reference to that game object:

function OnCollisionEnter (col : Collision) {
 if (col.gameObject.name == "Player") {
  col.GetComponent.<testToAdd>().add();
  print("You have the key"); 
  Destroy(gameObject); 
 }
}

You find object script in Start ().

var playerObject : GameObject;
var testToAddScript : testToAdd;

function Start ()
{
    testToAddScript = playerObject.gameObject.GetComponent("testToAdd");
}

function OnCollisionEnter (col : Collision) 
{
    if (col.gameObject.name == "Player")
    {
        print("You have the key"); 
        Destroy(gameObject); 
    }
}

I found another solution, I attached this script to Player and changed it :

function OnCollisionEnter (col : Collision) {
 if (col. gameObject.name == "key"){

  gameObject.AddComponent("playerCollisionForDoor");
  print("You have the key"); 
 // Destroy(gameObject); 
 }

}

Before that this script was attached to gameObject Key...