but when this function is tested in Roblox studio it unfortunately does not work
The code
function foo (n)
if n > 0 then return foo(n - 1) end
end
foo(19998) -- make number higher if it does not error for you
print("End")
or
local function foo (n)
if n % 1000 == 0 then print(n) task.wait() end
if n > 0 then return foo(n - 1) end
end
foo(19997) -- make number higher if it does not error for you