Richard Feldmanwipc5f0a5b1 year agoHistory
33 lines · 664 B · Lua
RawDownload
---@diagnostic disable: undefined-global local sandbox = {} sandbox.string = stringsandbox.table = tablesandbox.math = mathsandbox.print = sb_printsandbox.type = typesandbox.tostring = tostringsandbox.tonumber = tonumbersandbox.pairs = pairssandbox.ipairs = ipairssandbox.search = search local io = {} io.open = sb_io_openio.popen = sb_io_popen sandbox.io = io local user_script_fn, err = load(user_script, nil, "t", sandbox) if not user_script_fn then  error("Failed to load user script: " .. tostring(err))end local success, result = pcall(user_script_fn) if not success then  error("Error executing user script: " .. tostring(result))end