InvokeRepeating not working after Random.Range

This spawn script is suppose to spawn an object every 1-5 seconds, depending on the random number chosen. I debuglogged the number and its being randomized, but only one object spawns, and that’s when the game loads. Is it because the “number” variable is changing so much that its not working? Any help would be appreciated.

var prefab : Rigidbody;
var Stuff : Transform;
var number : int;

InvokeRepeating("Randomize",0,1);

function Randomize() { 
	number = Random.Range(1,5);
	Debug.Log(number); 
	}
	
InvokeRepeating("Spawn",0,number);

function Spawn () {
	var Spawn : Rigidbody;
	Spawn = Instantiate(prefab, Stuff.position, Stuff.rotation);
	}

Your script does not make much sense to me as it is:

function Start(){
   StartCoroutine(Spawn());
}

function Spawn(){
   while(true){
      var rand = Random.Range(1,5); // this will get 1 to 4 only
      var timer : float = 0.0f;
      while(timer < rand){
          timer += Time.deltaTime;
          yield;
      }
      // Spawn your guy
   }
}