>>275247124
You can toss magazines into the slots of the vending machines to buy stuff from them. Most of the time they're useless and you'll find a weapon within 5 minutes of starting a level anyway, but there are exclusive items you can only find in them.
The final vending machine has the dev weapons in it (gravity gun, spawn menu for campaign, jetpack gun, power fist, and suction cups), which you will probably be unable to buy the first time around. Ammo count is based on all of your high scores from previous levels added together, so for the good shit you're going to have to melee as much as possible and find all the hidden ammo crates.