for i,v in pairs(game.Workspace.abc:GetChildren()) do local tab,val = {},v.Name table.insert(tab, val) print(tab,val) end
Basically this script is supposed to print "test" since the parts in abc model are t, e, s, t but instead i get this: table: 0x0ba418710f62d17d t table: 0xfb33a005be1626bd e table: 0x6f05649465964e3d s table: 0x1b34c652dafdfa5d t
im a scripting beginner so maybe thats just a feature that i dont know about. any help would be appreciated.
You are trying to print the table, not the value in the table. Also another thing i would like to point out is you are trying to do table.insert(table, value) when the second parameter should really be the position where the value is gonna be inserted. So in your case you should do table.insert(tab, 1, value). And to print out the value and not the table use print(tab[1])
I'm not 100% sure what you're trying to do, but I created this script that lists all the objects in Workspace and puts them inside the table.
for _,part in pairs(game.Workspace:GetChildren()) do local tab,val = {},part.Name table.insert(tab,val) print(tab[1]) end
To index the value of a table you have to do this.
print(TABLE_NAME[WHICH VALUE YOU WANT INDEXED])
And that will print the number 1 spot in the table name.
If you need more explanation, let me know. I'm willing to help a fellow scripter out.