Playing sounds using the animation event - CapsAdmin/pac3 GitHub Wiki
So, I heard you want to add a sound when you do something special, right? Then you came to the right place! Listen carefully...
Adding a sound part and specifying the sound you want it to play
In this case, we'll be making a sound play when we attack/shoot with our custom weapon. First, right click the model part of your custom weapon, like a shovel model replacing the crowbar's and click sound.
Now, take a look at all these properties... I recommend not touching them, apart of the name, description and sound property. For more information, take a look at this page. The most interesting property is "sound". Inside it, you put the filepath of the sound that will be played on attack/shoot. (ex: /weapons/crowbar/crowbar_impact2.wav) To find correct sound filepaths, the easiest way is to have Wiremod and knowing how to open the console. I'll assume you have Wire and you know how to open the console. We'll look for a pistol shoot sound. In the console, type (without apostrophes) "wire_sound_browser_open". It'll open a sound browser.
In the sound browser, double click weapons, then pistol. There, you find sound files. Click "# pistol_fire2.wav".
See that text below? You find the sound file's infos. Especially the filepath, and the sound length in seconds. We'll use the sound length later. Select the filepath, and copy it using CTRL+C. Now, get back to PAC and paste the filepath in the sound part's sound property using CTRL+V.
Now, you're done with the first part of the tutorial. Get ready...
Making it play on attack/shoot
Assuming your event, and sound, are set up in the way you desire, you'll want to select the "event" property of the event, and either type in "animation_event" or alternatively click the triple dots on the right hand side of the selection area, and select "animation_event" drop the menu that appears.
Afterwards, select "arguments" and input "attack primary@@" or alternatively repeat the same with the prior selection however you'll want to type in "attack primary" in the lower field and either double click the number in the menu and manually type the sounds' length in seconds, or click+drag the number up or down as an easier though less accurate way of setting the events' length. Once the event, and argument (we won't touch the Operator, as "find simple" is often best in this case just incase ) are done, ensure "invert" has been ticked so the event UNHIDES the sound when you fire, rather than hiding it when you fire then unhiding after the timer runs out for the events' length.
After all of the above have been completed, while still wielding the weapon you're intending to reskin, click Tools, then move your mouse over Show only with active weapon, and click either Hide or Show weapon, according to your own preferences. This prevents the sound from playing with any weapon other than the one you desire it to play with.
All of the same actions may be recycled for Reloading sounds as well, however that would simply use "reload" rather than "attack primary".