Go to the BP_PlayerInventory and create a new variable, set its name to LoadHighestAmmoMagazine and set its type to Boolean, then compile and in the Class Defaults set the LoadHighestAmmoMagazine setting to ticked on.
Go to the SearchForWeaponMag function in the BP_PlayerInventory component and create a new Local Variable called HighestAmmoCountMagL and set its type to S_InvSlot.
Then create another new Local Variable and set its name to AmmoCountL and set its type to Integer, then compile and set its Default Value to 0.
Then copy the images below in the SearchForWeaponMag function.


