So you are looking for a simple robot to build for Halloween? JK Brickworks’ latest robot is worth a shot. This LEGO Halloween Candy Throwing Robot recognizes when someone is near and throws a chocolate bar or candy. A LEGO Mindstorms EV3 31313 kit was used to build this.
As the developer explains, the chocolates are pushed out using a simple piston arm. An infrared sensor is used to detect when something is in front of the machine.
[Source]