-- name: No Button Challenge -- description: This mode allows you to disable one or more buttons for all players! gGlobalSyncTable.A = false gGlobalSyncTable.B = false gGlobalSyncTable.Z = false gGlobalSyncTable.X = false gGlobalSyncTable.Y = false gGlobalSyncTable.L = false gGlobalSyncTable.R = false --- @param index integer --- @param value boolean local function set_button(index, value) if index == 0 then gGlobalSyncTable.A = value elseif index == 1 then gGlobalSyncTable.B = value elseif index == 2 then gGlobalSyncTable.Z = value elseif index == 3 then gGlobalSyncTable.X = value elseif index == 4 then gGlobalSyncTable.Y = value elseif index == 5 then gGlobalSyncTable.L = value elseif index == 5 then gGlobalSyncTable.R = value end end local function before_mario_update(m) if(gGlobalSyncTable.A == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~A_BUTTON m.controller.buttonDown = m.controller.buttonDown & ~A_BUTTON end if(gGlobalSyncTable.B == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~B_BUTTON m.controller.buttonDown = m.controller.buttonDown & ~B_BUTTON end if(gGlobalSyncTable.Z == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~Z_TRIG m.controller.buttonDown = m.controller.buttonDown & ~Z_TRIG end if(gGlobalSyncTable.X == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~X_BUTTON m.controller.buttonDown = m.controller.buttonDown & ~X_BUTTON end if(gGlobalSyncTable.Y == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~Y_BUTTON m.controller.buttonDown = m.controller.buttonDown & ~Y_BUTTON end if(gGlobalSyncTable.L == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~L_TRIG m.controller.buttonDown = m.controller.buttonDown & ~L_TRIG end if(gGlobalSyncTable.R == true) then m.controller.buttonPressed = m.controller.buttonPressed & ~R_TRIG m.controller.buttonDown = m.controller.buttonDown & ~R_TRIG end end if network_is_server() then hook_mod_menu_checkbox("A Button", false, set_button) hook_mod_menu_checkbox("B Button", false, set_button) hook_mod_menu_checkbox("Z Button", false, set_button) hook_mod_menu_checkbox("X Button", false, set_button) hook_mod_menu_checkbox("Y Button", false, set_button) hook_mod_menu_checkbox("L Button", false, set_button) hook_mod_menu_checkbox("R Button", false, set_button) end hook_event(HOOK_BEFORE_MARIO_UPDATE,before_mario_update)