When I put 100 yen in the vending machine and pushed the button to buy a coffee, four whole cans came tumbling out all at once!

Literal

Vending-machine [at-で] coffee [object-を] buy-[volitional-おう][intention-と] 100-yen insert-[and-て] button [object-を] press-[past-たら], all-at-once 4-[counter-本][emphatic-も], [mimetic-どかどかと] came-falling-[come-てきた]!

An amused, surprised narration. ~おうと (volitional+quotative) marks the purpose/intent behind an action — 'with the intent of X-ing.' ~たら conditional for 'when/if.' どかどか is a mimetic for multiple heavy objects dropping or clattering. ~本 is the counter for long cylindrical objects like cans, bottles, sticks. も after a number emphasizes surprise at the quantity. 落ちてくる uses ~てくる for motion toward the speaker's location.