Charge shot code

I’m planning on doing a custom SWEP in Gmod, and I need to know how I’d make it able to charge a shot up and hold it, like the plasma pistol.