• Reload Sounds dont work
    5 replies, posted
mmkay this is getting REAAALLLLYYY ANNOYING. about a month ago before the update, my reload sounds on my SWEP worked perfectly fine. now they dont even WORK! Can someone please tell me whats wrong with it? //General Variables\\ SWEP.AdminSpawnable = false SWEP.ViewModelFOV = 64 SWEP.ViewModel = "models/weapons/v_gm_smg.mdl" SWEP.WorldModel = "models/weapons/w_gm_smg.mdl" SWEP.AutoSwitchTo = false SWEP.Slot = 0 SWEP.HoldType = "smg" SWEP.PrintName = "Sweptest" SWEP.Author = "Kruel Kramer" SWEP.Spawnable = true SWEP.AutoSwitchFrom = false SWEP.FiresUnderwater = false SWEP.Weight = 5 SWEP.DrawCrosshair = true SWEP.Category = "My Swep" SWEP.SlotPos = 0 SWEP.DrawAmmo = true SWEP.ReloadSound = Sound ("weapons/ngm_smg/ngm_smg_reload.wav")--DOES NOT --WORK AHHH! SWEP.Instructions = "Shoot" SWEP.Contact = "none" SWEP.Purpose = "lols" SWEP.base = "weapon_base" //General Variables\\ //Primary Fire Variables\\ SWEP.Primary.Sound = ("weapons/ngm_smg/nsmg_shot.wav") SWEP.Primary.Damage = 2 SWEP.Primary.TakeAmmo = 1 SWEP.Primary.ClipSize = 50 SWEP.Primary.Ammo = "pistol" SWEP.Primary.DefaultClip = 250 SWEP.Primary.Spread = 0.4 SWEP.Primary.NumberofShots = 1 SWEP.Primary.Automatic = true SWEP.Primary.Recoil = 0.1 SWEP.Primary.Delay = 0.05 SWEP.Primary.Force = 20 //Primary Fire Variables\\ //Secondary Fire Variables\\ SWEP.Secondary.NumberofShots = 0 SWEP.Secondary.Force = 0 SWEP.Secondary.Spread = 0 SWEP.Secondary.Sound = "Weapon_Pistol.Single" SWEP.Secondary.DefaultClip = 0 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "Pistol" SWEP.Secondary.Recoil = 0 SWEP.Secondary.Delay = 0 SWEP.Secondary.TakeAmmo = 0 SWEP.Secondary.ClipSize = 0 SWEP.Secondary.Damage = 0 function SWEP:Initialize() util.PrecacheSound(self.Primary.Sound) util.PrecacheSound(self.Secondary.Sound) self:SetWeaponHoldType( self.HoldType ) end function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end local bullet = {} bullet.Num = self.Primary.NumberofShots bullet.Src = self.Owner:GetShootPos() bullet.Dir = self.Owner:GetAimVector() bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0) bullet.Tracer = 0 bullet.Force = self.Primary.Force bullet.Damage = self.Primary.Damage bullet.AmmoType = self.Primary.Ammo local rnda = self.Primary.Recoil * -1 local rndb = self.Primary.Recoil * math.random(-1, 1) self:ShootEffects() self.Owner:FireBullets( bullet ) self.Weapon:EmitSound(Sound(self.Primary.Sound)) self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ) self:TakePrimaryAmmo(self.Primary.TakeAmmo) self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay ) end function SWEP:SecondaryFire() return false end someone PLEASE tell me HOW I FIX THIS?
I cant even start to tell you how wrong this ..erm..script.. is.
well it cant be THAt wrong, cosidering it works perfectly except for the reload sound
Use lua tags next time. Are you sure the sound actually exists?
Definately sure. [editline]09:16PM[/editline] Found a Fix. put Self.EmitSound into the Function SWEP:Reload() and we were all good. thanks for the help!
[lua]SWEP.ReloadSound = Sound ("weapons/ngm_smg/ngm_smg_reload.wav")[/lua] should be [lua]SWEP.ReloadSound = Sound ("ngm_smg/ngm_smg_reload.wav")[/lua] but okay.
Sorry, you need to Log In to post a reply to this thread.