1
0
mirror of https://github.com/citizenfx/cfx-server-data.git synced 2025-01-11 00:03:18 +08:00
cfx-server-data/resources/runcode/runcode_shared.lua

17 lines
235 B
Lua
Raw Normal View History

2017-09-05 17:58:39 +08:00
function RunCode(code)
local code, err = load(code, '@runcode')
if err then
print(err)
return nil, err
end
local status, result = pcall(code)
print(result)
if status then
return result
else
return nil, result
end
end