wait(1)
local amn = 80
local curamn = 0
local items = game.ServerStorage:WaitForChild("Shells"):GetChildren()
while wait(.01) do
if curamn == amn then
script:Remove()
else
curamn = curamn + 1
local randomItem = items[math.random(1, #items)]
randomItem.Name = "Shell"
randomItem.CanCollide = true
randomItem.Position = Vector3.new(math.random(-1495.75,-179.25),0,math.random(24.25,1121.75))
randomItem.Parent = workspace
end
end
Whenever the script creates 2 new shells, they get deleted, in the end of the loop leaving me with only 2 shells spawning.
So basically my shells are getting automatically deleted. This is not a script in my game as everything was scripted by me.