You need to read more about scripting like events, menus, if-statements, and for ever "{" there NEEDS to be a "}".