Object not moving on KeyPress?

If I go near the object that this script is attached to and press ‘e’, nothing happens. I do have a MonoBehaviour and object assigned in the inspector.

var script : MonoBehaviour;
var object : GameObject;

private var arrayIndex = 0;
private var arr : MonoBehaviour[];


function Awake() {
    if (script == null)print ("Script value is not assigned, you will get a NullRefExc if you continue");

    arr = GameObject.FindObjectsOfType(script.GetType()) as MonoBehaviour[];

    if (arr == null || arr.Length == 0)
        print ("No objects of type " + script.GetType() + " was found");
}
	function Update() {
    	if(Vector3.Distance(object.transform.localPosition, this.transform.localPosition) < 2) {
       	 	if(Input.GetKeyDown(KeyCode.E)) {
        	 	  if (script.GetType() == typeof TransformObject) {
         	 	  	var obj = script as TransformObject;
        	  	 	obj.condition = true;
        	   	  	Debug.Log("Button pressed. ");
         		}
        	}
        }
    }

After exchanging a few comments…

If you need this to work using buttons, then in my opinion it is better to move key press logic to TransformObject script. Apart from your current code in this script, you have to include the following:

var activator : Transform; // the object I named Activator in one of the comments

and in the Update:

if(Vector3.Distance(activator.position, transform.position) < 2 && Input.GetKeyDown(KeyCode.E)) {
    condition = true;
}

Of course you can then remove unnecessary parts of your first script, or even delete it, if Awake part is not crucial for you.