I have a for loop and am inserting v into it, but my problem is I can’t seem to seperate the two values
for i, v in pairs(plots:GetChildren()) do
if not v:FindFirstChildWhichIsA("StringValue") then
table.insert(t, 1, v) --- prints both values of v, which I want the value seperated into [1] or how many are in the table.
Sorry for the misunderstanding, I’ll try clear this up a bit. I tried both of your methods but I ran into a problem.
I am trying to basically separate one value from another, for example
for i, v in pairs(plots:GetChildren()) do
if not v:FindFirstChildWhichIsA("StringValue") then
table.insert(t, v) --- v has two values, i'll reference them as plot3 and plot4.
print(t[1][2]) --- what I am wanting is for slot 1 in the table to have value of plot3, and slot 2 as plot4. the problem I'm having is that the two values are combined into one slot.
I tried both of your methods, first one the problem is, if I do that and unpack the table, it looks like this:
(using plot3 and plot4 to reference the two objects inside)
If i understand you dilemma correctly, you want to have the v array which contains "plot3", "plot4" to be inside of t so when you do t[1] you get "plot3" and when you do t[2] you get "plot4", if that’s the case then you can simply set the t to v since v is already an array. So simply do