How would you do multiple firing sounds for certain weapons?

I’ve been working on a Half-Life 2 roleplay server recently, and I’ve been trying to code up an OICW that has multiple firing sounds instead of one.
However, I’m always running into LUA errors or it just plays one firing sound. Any help would be appreciated!
Thanks.

Okay, what do you want us to do? Try to guess somehow what errors do you get?

Nah. I’m just more or less looking for suggestions. I’ve managed to get rid of the LUA errors, but it’s only playing one firing sound unless I right click.

Use the file path to the weapons sound directory and math.random to randomly select the sound to be played.

Thanks, I’ll try that out.



local sounds = {"1.wav", "2.wav", "3.wav"}
local count = #sounds

-------
Entity(1):EmitSound(sounds[math.random(count)])


This one worked for me, thanks!