gate = createObject(id,x,y,z, rotx, roty, rotz)open = false function checkOpen(source)if ( open == true ) thenopen = falsegateClose(source)elseopen = truegateOpen(source)endendfunction gateOpen(source)moveObject( gate, 2000, x, y, z )endfunction gateClose(source)moveObject( gate, 2000, x, y, z )endaddCommandHandler(\"command\", checkOpen)