If you don't understand, I have a set of about 100 Parts in order in a line. I want to name them starting at 1 to 100. How could I do this without wasting an hour? I don't know if it's possible, but please give some suggestions! :)
partsTable = game.Workspace.Model:GetChildren() for i = 2, #partsTable do local key = partsTable[i] j = i - 1 while (j >= 1 and partsTable[j].Position.Z > key.Position.Z)do partsTable[j + 1] = partsTable[j]; j = j - 1; end partsTable[j + 1] = key; end for i, v in ipairs(partsTable)do v.Name = i end