Also, if profession1 and the rest are not variables, you need to use quotes because they are strings.
It might also be simpler to just forget the if statements and just do something like:
PHP Code:
function MyclassGUI_Button1.onAction() {
client.playerprofession = this.selectedprofession;
MyclassGUI_Window1.destroy();
}
Unless of course you're planning on adding more