script slot possible?

i alreddy looked arround but could not find a solution. this is just a wild gues of what it should be but i cant get it any better i just want to make some sort of script slot where i can drag a script into it. and than add the script to its gameobject trigger whare the other script alreddy is attached on so i want to every time i go in to the trigger area. i want to activate the script in the slot so my question would be is this possible to do? anyway thanks

var script : Script;

function OnTriggerEnter(other : Collider) {
script.enabled = true;
}

greatz wezz from the Netherlands

Yes ;)

Though I use this:

GameObject.Find("Main Camera").GetComponent(Camera).enabled = false;//I am switching off the camera of the Main Camera

Instead of 'Camera' you can put there the name of your script without "" or anything.

I think you're supposed to use the GetComponent command...

You can't really add in scripts like that...

If you want, you can actually put the whole script in there too?

But for GetComponent, you can add the actual script to the object, so you have 2 scripts attatched and use:

otherScript = GetComponent(OtherScript); 

OtherScript being the name of the script you're trying to access.

If the script is on a different object, something like this'll work:

transform.Find("Hand").GetComponent(OtherScript).DoSomething("Hello");

You can read about more here: http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Game_Objects.html

Good luck =).