Adding elements to a script

Ok, this is a tricky one, let’s see if I can explain it. I have a script that makes a wall of cubes. There’s variations in which cube the comp decides to print, based on probability and specification. Whew. Basically, I have a “background” cube that consist of most of the grid. Then, there’s a rarity color, which prints the math pattern, then, there’s also the specific variation, which is a series of values to manually draw a 3d rectangle of cubes within the whole array, of yet a third color.

Did I lose you yet? Ok, so here’s the question. How can I address the script to allow me to make “elements” in the editor, where each element is a specific mod? (a list of values)

I need the code itself to be flexible to the number of variables. I mean elements like the elements in the input manager. You can create a new “element”. Each element is an array describing the input and how to interpret it. but the number of arrays is variable. The problem im having is that the code itself must change to accomodate different numbers of element. I’m trying to avoid

If elements =  1, do this.
If elements = 2, do that
... Ad infinatum...

Is that any clearer?

I need a function that will allow mw to create a variable, who’s name is stored in a varable. It needs to be something like

Create an element, containing variables, who's names are (the value of varaible 1), (the value of variable 2,)... And insert   The following code into it.

// insert code here. `

Turns out I needed an array of custom classes. Thx for your input guys. Jahroy had the right answer.