help setting var on another object

i'm trying to set a var on another object using this, it's saying "Object reference not set to an instance of a object"

  private var freeze = false;
private var pos = Vector3();

function Update () {
if (freeze) {
transform.position = Vector3(pos.x,pos.y,pos.z);
}
}

function OnTriggerEnter(hit : Collider) {
if (hit.gameObject.tag == "npc") {
pos = transform.position;
hit.GetComponent(zombiescript).die = 1;

}
freeze = true;
}

I think that Unity's telling you that "zombiescript" can't be found - GetComponent returns NULL if it can't find a component by the specified name.

Check that the exact name of your script is 'zombiescript', that it's attached to the 'hit' Collider, and that it contains the 'die' variable. (I would also assume that the variable should not be 'private')

Also be aware that if you have objects with the 'npc' tag that don't have the 'zombiescript' component, you'll get errors if they collide with the object that this script is placed on.