How to check how much the instances with the same name?

Hi,
How would i check how much i have instances with the same name in the same folder?
i can get amount of all childs in folder but how to get amount of the specific named instances?

This can be done by looping through the children and using an if statement.

local amount = 0
for _, child in pairs (something:GetChildren()) do
    -- do the thing
    if child.Name == "Yes" then
        print("Yes")
        amount = amount + 1
    end
end

print(amount)

How this works is, it will loop through the folder you have, and if it finds something with the correct name, it will add 1 to a variable. Once the loop is done, it will print the amount of times the Name came up.

5 Likes