Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I put multiple parts in a table that have the same name?

I don't even know if the parameters for GetChildren() even do anything, but I thought to put the name of the parts I want indexed as a parameters which did nothing. How do I do this, if it's even possible without making individual variables for each part?

local windows = script.Parent.Parent.Parts:GetChildren("WindowParts")

1 answer

What you could do is make a dictionary table with the name of the parts and look through a specific service to look for the specific part

local Strings = 

{
	
	["WindowParts"] = true
	
}

local tab = {}
local descendants = workspace:GetDescendants() -- Location of where you have "WindowParts"


for _,index in pairs(descendants) do
	if Strings[index.Name] then
		table.insert(tab, index)
		print(index)
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.