make weapons do other things

how do i make the weapon do something else when i press the fire button?
eg if you want to do something for the scope or reload button its just 'function scopetoggle ()' or 'function reload()'
but what about the fire button?
eg if you want to do something for the scope or reload button its just 'function scopetoggle ()' or 'function reload()'
but what about the fire button?