This works, but only partially, because this feature requires the weapon to be loaded for at least the specified number of shots. If less than that, the user gets a message that the weapon does not have enough shots. In my example, the weapon accepts different clips with different numbers of shots, and I need them all to be fully discharged after a shot. I also need the weapon to empty if a loaded clip is not full.
I tried to discharge weapons in the “skillUseUnit” script - there the function “setAmmoQuantity 0;” also leaves one shot in the weapon, but then when the user shoots, this last shot is consumed. However, it looks terrible.