I have names some objects in my game as there userId then the name of the object. I thought this would help me track but I am not sure how I would find them based off the userId. I thought it would be with string.sub or string.len but I cant find a way to get it to work.
COMMUNITY QUESTION
Is there any way to search a object names based off userId? (only part of the name is the id)
1 answer
stuff = game.Workspace:GetChildren()
--or wherever you have your objects
TableOfStuff
for _,v in ipairs(stuff) do
if v.Name:find(tostring(PlayerUserId)) then
table.insert(TableOfStuff, v)
end
end)
return TableOfStuff
I am assuming that you know what the userId is
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
:D This is what I needed. Have to modify it a bit. Thank you so much SurVur!