what do i write here

where you would normally have var something : GameObject;
what would you put instead of GameObject when something is a script?

If I understand you correctly, you could use Component but more likely use the name of the script.

If you have a script called ‘OtherScript’:

var other : OtherScript;

Also, sometimes you are better off finding this game object as opposed to manually dragging it to where you want the reference and then just getting the component. E.g., you could say:

function Awake()
{
    var myGameObject = GameObject.Find("MyGameObject");
    someVariable = myGameObject.GetComponent(ScriptYouWant);
}