Read in game instructions. Replace the script in the gun sprite telling it to move to mouse x and mouse y to your character sprites x and y position.
Sound credit to scratch team and soundbible.com No need for credit if used but please link your project or game here if you use this gun or any of its scripts.