How do I implement a COD type weapon system?

Have a look here:


Admittedly, it’s just one of many ways to do it.