Garry's Mod

Garry's Mod

View Stats:
Question about making a SWEP
Hey guys, I need some help, ideally from someone who knows what they're talking about.

I'm making my first SWEP, and it's pretty basic. I'm trying to change the shootsound, but it isn't working properly. I'd like someone to please look at my code real quick and tell me what I'm doing incorrectly.

local ShootSound = Sound("X.wav") //this is my cached sound
SWEP.Primary.Sound = Sound("X")


This is not working for me. I've read the wiki pretty carefully, and I'd sincerely thank you for some guidance. Not asking you to write it for me.

Thanks !
Last edited by The Big Burrito; May 31, 2015 @ 8:57pm
< >
Showing 1-6 of 6 comments
PassTheMayo May 31, 2015 @ 9:40pm 
I dont understand this type of code but look up a tutorial on YouTube. Most people show a step-by-step tutorial on how to add sound to a swep.
The Big Burrito May 31, 2015 @ 10:04pm 
I can add sounds from HL2/CS/TF2 no issue, I just cant import a sound. I looked up some tutorials, but I wonder if I'm missing a step. Since I posted this, my code has gotten a lot bigger/ more correct i think, but I still can't import sounds.
roguex100 May 31, 2015 @ 11:11pm 
What do you have in your primary attack code? There should be something like:

self.Weapon:EmitSound(self.Primary.Sound)

If you already have that, make sure your sound file path is correct and that its compatible with gmod.
The Big Burrito Jun 1, 2015 @ 12:35am 
Thanks! That's what I was missing ... Feel kinda stupid
roguex100 Jun 1, 2015 @ 12:50am 
np, I know from experience that lua is kinda tough to get into at first, good luck with your SWEP.
The Big Burrito Jun 1, 2015 @ 1:08am 
I am pretty new to coding in general, but I figured - if I have played gmod for 1k hours, I should probably contribute something back after all the fun I've had, made possible by other community members. Plus there seems to be a bit of a content slump, so I hope I can have some success with this ~
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: May 31, 2015 @ 8:57pm
Posts: 6