How can you store multiple things in workspace that have the same name in an array?
myTable = {} --Your table. desiredName = "YourDesiredName" --Your desired name. for i,v in pairs(game.Workspace:GetChildren()) do --Set up for loop for Workspace's childre. if v.Name == desiredName then --Check if the name is the same. table.insert(v, myTable) --Insert the instance if the name is the same. end end
If I helped you out, make sure to hit the Accept Answer button below my character! :D
Your question is pretty broad.. but i'll try to help. You should definitely elaborate on what you want.
If you mean that you have an array full of names, and if there's an object in the workspace with a name that matches a name in the array then parent it somewhere else then..
First, you should define the array
local names = {"Thing","Thing1","Thing2","Thing3"}
Then you should iterate
through the table, and use an if statement
to check if there's a part with the same name in workspace.
for i,v in pairs(names) do local obj = workspace:FindFirstChild(v) if obj then
And lastly you should store it by parenting it to wherever you want. Here's it all together.
local names = {"Thing","Thing1","Thing2","Thing3"} for i,v in pairs(names) do local obj = workspace:FindFirstChild(v) if obj then obj.Parent = --Put the parent here end end