Refrence from script

What would the script be that would refrence from another script?

My example is, i have a key that when you pick it up, the var HasKey = true. Now i need my door script to play the open animation OnTriggerEnter, but only if HasKey(True). So it needs to check the other script. How do i do that?

make the haskey a static var and reach it by doing scriptname.haskey

I did this but got errors. What exactly do i type?

GetKey

static var Key;
var reloadTime = .5;

function Start(){

Key = false;

}

function OnTriggerEnter(){

Key = true;


	

}

function OnGUI(){

if(Key){

	GUI.Label (Rect (25, 25, 100, 30), "You Have A Key!");
}
}

[quote]

[b]GetKey1/Door[/b]

var Key;

function OnTriggerEnter(){

if(GetKey1.Key){

animation.Play(“Door”);
}
}

So, What is wrong? it says, unkown identifier, "GetKey1"

Well, it looks to me like your script name is “GetKey” and not “GetKey1”

See the difference?