diff --git a/worldedit/code.lua b/worldedit/code.lua index 9e3d986..4f52f29 100644 --- a/worldedit/code.lua +++ b/worldedit/code.lua @@ -4,6 +4,9 @@ --- Executes `code` as a Lua chunk in the global namespace. -- @return An error message if the code fails, or nil on success. function worldedit.lua(code, name) + if string.sub(code,1,1)=="=" then + code="return "..string.sub(code,2) + end local factory, err = loadstring("return function(p) " .. code .. " end") if not factory then -- Syntax error return false, err