Custom Sound Issue

Please help me. Look at the first self:EmitSound. What is wrong with this? And I always get the error that the sound file can’t be found. Where do I put the .wav and how do I do self:EmitSound? Thanks.


function SWEP:PrimaryAttack() 

	if self.Weapon:Clip1() == 0 then
		self:Reload()
	end
    if ( !self:CanPrimaryAttack() ) then return end 
    self:EmitSound( "garrysmod/sound/kamehameha.wav", 100, 100, 1, CHAN_WEAPON )
 
	timer.Create( "timer1", 2.5, 1, function()
    		if ( !self:CanPrimaryAttack() ) then return end
    			self:EmitSound( "path/to/sound/wav", 75, 100, 1, CHAN_AUTO )
    	timer.Create( "timer2", 0.005, 300, function()
    		if ( !self:CanPrimaryAttack() ) then return end
       			local bullet = {} 
       			bullet.Num = 1
        		bullet.Src = self.Owner:GetShootPos() - Vector(0,0,20)
        		bullet.Dir = self.Owner:GetAimVector()
        		bullet.Tracer = 2
        		bullet.TracerName = "ToolTracer"
        		self:TakePrimaryAmmo( 1 )
   			self.Owner:FireBullets( bullet ) 
	
    		end)
	end)

    self:SetNextPrimaryFire( CurTime() + 1 )
    self:SetNextSecondaryFire( CurTime() + 1 )
    
    
end

Can someone please help?

I think the path to the sound is already relative to /sound/.

You’ll need to place the file in /garrysmod/sound.
If you need to add this to FastDL for clients to download when they join a server:


resource.AddFile("sound/path/to/sound.mp3")

will make them automatically download it. The sound file must be in the server’s sound directory too and sv_allowdownload must be set to 1 in server.cfg.