Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Shows only 1 value in table but prints all value?

Asked by
TechModel 118
1 year ago
Edited 1 year ago

Hey! I want to get this folder of all its childrens and put it in a table. however it only puts one in. I tried print(unpack(ITEMLIST)) somehow it gave me all the values.

local ITEMTABLE = {"...",}

    local ITEMLIST = game:GetService("Workspace").Folder:GetChildren()

    table.insert(ITEMTABLE, tostring(unpack(ITEMLIST)))

1 answer

Log in to vote
2
Answered by
niroqeo 123
1 year ago

Do a for loop through the item list and insert each individual one into the item table.

for index, item in pairs(ITEMLIST) do
    table.insert(ITEMTABLE, item)
end

I didn't write this in Studio but the gist of it is to use a for loop to loop through the item list and insert each item into the item table.

Ad

Answer this question