I am using a for loop to iterate through a folder and get there respective names, that folder has some objects. For example,
Folder
Object1
Object2
Object3
My problem is I want to identify them by not making 3 individual if statements. So, I want to identify them with there numbers at the end of the string and How am I suppose to do that?
local folder = script.Parent.Folder
for i, v in pairs(folder:GetChildren()) do
if v.Name == "Folder"..i then
--if the last number matches do something--
--- remeber one thing "i" changes..it's like i = 1,2,3
end
end
Oh, I think that’s not what I meant. Thanks for helping btw. I meant was to iterate more then 3 objects but there are 3 identical objects which I want to find by making a for loop to understand what numbers they got.
the value of “i” is not limited , it changes with how many objects u have.if u have 5, the value of i
will be 1,2,3,4,5…
it’s like this. i hope u can understand this.