When you have no idea where to start, a good thing to do is look at another add-on that does something similar. In this case, find a weapon with an alt fire function. Ideally, a simple one, like firing an attached grenade launcher or something, that way you don't mix it up with any other features.