How do I make my models name themselves, then add a number?

Hi. Looking for help on how to make my model names “iterate” themselves, for example,

*workspace.part
*workspace.part1
*workspace.part2

so on and so on…

If this helps, for context, I’m trying to do this to make assigning a light-up buzzer system like the ones seen in nuclear power control rooms. If there’s an easier fix for this, please let me know!

2 Likes

This is slightly different but might work for you, have you used tags? Read more here:

The API is here:

https://developer.roblox.com/en-us/api-reference/class/CollectionService

1 Like

Just go to the command bar and rename lights depending on order:

local lights = --> lights here
for index, Light in ipairs(lights) do --> going through each light
    Light.Name = “Light” .. index --> renames each light
end
2 Likes

Thanks! Learning this will probably prove very useful in the future :grinning:

3 Likes