Step 1: Place an object (ammo crate usually). Place: null = [this] execVM "virtual_arsenal_init.sqf"; in the init line of the box.
In virtual_arsenal_init.sqf , put:
_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal
_availableItems = [
"Item_bipod_01_F_blk",
"optic_Hamr" //to show that a custom weapon attachment can be added.
];
[_crate,(_availableItems)] call BIS_fnc_addVirtualItemCargo;