Nerf Gun Basics
Nerf guns all work by the same basic principle. Air pressure is generated in the gun and released behind a Nerf projectile, propelling the projectile at a chosen target. In order to apply this principle to a working design you'll need three primary parts to your gun, a pressure chamber, a pump and a trigger mechanism attached to a barrel containing your Nerf projectile.
Pressure Chamber
The pressure chamber is the most important part of the gun design. It stores the air pressure that provides the momentum behind your projectile. The force behind your Nerf projectile is directly dependent on how much pressure you can generate in the pressure chamber. The greater the pressure, the greater the force, which directly translates into greater speed and distance for your projectile.
Because of the force generated in the pressure chamber, it's important to construct the chamber using materials strong enough to survive the pressure. You can create a pressure chamber from any airtight material. A plastic soda bottle can contain sufficient air pressure to make an effective chamber, for greater pressure, PVC material works quite well and is strong enough to contain any pressure you're likely to generate using a hand pumping system. The larger your pressure chamber the greater the possible pressure, so in order to limit the force of the projectile go with a smaller chamber.
Pump
The pump is used to create the pressure in the pressure chamber prior to firing the Nerf projectile. You can use a pump with a sliding plunger and rod setup for your homemade Nerf gun, either connecting the pump directly to your pressure chamber, or applying the air through a hose connected to the chamber. To keep the pumped air going into the chamber only when using the pump, you should utilize a one way valve to seal the chamber and pump setup. You can use a small bicycle pump for your homemade Nerf gun, modifying the hose for length as needed.
Trigger Mechanism
The trigger mechanism for your Nerf gun should simply be a valve, such as a ball valve, that releases the air from your pressure chamber into a direction of your choice. Attach it to a barrel containing a Nerf projectile and you have a working Nerf gun. The barrel can be of any length you choose, though longer barrels tend to increase accuracy while requiring more air pressure to fire your projectile.
Assembly
Assembling the parts is just a matter of finding a body form you like, and attaching the main elements to it. Attach the pump to the pressure chamber, and then attach the pressure chamber with trigger valve to the barrel. When you put the projectile into the barrel, just pump the air into the chamber, aim the barrel and fire it by releasing the pressure using the trigger valve. You can find all the materials necessary for building a homemade Nerf gun in your local hardware or home improvement store.