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

Finding part with string.match?

I need to find a part with nuke in it's name, any help?

2 comments

0

THIS WEBSITE ISNT FOR US TO WRITE SCRIPTS FOR YOU WHAT DO YOU THINK WE ARE FREE WORKERS?!?

0

We are not scriptersforhire.org, neither are we slaves.

1 answer

If you know what the part's parent is going to be, iterate through its children and use string.match on each of their names

for i,v in pairs(Parent:GetChildren()) do --i is index (the child's number in the hierarchy) and v is value(the part)
	if v.Name:lower():match("nuke") then --if the lowercase version of the name has nuke in it then
		--code here
	end
end

replace 'Parent' by the part's parent location in the game hierarchy

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