for example:
1 | a = { } |
2 | for i = 1 , 5 do |
3 | h = Instance.new( "Part" ,workspace) |
4 | table.insert(a,i,h) |
5 | end |
6 | a [ 1 ] .Anchored = true |
will this work?
Yes.
Also, if you want to save some space, you can create the part and enter it into the table at the same time.
Note: You can leave 'i' out of the arguments in the table.insert function on line 4. The script will default to the succeeding table entry.
1 | local a = { } |
2 | for i = 1 , 5 do |
3 | table.insert(a,Instance.new( "Part" ,workspace)) |
4 | end |
5 | a [ 1 ] .Anchored = true |