Files
aiolauncher_scripts/sandbox.lua
2021-08-04 16:05:46 +03:00

11 lines
245 B
Lua

function sandbox(func)
local co = coroutine.create(func)
local hook = function() coroutine.yield('resource used too many cycles') end
debug.setupvalue(func, 1, _G)
debug.sethook(co, hook, "", 100)
coroutine.resume(co)
end