Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to rename multiple models at once?

Asked by 7 years ago

So I'm trying to rename multiple models at once in a folder. I've tried to do

local customers = game.Workspace.customers:FindFirstChildOfClass("Model")
customers.Name = "test123"

but it only renames one random model. Does anyone know how?

1 answer

Log in to vote
0
Answered by 7 years ago

Use pair loop or GetChildren() table

Example:

for i,v in pairs(customers:GetChildren()) do
    v.Name = 'test123'
end
Ad

Answer this question