01-11-2011, 01:52 AM
Update #2:
loadstring() returns a function, you then have to call it with an extra set of parentheses:
Using pcall() you can check whether the script was successful or not and get the error message.
- You can copy and paste in the chat bar
- Fixed a bug with events that would cause random errors
- Added loadstring(). I had to make it myself, so it might not work the same way as in other games.
loadstring() returns a function, you then have to call it with an extra set of parentheses:
Code:
loadstring("print(\"Hello\")")()
Using pcall() you can check whether the script was successful or not and get the error message.
Code:
function dostring(code)
local status, result = pcall(function() loadstring(code)() end)
if not status then error = result:sub(14); print(error) end
end