Activating a script when clicking a object

I want to make it so when i click a game object a script activates.

function Update (){
if (Input.GetButtonDown("Fire1"))
GetComponent(" script name ").enabled = true;
}
 }

so when click on that object i want to make the script turn on but it does not seem to work

im very new to scripting

I was fully convinced this would not work GetComponent(“test”).enabled = true; actually it does
if you drag both scripts onto same object, Nobody bothered to explain that, Maybe it is that self explanatory? Anyway i feel a little stupid but Heh i learned something new. :sunglasses:

junktest.js

function OnMouseDown() {
	if (Input.GetButtonDown("Fire1")){
       Debug.Log("Fired");
       GetComponent("test").enabled = true;
	}
}

function OnMouseUp() {

   Debug.Log("Mouse Up");
  GetComponent("test").enabled = false;

}

test.js

function Start () {
  Debug.Log ("Hello");
}

You can absolutely do that, the only problem with your code is the extra bracket dangling. However, that will disable the script if you click anywhere, not over the gameobject. Trying moving your code into OnMouseDown():