this is a lego gumball machine.
Step 1: Lego Gumball Machine
I made an animation. Click on the thingy to run it. Pause it for each step. Also, near the end there is a picture of every piece I used. You don't need to do the exact same thing, or use the same colors, but I thought it might help.
It takes (U.S.) nickels, and rejects all (U.S.) coins smaller than that.
To use it, put a nickel in the slot in the side, and pull (gently) on the lever in back. A gumball will roll out of the front.