✓ Accepted answer
Basically, you save all the relevant properties of the Object you want to save in the form of a Table or JSONified table, and write a function that takes this table and creates actual bricks out of it.
For example:
PartsToSave = {
Part1 = {
Name = "Test",
Reflectance = 0,
Transparency = 0, Size = {20, 15, 6) ,
Position = {256, 2, 10},
Rotation = {2, 0, 0}};
Part2 = {...};
}
Using this table and nested generic for loops using the pairs iterator function (since ipairs doesn't for non-numeric indexes), you can Instance.new() the parts and set the relevant properties.
I suggest giving PartsToSave direct subtables of the Parts' types, namely Wedges, Trusses, and just Parts, to make the loops simpler.
1 comment
Thanks!