Need help with script.

I made a script where numbers change randomly and its connected with 3d text:

var number : float;
var numbershow : TextMesh;




InvokeRepeating("numbers", 0f , 1f);



function Update () {



numbershow.text = number.ToString();




}





function numbers(){

number = Random.Range(0.000001,0.054699);

}

Now I want to make that when player enter certain collider trigger (tagged) to make Random.Range change values (like instead (0.000001,0.054699) to be (1.3543,30.435453)) and on trigger exit to return them to default .How do I make that? I tryed lots of ways but now I am out of options so I need to ask for help …

First of all, remove the hardcoded values and replace them with public variables.

number = Random.Range(0.000001,0.054699);

to

public float a;
public float b;

private float default_a = 0.000001;
private float default_b = 0.054699;

number = Random.Range(a,b);

Now you can attach a script on the colliders that the player walks into with two public variables, a and b. Now change the players a and b to the colliders a and b.
And when the player leaves a collider, you change the players a and b to default_a and default_b