This is what happens when I paste your code into the ZeroBrane editor and hit F7 (compile).
Compilation error on line 3:
untitled.lua:3: unexpected symbol near ')'
See the attached picture of the action in the ZeroBrane editor.
When I edit code, I ALWAYS hit F7 before I save it and try to run it in Mach.
I'm sorry, but bad script code is a killer. You can ALWAYS crash Mach with bad LUA code. We chose LUA because it was faster than anything else and the scripts run at near compiled C++ speed. Unfortunately, with that speed comes the ability to crash because there is literally no protection layer. You, the integrator, must be the protection layer. Especially if you are doing something custom like a tool change script. Zerobrane and F7 is your friend.
Steve