This can be done using projectile randomizers. To start, you should build the box and have the main button which you activate to get the random weapon. Somewhere outside your map or out of view, place a 1xwhatever distance plate, it depends on how many outcomes you want (1x16=32 different outcomes). Name this plate something like Projspawner. Now, at the same distance above and below that plate (there needs to be a space between the Projspawn and the weapon outcomes)place 1x1s the length above and below the Projspawn.
It'd look something like this:
---------------- <Top layer of 1x1s
(Space) <(Don't make the space too big, 1-3 flat bricks is fine).
---------------- <The 1xwhatever (Projspawn)
(Space same distance as the one above)
---------------- <Bottom layer of 1x1s
Now, event all the 1x1s to be OnProjectilehit > Namedbrick (where you want weapons to appear) > SpawnItem > Item.
Event the main activator button to be OnActivate > Namedbrick (Projspawn) > Spawnprojectile > Gunbullet (I like to change the size of the bullet to the smallest value, don't make it too big or it might hit multiple outcome [1x1] bricks).
Try it out to see if it works. If this was too confusing I can give you pictures or give you the save to a mystery box I've already made. You can also add a weapon cycle sequence like in COD where the box cycles through multiple weapons before giving the player their weapon. Let me know if you'd like help on that, it can also be done. Good luck with this.