--[[local DataStoreService = game:GetService("DataStoreService")
local GameData = DataStoreService:GetDataStore("GameData")--]]

local Data = {}

local function wait(seconds)
    local w = os.time()
    
    repeat until os.time() > w + seconds
end

--[[local function loop(i)
    while true do
        i = i + 1
        if i == 100 then
            break
        end
    end
end

local c = coroutine.create(function()
    wait(1)
    
    for i = 1, loop(i) do
        print(i)
        --coroutine.yield()
    end
end)

coroutine.resume(c)--]]

-- iterators :d (result is 420.5)

--[[local function the_funny(number)
    return coroutine.wrap(function()
        for i = 1, number do
            print("iterating", i)
            coroutine.yield(i * i / 2)
        end
    end)
end

for number in the_funny(69) do
    print(number)
    if number > 420 then
        print("iterator has reached the limit\n")
        break
    end
end--]]

local function funny69loop420(number)
    return coroutine.wrap(function()
        for i = 1, number do
            coroutine.yield(i .. "a", i .. "b", i .. "c", i .. "d")
        end
    end)
end

for a, b, c, d in funny69loop420(420) do
    print(a, b, c, d)
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: