RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"nothing is spawning still and wave 1 should spawn 5 npcs"
-- This might be due to the fact that the NPC is not properly positioned at the spawn location. Here's a corrected version of the script. -- server script local npc = game.ServerStorage.NPC -- replace with your NPC local spawns = {game.Workspace.NPCSpawn1, game.Workspace.NPCSpawn2, game.Workspace.NPCSpawn3} local maxWaves = 25 local wave = 1 while wave <= maxWaves and not game.Workspace.Door:IsDescendantOf(game.Workspace) do local npcCount = wave == 1 and 5 or math.floor(5 * (1.25^(wave - 1))) for i = 1, npcCount do local spawn = spawns[math.random(1, #spawns)] local clone = npc:Clone() clone.Parent = game.Workspace clone.HumanoidRootPart.CFrame = spawn.CFrame end while #game.Workspace:GetChildren() > 3 do task.wait(1) end wave = wave + 1 end