How do i set the value of a variable in real time at the value of the same variable..

Hi,
i want to do a slenderman parody.
This is my script:
#pragma strict
var GuiText : GUIText;
public var x : int = 0;
var Foglio : GameObject;
var zonaRaccolta : GameObject;
var abilitata : boolean = true;

function Start () {

}

function Update () {

}

function OnTriggerStay () {
if(Input.GetKeyDown(KeyCode.Mouse0) abilitata == true)
{
x = x+1;
GuiText.text = x.ToString() + “/6”;
Destroy(Foglio);
yield WaitForSeconds (3);
GuiText.text = “”;
abilitata = false;
}
else
{
yield WaitForSeconds (10);
GuiText.text = “”;
}
}
Basically it shows on a GUILabel the value of x(number of pages) converted to string.
I attached this script to 6 different triggers; but when i pick up the page from one trigger, the value changes only into the script attached to that single trigger; the other trigger’s x variable have a value of 0. I want to change in all the triggers the value of x, so that when i pick a page it shows “1/6”, the 2nd “2/6”, etc…
Thanks

I could be wrong but why dont you put your Number of collected Pages variable into the playerscript or a other script and just access it from the trigger and increment it?

I’m sure there are other ways but this is how i would have done it.