You're supposed to use an index number here: newObject[ index number here ], I think..I don't understand why you're using userdatas
edit: nvm I see why you're using userdatas now, but it's preferable to use table constructors in my opinion
nObjects = #newObject --total number of elements in the array
newObject[nObjects + 1] = createObject(1279,x,y,z)