local numb = 0
local function AddTil()
numb = numb + 1
if (numb<100000) then
AddTil()
end
end
AddTil()
print(numb)
This script crashes when I run (overflow).
I wonder what’s the limit to recursion?
local numb = 0
local function AddTil()
numb = numb + 1
if (numb<100000) then
AddTil()
end
end
AddTil()
print(numb)
This script crashes when I run (overflow).
I wonder what’s the limit to recursion?
If i’m correct it’s about 16k. Why do you need such a big number?
I’m just trying to see if people can overflow the recursion script in my game, but since 16k is already a big number, I think I’m not going to be too concerned about it.
@ADUPS 's answer (16382) is correct.
Just in case anyone is thinking of using proper tail calls to do infinite recursion, it doesn’t work in Roblox. See this post for more details. I hope this saves someone a bit of time and frustration wondering why proper tail calls still give overflow errors.