I need to find a part with nuke in it's name, any help?
COMMUNITY QUESTION
Finding part with string.match?
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.

2 comments
THIS WEBSITE ISNT FOR US TO WRITE SCRIPTS FOR YOU WHAT DO YOU THINK WE ARE FREE WORKERS?!?
We are not scriptersforhire.org, neither are we slaves.