mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-11 00:03:18 +08:00
17 lines
235 B
Lua
17 lines
235 B
Lua
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 |