Access variable in another script beginner

I am currently learning the concepts of unity… so sorry if i have asked you something wrong. But i want to make my concepts clear. In my case i have one script in that i am instantiating bulletprefab and at the same time i want to generate sphere of the random color. so i have created prefab with different color which i am going to instantiate randomly. Now i want to change that prefab every time i shoot.

so in shooting script start() function again i need to to generate random prefab. so what can be the best way to avoid duplicate lines of code ??

code :

function Start () {
	futureBubble = GameObject.Find("Sphere(FutureBubble)"); // Next bubble to be shoot
    if(futureBubble != null)
    {
	    random = Random.Range(0 , bubblePrefabs.Length - 1);
	    Instantiate(bubblePrefabs[random] , futureBubble.transform.position , Quaternion.identity);
    }
}

function Update ()
{
    var spawnPoint : GameObject = GameObject.Find("Bullet");         // Current Bullet Bubble to be shoot
        
    if(Input.GetMouseButtonDown(0))	 
    {	 
		 if(spawnPoint != null)
		 {
		 	Instantiate(bulletSphere, spawnPoint.transform.position,spawnPoint.transform.rotation);

                     // here again i need another color prefab
		 }		    
	}
}

Thanx for your support and help…

since it is public (by default), yes, once you have a reference in the other script to this script… for example:

 var otherScript = GameObject.Find("NameOfObject").GetComponent(NameOfScript); //(notice no quotes!)

(on another object) or

  var otherScript = GetComponent(NameOfScript); 

(on the same object)

once you have the script reference, you can call the function as:

 otherScript.CreateBubblePrefab(futureBubble.transform.position);