Reload Sounds dont play

Whats the code for reload sounds? Also primary fire wont play, whys this?


-- Read the weapon_real_base if you really want to know what each action does

if (SERVER) then
	AddCSLuaFile("shared.lua")
	SWEP.HoldType 		= "pistol"
end

if (CLIENT) then
	SWEP.PrintName 		= "GLOCK 18 SILENCED"
	SWEP.ViewModelFOV		= 70
	SWEP.Slot 			= 3
	SWEP.SlotPos 		= 1
	SWEP.IconLetter 		= "Q"

	killicon.AddFont("weapon_real_cs_glock", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ))
end

/*---------------------------------------------------------
Muzzle Effect + Shell Effect
---------------------------------------------------------*/
SWEP.MuzzleEffect			= "rg_muzzle_highcal" -- This is an extra muzzleflash effect
-- Available muzzle effects: rg_muzzle_grenade, rg_muzzle_highcal, rg_muzzle_hmg, rg_muzzle_pistol, rg_muzzle_rifle, rg_muzzle_silenced, none

SWEP.ShellEffect			= "rg_shelleject" -- This is a shell ejection effect
-- Available shell eject effects: rg_shelleject, rg_shelleject_rifle, rg_shelleject_shotgun, none

SWEP.MuzzleAttachment		= "1" -- Should be "1" for CSS models or "muzzle" for hl2 models
SWEP.ShellEjectAttachment	= "2" -- Should be "2" for CSS models or "1" for hl2 models

SWEP.EjectDelay			= 0.05
/*-------------------------------------------------------*/

SWEP.Instructions 		= "Damage: 35% 
Recoil: 20% 
Precision: 66% 
Type: Semi-Automatic"

SWEP.Base 				= "weapon_real_base_pistol"

SWEP.Spawnable 			= true
SWEP.AdminSpawnable 		= true

SWEP.ViewModel 			= "models/weapons/v_pist_unsil19.mdl"
SWEP.WorldModel 			= "models/weapons/w_pist_unsil19.mdl"

SWEP.Primary.Sound 		= Sound("glock.Single")
SWEP.Primary.Recoil 		= 3.2
SWEP.Primary.Damage 		= 35
SWEP.Primary.NumShots 		= 1
SWEP.Primary.Cone 		= 0.021
SWEP.Primary.ClipSize 		= 21
SWEP.Primary.Delay 		= 0.1
SWEP.Primary.DefaultClip 	= 20
SWEP.Primary.Automatic 		= false
SWEP.Primary.Ammo 		= "pistol"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip 	= -1
SWEP.Secondary.Automatic 	= false
SWEP.Secondary.Ammo 		= "none"

SWEP.IronSightsPos 		= Vector (5.1489, -4.2492, 2.6844)
SWEP.IronSightsAng 		= Vector (0.2289, 0.0109, 0)

Your primary sound is not working because you have an improper name for the sound.
Change


SWEP.Primary.Sound 		= Sound("glock.Single")

to


SWEP.Primary.Sound 		= Sound("weapons/Sound'sLocation/SoundName.wav")

If it’s the default CSS glock sound that you want though, then change “(“glock.Single”)” to “(“Weapon_Glock.Single”)”.

As for a reload sound, you either need to make a custom script which I can’t help you with as I don’t use them. Or you can use audacity and link the reload sounds together into one sound file. Then to put that in you would stick this code in at the bottom of the Shared.lua


function SWEP:Reload()

	self.Weapon:DefaultReload(ACT_VM_RELOAD) 
	-- Animation when you're reloading

	if ( self.Weapon:Clip1() < self.Primary.ClipSize ) and self.Owner:GetAmmoCount(self.Primary.Ammo) > 0 then
	-- When the current clip < full clip and the rest of your ammo > 0, then

		self.Owner:SetFOV( 0, 0.15 )
		-- Zoom = 0

		self:SetIronsights(false)
		-- Set the ironsight to false
self.Weapon:EmitSound("weapons/Sound'sLocation/Sound'sName.wav")
end
	
end

And just change “(“weapons/Sound’sLocation/Sound’sName.wav”)” to your weapon’s linked together reload sound. That piece of code should work, not sure if it will though.

New problem. When I hexed the model its an error. I named it unsil19 as the model path shows but it wont work, and whats audacity and where can i get it?

http://audacity.sourceforge.net/ - Audacity is a sound editing program.

And did you just change the model names or did you open up the view model and world model with Xvi32 or some other hexing program?

I used XVI32 and thanks for the link.