I would like to place CFrames in an array, but I can't place commas in the array without separating my value into pieces. This code shows my problem:
local myArray = {0, 5, 0, 100, 6, 2}
"0, 5, 0" is my first coordinate, "100, 6, 2" is my second. I can't get these coordinates to be shown as two values instead of six. Any help in resolving this issue is greatly appreciated.
local myArray = {0, 5, 0, 100, 6, 2} print(myArray[1]) -- You use myArray[numberhere] to select a part of the array. print(myArray[1] + "," + myArray[2] + "," + myArray[3] -- This should print 0,5,0.
When you want to select a specific part of an array, you use Array[numberhere] to select a specific part. There's also another idea I have which may help you, but I'm not sure if you'll like it because it involves using strings in the array.
local myArray = {"0, 5, 0", "100, 6, 2"} print(tonumber(myArray[1])) -- This turns the first object of myArray into a number. The object was originally string. print(tonumber(myArray[2])) -- This turns the second object of myArray into a number. This was also a string. Should print 100, 6, 2.