Last active
January 3, 2018 21:52
-
-
Save red-001/292a2b52ee18b4a92e02599b4b245674 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function run(user_mod_code) | |
local env = table.copy(_G) | |
local user_function, message = loadstring(user_mod_code) | |
if not user_function then return nil, message end | |
setfenv(user_function, env) | |
return pcall(user_function) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment