How do you make all these arrays equal to 0?

static var inventoryArray : int = [0,1,3,4,5];
var InputText : GUIText;
function Update () {
//con agra stock
InputText.text = "con " + “[” + inventoryArray[0] + “]” +
"
" + "general " + “[” + inventoryArray[1]+ “]”;
//general

how do i make all these arrays to equal to 0? e.g my “general” is showing up as [1] and i want it so that when it shows up it is [0] without interfering with “con” because when i tried to put “general” to [0] it combines with the “con”.

static var inventoryArray : int = [0,1,3,4,5];
var InputText : GUIText;
function Update () {
InputText.text = string.format(“con [{0}]
general [{1}]”, inventory[0], inventory[0]);
}

Not sure if that is what you want, but at least it is easier to read.

I thought a bit more about this, and I’m interested in what you mean when you mention the two values are interacting with each other.

Your inventoryArray is static, so if you are expecting the array to be different for different objects (if you have the script on multiple objects, for example), you’ll end up with the same values in all instances of the script/class.