(First of all, please note that this map is being made for Half-Life 2, not GMod specifically) I've almost made a fully functioning CoD zombies mystery box. It spawns a random weapon upon use and even plays the little jingle :3. However, there is a pretty big problem that I haven't figured out how to solve yet. For the real mystery box, the weapon will eventually disappear if you do not take it. My mystery box keeps the weapon in place until it is taken. So if the box spawns a crowbar or a weapon that the player already has the maximum amount of ammo for, the weapon stays in place. This causes two problems: The weapon occasionally jams the box lid and causes the box to lock up, even with "force close" on (the lid is a func_rotating_door). Second, if the box does continue to work, the next weapon that comes out often collides with the first one, causing them to infinitely bang together, creating particles, which lag the game, and loud sounds (though this problem isn't really that bad, it's much less than pleasant).
The only solution I could think of was to make an output that "killed" the weapon entity after a few seconds. Unfortunately, when that happens, the weapon completely stops spawning, resulting in the box often spawning nothing over time.