Hi everyone - I'm new to scripting. This script will help me to play Mass Effect Trilogy XboxOne using my adapted PS4 Controller
I'm trying to toggle ADS & Powers.

ADS is usually (XB1_LT) PS4_L2 but I want that on (XB1_X) PS4_SQUARE
POWERS = (XB1_RB) PS4_R1 but I want that on (XB1_LT) PS4_R1

I need both examples above to include a TOGGLE.

My issue is that PS4_L2 still activates both ADS + POWERS

Please help me with my script below ------vvvvv

unmap PS4_L2;
unmap PS4_R1;


remap XB1_Y -> PS4_DOWN;
remap XB1_RIGHT -> PS4_OPTIONS;
remap XB1_RT -> PS4_L1; // Fire
remap XB1_LT -> PS4_SQUARE; // Aim
remap XB1_LB -> PS4_R2; // Weapons
remap XB1_RB -> PS4_L2; // Powers




int ads_toggle = FALSE;
int powers_toggle = FALSE;

main {
if (get_console() != PIO_PS4 && get_controller() == PIO_PS4) { //
if (get_val(PS4_TOUCH) && get_val(27)) { //
block (27,500); //
set_val(0, 100); //
}
//
} if(event_press(PS4_SQUARE)) {
ads_toggle = !ads_toggle;
}
if(ads_toggle) {
set_val(PS4_L2, 100);
} else {
set_val(PS4_L2, 0);
}

if(event_press(XB1_LT)) {
powers_toggle = !powers_toggle;
}
if(powers_toggle) {
set_val(PS4_R1, 100);
} else {
set_val(PS4_R1, 0);
}
}