Materials: Lego NXT kit (I do not know the specifics because I did not know what parts I was going to use beforehand).
Also this is difficult to explain so please use the images to supplement the explanations.
Step 1: Create Firing Arm
Step 2: Add Body
To make the gun longer, add 6 connector-sticks (long) to the end of the NXT device opposite the motor.
Step 3: Connect Body
Step 4: Extend the Body
Get 6 more connector sticks and 12 more connectors to attach to the body to extend it a bit further.
Step 5: Make the Trigger
Gather a touch sensor, four right-angle connectors and 8 blue connectors (they're double sided- so they have a different connector on each side). Put a blue connector in each hole in the right-angle connectors and attach them to the touch sensor.
Step 6: Attach Trigger
Step 7: Extend the Trigger
Step 8: Attach Trigger Extension
Place the long stick through the middle of the body (in front of the touch sensor) and attach the blue connectors to the body. Then put a gear on the long stick in front of the touch sensor and a gray cap on the end.
Step 9: Attach Touch Sensor to Body
Step 10: Add Butt of Gun
Find two connector-sticks 9 holes long, two right-angle connectors, 4 blue connectors, a 3 hole connector-stick, and two black connectors. Put the blue connectors in both ends of both right-angle connectors and attach them to one end of the right long connector-sticks. Then attach the short connector-stick to the opposite end to hold the long sticks together. Then attach the right-angle connectors to the 3 hole sticks on the body of the gun.
Step 11: Connect Motor to NXT Device
Step 12: Start the Clip
Step 13: Make Firing Base
Attach three 9-hole sticks perpendicular to the motor using black connectors. Then attach three 13-hole sticks to the end of the 9-hole sticks facing to the left of the motor. Then attach three 15-hole sticks to the end of the 13-hole sticks facing the back of the gun.
Step 14: Build Platform for Clip
Step 15: Continue Clip
Attach a 15-hole stick to the center stick of the clip at the same height as the center stick. Attach two side sticks at the same height as the other side sticks. These side sticks however, will come down to the same height as the center stick (the center stick will be higher at the top, but they will all be even at the bottom, so the side sticks will be shorter). Attach a few sticks to the side of the clip to close it off and keep parts from falling out.
Step 16: Attach the Clip
Attach the platform of the clip the the 3-sided base you made earlier. If it is placed on the side it will shoot forward, and if it is on the front it will shoot sideways (good for around corners). Make sure that it is the correct distance from the arm so that it reaches the ammo but does not get stuck.
Step 17: Make the Pin
Step 18: Clip Support
Step 19: Program the Robot
Step 20: Final Product
This is the result. A fully automatic Lego machine gun.