Chansen
You can read about how to set parameters in the functions section of the manual: https://www.scirra.com/manual/149/function
If you're going to be using functions a lot it's well worth familiarising yourself with parameters, they're very useful.
Here's a capx of your code that includes a parameter on the "cubespawn" function call:
https://www.dropbox.com/s/9rvwjo10rbvs2 ... .capx?dl=0
In event 3 I use an action to pass the global variable Cube as parameter 0 on Function Call "cubespawn".
You can add a parameter field to the Call function dialog by clicking the "Add parameter" highlight text. You can pass numbers, variables and strings as parameters.
In event 4, On the "cubespawn" function being called, it uses the passed parameter 0 value of Cube in a repeat loop. This loop creates a sprite for each iteration, using the repeat loopindex to step up the sprites X position.
I've also included another way to spawn a row of objects that may be of use, depending upon how flexible you need the system to be.
You could also integrate "newrow" and "cubespawn", if there is a one to one relationship between them.
Hope that helps! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">