Are you using the drag and drop instead of full GML coding? If so, I might know how you can do it...
1. Create a button press event for whatever button you want. Say, Q.
2. Drag a set variable block into the event.
3. Put the name of the variable in the variable box, and then in the value box, put the name of the same variable with an exclamation point in front. Like equip_slot in the first box, and !equip_slot in the second. Don't check the 'relative' box.
Basically the exclamation point will invert whatever your variable is, if it's a binary or boolean value. That basically means, if your variable is either a 1 or a 0, or it's a TRUE or a FALSE (both are the same in the underlying code) it'll change your variable to whatever it isn't. So 1 becomes 0, true becomes false.
Disclaimer: I never use drag and drop, so I'm not completely sure this is correct. If it isn't... just use a code block and copy/paste the code
@Simon Gust posted. It does the exact same thing.