When the npcs stop they get :Destroy() 'ed after 1 second.
Now I want to spawn two more npcs in the same spot, and make them exactly like the old ones. Then loop it so it goes on forever.
I haven’t tested this, and this is more of a layout of what you should do.
local lastSpawnPosition = nil
local function spawnNPC()
local clone = NPC_MODEL:Clone() -- replace with their model
clone.PrimaryPart.CFrame = CFrame.new(lastSpawnPosition) or CFrame.new(0, 3, 0) -- put spawn Position here
lastSpawnPosition = clone.PrimaryPart.Position
clone:WaitForChild("Humanoid").Died:Once(function()
task.wait(1)
spawnNPC()
end)
end
spawnNPC()
I would recommend you use clone:WaitForChild("Humanoid").Died:Once() instead, since the event can only be ran once, after it gets ran it automatically gets disconnected.