I have a script that clones random zombie models in a random position and into the workspace.
--variables
topLeft = Vector3.new(-85.3, 0.5, -30.9) --Top left corner of the 2d region
bottomRight = Vector3.new(-43.2, 0.5, 6.9) --Bottom right corner of the 2d region
az = game.ReplicatedStorage.zombiemodels.A
bz = game.ReplicatedStorage.zombiemodels.B
cz = game.ReplicatedStorage.zombiemodels.C
dz = game.ReplicatedStorage.zombiemodels.D
ez = game.ReplicatedStorage.zombiemodels.E
fz = game.ReplicatedStorage.zombiemodels.F
gz = game.ReplicatedStorage.zombiemodels.G
singletonRandom = Random.new(tick())
--Function for the random number
function GetRandom(Min,Max)
return singletonRandom:NextNumber(Min,Max)
end
--Making the cloning items
PlayingFieldHeight = 15
while true do
local phrases = { az, bz, cz, dz, ez, fz, gz }
print ( phrases[ math.random( #phrases ) ] )
model = (phrases[math.random(#phrases)]):clone()
model.Parent = game.Workspace
model.PrimaryPart = model.HumanoidRootPart
model:SetPrimaryPartCFrame(CFrame.new(GetRandom(topLeft.X,bottomRight.X),PlayingFieldHeight,GetRandom(topLeft.Z, bottomRight.Z)))
wait(2)
end
I am very very new to scripting so please cut me some slack here, but I need to find out how I can count how many models are in the workspace with the corresponding names "A, B, C, D, E, F, G" and then disable the script when the number has reached the threshold I give it. Any help on how I can do this? I have no idea.

2 comments
Probably should have clarified what the script does. The script creates a 3d space for zombies to randomly spawn inside of and then chooses a random model to spawn and spawns it in a random area.. I will update you on whether or not this works. Thank you!
Unfortunately the script does not work. Either that or I am just doing it wrong, idk.