I am making a zombie kind of game and I want to be able to detect how many Zombies are in the workspace so I can make it stop spawning them when the amount of zombies is too high. How would I count them?
If they are all called "Zombie" then you can count the number of objects in workspace that are called "Zombie"
local zombies=0 for _,v in pairs(workspace:GetChildren())do if v.Name=="Zombie"then zombies=zombies+1 end end
Something better you could do is just have a folder in workspace where you store all of the zombies. Then you can just check #zombiefolder:GetChildren()