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

If multiple have the same name, what does the script pick?

So i've wanted to do this randomization concept that could save me tons of time. What i want to know if (say) two bricks were named the same thing, what would a script do to find out which one it picks?

edit: just tell me if this sounds confusing it may be typed wrong

1 comment

1

It picks the first one in the hierarchy.

1 answer

You can add something in the one you what the script to pick , now for exemple i'll add a part then i'll add the code in a script:

for _,i in pairs(workspace:GetChildren()) do -- Location of my 2 Parents with the same name
	if i.Name == "DragosGames" then -- we need to get only the Parents with the same name
		if i.Part then -- if in the Parent has the part
			i:Destory()
		end
	end
end

let me know if works

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