I have a tile based game and I need to organize the children of a folder for a scripting table. Simplified: I have a folder full of models labeled “BeachPathNUMBER” such as “BeachPath15”.
How would I organize this so the number progressively get larger? Or, how do I organize the table while scripting.
for i,v in pairs(workspace.NormalPatchAlongBeach:GetChildren()) do
local number = v.Name:gsub('BeachPath', '')
local str = '0000'..number
str = str:sub(str:len() - 3, str:len())
v.Name = 'BeachPath'..str
end