So we have 9 items inside this folder and i want to count how many parts inside the folder so its 5 parts but ill use a for loop to count how many ‘part(s)’ are inside the folder
local count = 0
for i,v in pairs(workspace.Folder:GetChildren()) do
if v:IsA("Part") then count+=1 end
end
print(count,"parts are inside this folder")
Output =
so this means that its also acknowledging the SpawnLocations are also ‘Parts’
but if you change the IsA to v.ClassName == “Part” it will count 5 parts inside the folder but isnt IsA a function that returns what Class an item is? and why is the spawnlocations considered ‘Parts’?