Hey guys, just a quick question:
I’m brand new to Lua and have been trying to make a sound effect on a swep.
Can anyone draft me a sample of what I’m looking to achieve? I want to take a look at what you can make and learn from there.
What I’m looking to do:
Secondary attack of a swep needs to play server side music in a proximity from the player. But if you press it again it turns off the sound so it’s not annoying.
So basically when you use the secondary attack it’s like turning a sound on and off and if players are in range they can either hear it at max volume, or as they get closer it gets louder.
Is this possible?
Secondary Attack Emits sound at Weapon/Player (the sound follows the player around)
Secondary Attack while sound is playing turns off Sound
Proximity Sound is a bonus
I don’t have a rough draft because I have no idea how to begin this other than the basic Secondary attack sequence.