--// Basic Spawner Script local SPAWN_INTERVAL = 5 -- Seconds between spawns local MAX_SPAWNS = 10 -- Max active spawns (0 = unlimited) local SPAWN_LOCATION = Vector3.new(0, 10, 0) -- Where to spawn local spawnFolder = workspace:FindFirstChild("SpawnedObjects") or Instance.new("Folder") spawnFolder.Name = "SpawnedObjects" spawnFolder.Parent = workspace local activeSpawns = 0 local template = nil -- We'll set this below -- Example: Spawn a simple red Part local function createTemplate() local part = Instance.new("Part") part.Name = "SpawnedPart" part.Size = Vector3.new(4, 4, 4) part.Color = Color3.fromRGB(255, 0, 0) part.Material = Enum.Material.Neon part.Anchored = false part.CanCollide = true part.Position = SPAWN_LOCATION return part end template = createTemplate() local function spawnObject() if MAX_SPAWNS > 0 and activeSpawns >= MAX_SPAWNS then return end local newObject = template:Clone() newObject.Position = SPAWN_LOCATION + Vector3.new(math.random(-10, 10), 0, math.random(-10, 10)) -- slight random offset newObject.Parent = spawnFolder activeSpawns += 1 -- Optional: Auto-destroy after some time task.delay(30, function() if newObject and newObject.Parent then newObject:Destroy() activeSpawns -= 1 end end) end -- Start spawning task.spawn(function() while true do spawnObject() task.wait(SPAWN_INTERVAL) end end) print("Spawner started!")