Weapon sound problem...

Hello all !
I’ve got a little problem with my Melee Weapon pack !
The sound won’t work in-game…
I look the directory path, it’s ok…
All the code is ok, I don’t know why he won’t play the sound…
Here is the code, if someone can help me, thanks !

if ( SERVER ) then
AddCSLuaFile( “shared.lua” )
AddCSLuaFile( “cl_init.lua” )
SWEP.HoldType = “crowbar”
end

if ( CLIENT ) then
SWEP.Category = “Melee Pack”
SWEP.PrintName = “Bat”
SWEP.Author = “Banana[FR] for lua, don’t know for the axe xDD”
SWEP.ViewModelFOV = “64”
SWEP.Slot = 2
SWEP.Slotpos = 2
SWEP.CSMuzzleFlashes = true
end

SWEP.HoldType = “crowbar”

function SWEP:Precache()
util.PrecacheSound(“weapons/bat/batslash.wav”)
util.PrecacheSound(“weapons/ar_impact.wav”)
util.PrecacheModel(“models/weapons/v_axelulz.mdl”)
util.PrecacheModel(“models/weapons/w_crowbar.mdl”)
end

SWEP.data = {}
SWEP.data.newclip = false

SWEP.Spawnable = true
SWEP.AdminSpawnable = false

SWEP.ViewModel = “models/weapons/v_basebat.mdl”
SWEP.WorldModel = “models/weapons/w_basebat.mdl”
SWEP.ViewModelFlip = false

SWEP.Drawammo = true
SWEP.DrawCrosshair = false

SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false

SWEP.Primary.Sound = Sound( “weapons/bat/batslash.wav” )
SWEP.Primary.Recoil = 0
SWEP.Primary.Damage = 60
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0
SWEP.Primary.ClipSize = 1
SWEP.Primary.Delay = 0.8
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = “none”

SWEP.Secondary.Delay = 600
SWEP.Secondary.Recoil = 0
SWEP.Secondary.Damage = 80
SWEP.Secondary.NumShots = 1
SWEP.Secondary.Cone = 0
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”

function SWEP:Initialize()
if (SERVER) then
self:SetWeaponHoldType(self.HoldType)
end
end

function SWEP:PrimaryAttack()
self.Weapon:SetNextPrimaryFire(CurTime() + 0.75)
if SERVER then self.Owner:EmitSound(Sound(“weapons/ar_impact.wav”)) end
if SERVER then self.Owner:EmitSound(Sound(“weapons/bat/batslash.wav”)) end
local ang = self.Owner:GetAimVector()
local spos = self.Owner:GetShootPos()

local trace = {}
trace.start = spos
trace.endpos = spos + (ang * 90)
trace.filter = self.Owner

local tr = util.TraceLine(trace)

if tr.HitNonWorld then
	local bullet = {}
	bullet.Num= 1
	bullet.Src = self.Owner:GetShootPos()
	bullet.Dir= self.Owner:GetAimVector()
	bullet.Spread = Vector(0.15,0.15,0.15)
	bullet.Tracer = 0
	bullet.Force = 1
	bullet.Damage = 60
	self.Owner:FireBullets(bullet)
	self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
	self.Owner:SetAnimation( PLAYER_ATTACK1 )

elseif tr.HitWorld then
	local bullet = {}
	bullet.Num= 1
	bullet.Src = self.Owner:GetShootPos()
	bullet.Dir= self.Owner:GetAimVector()
	bullet.Spread = Vector(0.15,0.15,0.15)
	bullet.Tracer = 0
	bullet.Force = 1
	bullet.Damage = 60
	self.Owner:FireBullets(bullet)
	self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
elseif !tr.Hit then
	self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER)
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
	end

end

function SWEP:SecondaryAttack()
self.Weapon:SetNextSecondaryFire(CurTime() + 0.65)
if SERVER then self.Owner:EmitSound(Sound(“weapons/ar_impact.wav”)) end
if SERVER then self.Owner:EmitSound(Sound(“weapons/bat/batslash.wav”)) end
local ang = self.Owner:GetAimVector()
local spos = self.Owner:GetShootPos()

local trace = {}
trace.start = spos
trace.endpos = spos + (ang * 90)
trace.filter = self.Owner

local tr = util.TraceLine(trace)

if tr.HitNonWorld then
	local bullet = {}
	bullet.Num= 1
	bullet.Src = self.Owner:GetShootPos()
	bullet.Dir= self.Owner:GetAimVector()
	bullet.Spread = Vector(0.15,0.15,0.15)
	bullet.Tracer = 0
	bullet.Force = 5
	bullet.Damage = 80
	self.Owner:FireBullets(bullet)
	self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
	self.Owner:SetAnimation( PLAYER_ATTACK1 )

elseif tr.HitWorld then
	local bullet = {}
	bullet.Num= 1
	bullet.Src = self.Owner:GetShootPos()
	bullet.Dir= self.Owner:GetAimVector()
	bullet.Spread = Vector(0.15,0.15,0.15)
	bullet.Tracer = 0
	bullet.Force = 5
	bullet.Damage = 80
	self.Owner:FireBullets(bullet)
	self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
elseif !tr.Hit then
	self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER)
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
	end

end


(User was banned for this post ("Wrong section" - mahalis))

The syntax for emitsound is this

[lua]
entity:EmitSound(“Path/To/Sound.wav”, 500, 200)

[/lua]

For example this

[lua]
if SERVER then self.Owner:EmitSound(Sound(“weapons/ar_impact.wav”)) end
[/lua]

Would be this

[lua]
if SERVER then self.Owner:EmitSound(“sound/ar_impact.wav”, 100, 100) end
[/lua]

Except I think that you would have to put the sound in the sound folder, someone else will know :smiley: