create an instance variable on your player object and use 1,2 or even strings "sword" "fist".
Set the variable to the correct choice when the player switches the weapon.
In your 'on Y or B button pressed' event have two sub subevents that check for "sword" or "fist" and then place your relevant actions in those sub events.