Start off by opening up a small test map and put a propdynamic in there and name it itembox. Then open up the model browser and choose a hl2 box from there like so:
After place a weaponc4 where you want the bomb to spawn when they open the box and name it c4, remember you can change what you want to spawn by just changing the model like to a weaponak etc. Like so:
Thirdly place a pointTemplate under the weaponc4 and name it c4_Spawn, then go to the template one option and select c4 from the drop down list. Like so:
Finally add a button in nodraw texture where the handle is on the box, tick the flag dont move. Then in flags option add the following inputs:
On Pressed c4_spawn Force spawn
On Pressed item_box setanimation Open
On Pressed item_box setanimation Close After a delay of 2 seconds
Save and your done compile and test, remember if you want to spawn another weapon like anAK use weaponak instead of c4 an m4a1 would be weaponm4a1 and so on.
Thank you and please do not copy this tutorial to any other site without my permission.
Here is a map to see how its done if you find the tutorial confusing. ammo_box.vmf
Thank you, please comment and assess.














