How to break a for loop without breaking while loop?

So I have this npc spawner, that loops through something, but it’s all in a while loop and I only want to break the for loop:

while true do
    wait(10)
    for i,v in example:GetChildren do
    -- other stuff
    break -- this break will end up down there
    end
end
-- down here
1 Like

Have you tried replacing break with continue? Please let me know the result :smile:

Try Using “Do”

while true do
    wait(10)
    for i, v in ipairs(example:GetChildren()) do
        do
            return
        end
    end
end

both ways didn’t work, btw continue just makes the script continue so nothing happends

Try returning it.

while true do
    wait(10)
    for i,v in example:GetChildren do
    -- other stuff
    return
    end
end