local ZombieCount = game.ReplicatedStorage.GameInformation["ZombieCountMultiplier"].Value local Zombie = game.Workspace["Zombie"] Zombie.Parent = game.ReplicatedFirst function PutIntoPlacer() for Z = 100, ZombieCount do local SpawnPointX = math.random(0, 100) local SpawnPointZ = math.random(0, 100) local ClonedZom = Zombie:Clone() ClonedZom:MoveTo(Vector3.new(SpawnPointX, 100, SpawnPointZ)) ClonedZom.parent = game.Workspace wait() print(ClonedZom.HumanoidRootPart.Position) end print(ZombieCount.. " Zombies Placed") end wait(10) PutIntoPlacer()
Thanks
It may be because Z Is higher than ZombieCount Value which would prevent it from executing, since It's supposed to increase Z and execute the code everytime until it reaches the ZombieCount value, but since ZombieCount value is already below Z then it shouldn't execute the loop anymore.
In this case if you wanted to instead of increase Z, decrease it you can put ,-1 at the end.
for Z = 100, ZombieCount, -1 do
Which would decrease Z everytime instead of increasing it, for example, Z = 100 and ZombieCount = 90, it would execute the code until Z reaches 90.
so technically it would execute the code 10 times.
Hopefully this helps with your issue! Make sure to keep us updated if it didn't so we can get a properly solution for it!
If you want to know more about Loops, such as the For loop make sure to read Roblox Coding Basics -- Loops As It'll definitely help you with those kind of issues!
Probably because you start the for loop with a big number, and maybe 100 is bigger than game.ReplicatedStorage.GameInformation.ZombieCountMultiplier.Value
. I recommend to write 1, but I don't know what you want.