Wondering how to make sweps shoot projectiles instead of bullets

I understand that this is probably a very nooby question, but I am kind of new to LUA scripting. I would like to start off by saying that I am not asking anyone to make a swep for me, just to point me in the right direction and/or link me to a page that would show me how to do so. I apologize if there is already a thread about this, but I have been searching for a little bit now and haven’t been able to find it. Basically, I’m trying to make a swep that shoots projectiles instead of bullets. I am looking to make two separate sweps: a rocket launcher that actually fires rockets and a machine gun similar to Doom’s plasma gun. Once again, I apologize if this has been asked before or if the solution is very obvious, but any help would be appreciated.

Edit: I have made a swep following the link that Ludicium posted. I cannot get the weapon to fire anything. It makes sounds and uses ammo, but fires nothing and deals no damage. If someone could look at my scripts to try and help me out I would be very thankful.

My weapon’s shared.lua http://pastebin.com/v9GqNJCU
My entity’s init.lua: http://pastebin.com/A48971EH
Its shared.lua: http://pastebin.com/6RvMTyme
And its cl_init.lua: http://pastebin.com/GtKFdZVZ

Projectiles are entities. Write the code for the entity IE what you want it to do when it is created, what model it is, etc. Then have your swep create that entity.

Here is an example off garrysmod.org: http://www.garrysmod.org/downloads/?a=view&id=108587

Thank you, I will mess around with my sweps shortly.

check this out http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8e50.html