Look at a script of a weapon that has spread (wrong computer, cant copy the lines you need :S) like a shotgun or any weapon that has spread actually. In the end there should be a section about spread, that should not be hard to find... Then just copy those lines to your own weapon, modify to your liking and you should be fine.