Use '&&' instead of 'and'. Use and if you are doing something with buttons: if button(2) and #up