this is a lego gumball machine. I will show how the mechanism works. You can use the mechanism in your own gumball machines.
Step 1: Just Showing the Button
Pretty much the way this machine works is: once you put in a quarter and push the button, a gumball comes out, and the quarter drops into a coin bank.
Step 2: Showing How It Works With 3 Pictures. (and Lots of Words)
The big thing of flat tiles is a container to hold the gumball. It has a platform of flat tiles under it, so it slides freely. There is a brick hanging down. When you push the button without a coin, nothing happens. When you push it with the coin, it extends the reach of the button. This slides the quarter into a coin bank, at the same time pushing the hanging down brick. This moves the whole apparatus, and pulls the gumball over a hole. The gumball falls down onto a ramp, and the ramp pushes the gumball out the front. This was probably very confusing.