I have model and In this model I have 10 objects that named "Object1". random of objects gonna have name "Object2". How I can count them all by using something like Model:GetChildren()
First make a for loop
and check they're names, then count along with a variable
Use this:
local count = 0 for i, v in pairs(model:GetChildren()) do if v.Name == "Object2" then count = count + 1 end end