--executes `code` as a Lua chunk in the global namespace, returning an error if the code fails or nil otherwise
worldedit.lua=function(code)
localoperation,message=loadstring(code)
ifoperation==nilthen--code parsing failed
returnmessage
end
localstatus,message=pcall(operation)
ifstatus==nilthen--operation failed
returnmessage
end
returnnil
end
--executes `code` as a Lua chunk in the global namespace with the variable pos available, for each node in a region defined by positions `pos1` and `pos2`, returning an error if the code fails or nil otherwise