Cannot disable a script from another script

I have been trying to find the solution for the past hour.
I have a chicken enemy in my Game. One script, “Randomnpcmovement” controls the movement and attacking. The other, “generictakedamage” controls health and death. I am trying to use “generictakedamage” to disable “Randomnpcmovement” once health is at zero or less. But for all the combinations of syntax I have tried, it keeps getting rejected by Unity. Both scripts are in the same object called “TempChicken”. The entire content of “generictakedamage” is as follows:

var health : float = 300;
var go = Randomnpcmovement.Find(
var randomMovement: Randomnpcmovement = GetComponent(Randomnpcmovement);

function Start (){
}

function OnCollisionEnter(whatIHit : Collision)
{ 
    health -= 10; 
    print ("Chickenshot");
}

function Update (){
    if (health <= 0) {
        randomMovement.GetComponent("Randomnpcmovement").enabled = false;
     }
}

The problem here is where you are using the GetComponent function. You can't use lookup functions that depend on the current state of the object in class-variable declarations, because they need to be evaluated at compile-time, not at runtime!

You should get rid of the 'go' variable from the top, and instead of trying to find the component for RandomMovement during field initialisaion, do it in Start:

private var randomMovement : randomnpcmovement;

function Start()
{
    randomMovement = GetComponent(randomnpcmovement);
}

Then when you want to access it in Update, just use randomMovement:

function Update (){
    if (health <= 0) {
        randomMovement.enabled = false;
    }
}

This is for a project that is due tomorrow. I would appreciate help, especially since it seems to be a Unity problem.