Grapple Hook - Removing The Sound

Hello, I’m having trouble getting rid of the sound the gapplehook makes when you shoot it.

Here is what I have:


if SERVER then
	CreateConVar("grapple_distance", 10000, false) // dont edit this
	AddCSLuaFile( "shared.lua" )
end

if CLIENT then
   SWEP.PrintName = "Grapple Hook"
   SWEP.Slot      = 7 -- add 1 to get the slot number key

   SWEP.ViewModelFOV  = 72
   SWEP.ViewModelFlip = false
end

SWEP.Base				= "weapon_tttbase"

if CLIENT then
	function SWEP:CustomAmmoDisplay()
		self.AmmoDisplay = self.AmmoDisplay or {}
		//attempt to remove ammo display
		self.AmmoDisplay.Draw = false
	
		self.AmmoDisplay.PrimaryClip 	= 1
		self.AmmoDisplay.PrimaryAmmo 	= -1
		self.AmmoDisplay.SecondaryAmmo 	= -1
	
		return self.AmmoDisplay
	end

	function SWEP:SetWeaponHoldType( t )
		// Just a fake function so we can define 
		// weapon holds in shared files without errors
	end
end

SWEP.Spawnable			= false
SWEP.AdminSpawnable		= false
SWEP.DrawAmmo			= false
SWEP.DrawCrosshair		= false
SWEP.ViewModel			= "models/weapons/v_crossbow.mdl"
SWEP.WorldModel			= "models/weapons/w_crossbow.mdl"

local sndPowerUp		= Sound("none")
local sndPowerDown		= Sound("none")
local sndTooFar			= Sound("none")
local sndShot			= Sound("none")
local sndPowerUp		= Sound("none")
local sndPowerDown		= Sound("none")
local sndTooFar			= Sound("none")
local sndShot			= Sound("none")

SWEP.Kind = WEAPON_EQUIP1
SWEP.AutoSpawnable = false
SWEP.AmmoEnt = "none"
SWEP.CanBuy = { ROLE_TRAITOR, ROLE_DETECTIVE } -- Remove ROLE_DETECTIVE or ROLE_TRAITOR to make it show only for traitor or detectives.
SWEP.InLoadoutFor = nil
SWEP.LimitedStock = true
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = true

if CLIENT then
   -- Path to the icon material
   SWEP.Icon = "VGUI/ttt/ICONNAMEHERE" -- Replace with your own dont have one sorry :@

   -- Text shown in the equip menu
   SWEP.EquipMenuData = {
      type = "Weapon",
      desc = "Its a grappling hook."
   };
end

if SERVER then
   resource.AddFile("materials/VGUI/ttt/ICONNAMEHERE.vmt")
end

function SWEP:Initialize()

	nextshottime = CurTime()
	self:SetWeaponHoldType( "smg" )
	
end

function SWEP:Think()

	if (!self.Owner || self.Owner == NULL) then return end
	
	if ( self.Owner:KeyPressed( IN_ATTACK ) ) then
	
		self:StartAttack()
		
	elseif ( self.Owner:KeyDown( IN_ATTACK ) && inRange ) then
	
		self:UpdateAttack()
		
	elseif ( self.Owner:KeyReleased( IN_ATTACK ) && inRange ) then
	
		self:EndAttack( true )
	
	end
	
	//Changed from KeyDown to prevent random stuck-in-zoom bug.
	if ( self.Owner:KeyPressed( IN_ATTACK2 ) ) then
	
		self:Attack2()
		
	end

end

function SWEP:DoTrace( endpos )
	local trace = {}
		trace.start = self.Owner:GetShootPos()
		trace.endpos = trace.start + (self.Owner:GetAimVector() * 14096) //14096 is length modifier.
		if(endpos) then trace.endpos = (endpos - self.Tr.HitNormal * 7) end
		trace.filter = { self.Owner, self.Weapon }
		
	self.Tr = nil
	self.Tr = util.TraceLine( trace )
end

function SWEP:StartAttack()
	//Get begining and end poins of trace.
	local gunPos = self.Owner:GetShootPos() //Start of distance trace.
	local disTrace = self.Owner:GetEyeTrace() //Store all results of a trace in disTrace.
	local hitPos = disTrace.HitPos //Stores Hit Position of disTrace.
	
	//Calculate Distance
	//Thanks to rgovostes for this code.
	local x = (gunPos.x - hitPos.x)^2;
	local y = (gunPos.y - hitPos.y)^2;
	local z = (gunPos.z - hitPos.z)^2;
	local distance = math.sqrt(x + y + z);
	
	//Only latches if distance is less than distance CVAR
	local distanceCvar = GetConVarNumber("grapple_distance")
	inRange = false
	if distance <= distanceCvar then
		inRange = true
	end
	
	if inRange then
		if (SERVER) then
			
			if (!self.Beam) then //If the beam does not exist, draw the beam.
				//grapple_beam
				self.Beam = ents.Create( "trace1" )
					self.Beam:SetPos( self.Owner:GetShootPos() )
				self.Beam:Spawn()
			end
			
			self.Beam:SetParent( self.Owner )
			self.Beam:SetOwner( self.Owner )
		
		end
		
		self:DoTrace()
		self.speed = 10000 //Rope latch speed. Was 3000.
		self.startTime = CurTime()
		self.endTime = CurTime() + self.speed
		self.stufff = -1
		
		if (SERVER && self.Beam) then
			self.Beam:GetTable():SetEndPos( self.Tr.HitPos )
		end
		
		self:UpdateAttack()
		
		self.Weapon:EmitSound( sndPowerDown )
	end
	self.Weapon:EmitSound( sndPowerUp )
end

function SWEP:UpdateAttack()

	self.Owner:LagCompensation( true )
	
	if (!endpos) then endpos = self.Tr.HitPos end
	
	if (SERVER && self.Beam) then
		self.Beam:GetTable():SetEndPos( endpos )
	end

	lastpos = endpos
	
	
			if ( self.Tr.Entity:IsValid() ) then
			
					endpos = self.Tr.Entity:GetPos()
					if ( SERVER ) then
					self.Beam:GetTable():SetEndPos( endpos )
					end
			
			end
			
			local vVel = (endpos - self.Owner:GetPos())
			local Distance = endpos:Distance(self.Owner:GetPos())
			
			local et = (self.startTime + (Distance/self.speed))
			if(self.stufff != 0) then
				self.stufff = (et - CurTime()) / (et - self.startTime)
			end
			if(self.stufff < 0) then
				self.Weapon:EmitSound( sndPowerUp )
				self.stufff = 0
			end
			
			if(self.stufff == 0) then
			zVel = self.Owner:GetVelocity().z
			vVel = vVel:GetNormalized()*(math.Clamp(Distance,0,7))
				if( SERVER ) then
				local gravity = GetConVarNumber("sv_Gravity")
				vVel:Add(Vector(0,0,(gravity/100)*1.5)) //Player speed. DO NOT MESS WITH THIS VALUE!
				if(zVel < 0) then
					vVel:Sub(Vector(0,0,zVel/100))
				end
				self.Owner:SetVelocity(vVel)
				end
			end
	
	endpos = nil
	
	self.Owner:LagCompensation( false )
	
end

function SWEP:EndAttack( shutdownsound )
	
	if ( shutdownsound ) then
		self.Weapon:EmitSound( sndPowerDown )
	end
	
	if ( CLIENT ) then return end
	if ( !self.Beam ) then return end
	
	self.Beam:Remove()
	self.Beam = nil
	
end

function SWEP:Attack2() //Zoom.
			
//	self.Weapon:EmitSound( self.Secondary.Sound, 50, 100 )
	if (CLIENT) then return end
		local CF = self.Owner:GetFOV()
		if CF == 90 then
			self.Owner:SetFOV(30,.3)
		elseif CF == 30 then
			self.Owner:SetFOV(90,.3)
//			self.Scope = true
//		elseif CF == 0 then
//			self.Owner:SetFOV(90,.3)
	end
end

function SWEP:Holster()
	self:EndAttack( false )
	return true
end

function SWEP:OnRemove()
	self:EndAttack( false )
	return true
end


function SWEP:PrimaryAttack()
end

function SWEP:SecondaryAttack()
end

I have tried putting – in front of the local snd and replacing the sound with none but the sound still won’t go away! Any ideas?

Comment the lines where it actually plays the sound. Like:
[lua]–self.Weapon:EmitSound( sndPowerDown )[/lua]

or remove it

I can’t seem to be getting it to work.
Here is what I have:



if SERVER then
	CreateConVar("grapple_distance", 10000, false) // dont edit this
	AddCSLuaFile( "shared.lua" )
end

if CLIENT then
   SWEP.PrintName = "Grapple Hook"
   SWEP.Slot      = 7 -- add 1 to get the slot number key

   SWEP.ViewModelFOV  = 72
   SWEP.ViewModelFlip = false
end

SWEP.Base				= "weapon_tttbase"

if CLIENT then
	function SWEP:CustomAmmoDisplay()
		self.AmmoDisplay = self.AmmoDisplay or {}
		//attempt to remove ammo display
		self.AmmoDisplay.Draw = false
	
		self.AmmoDisplay.PrimaryClip 	= 1
		self.AmmoDisplay.PrimaryAmmo 	= -1
		self.AmmoDisplay.SecondaryAmmo 	= -1
	
		return self.AmmoDisplay
	end

	function SWEP:SetWeaponHoldType( t )
		// Just a fake function so we can define 
		// weapon holds in shared files without errors
	end
end

SWEP.Spawnable			= false
SWEP.AdminSpawnable		= false
SWEP.DrawAmmo			= false
SWEP.DrawCrosshair		= false
SWEP.ViewModel			= "models/weapons/v_crossbow.mdl"
SWEP.WorldModel			= "models/weapons/w_crossbow.mdl"

--local sndPowerUp		= Sound("none")
--local sndPowerDown		= Sound("none")
--local sndTooFar			= Sound("none")
--local sndShot			= Sound("none")
-- local sndPowerUp		= Sound("none")
-- local sndPowerDown		= Sound("none")
-- local sndTooFar			= Sound("none")
-- local sndShot			= Sound("none")

SWEP.Kind = WEAPON_EQUIP1
SWEP.AutoSpawnable = false
SWEP.AmmoEnt = "none"
SWEP.CanBuy = { ROLE_TRAITOR, ROLE_DETECTIVE } -- Remove ROLE_DETECTIVE or ROLE_TRAITOR to make it show only for traitor or detectives.
SWEP.InLoadoutFor = nil
SWEP.LimitedStock = true
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = true

if CLIENT then
   -- Path to the icon material
   SWEP.Icon = "VGUI/ttt/tg_grapple.vtf" -- Replace with your own dont have one sorry :@

   -- Text shown in the equip menu
   SWEP.EquipMenuData = {
      type = "Weapon",
      desc = "Its a grappling hook."
   };
end

if SERVER then
   resource.AddFile("materials/VGUI/ttt/ICONNAMEHERE.vmt")
end

function SWEP:Initialize()

	nextshottime = CurTime()
	self:SetWeaponHoldType( "smg" )
	
end

function SWEP:Think()

	if (!self.Owner || self.Owner == NULL) then return end
	
	if ( self.Owner:KeyPressed( IN_ATTACK ) ) then
	
		self:StartAttack()
		
	elseif ( self.Owner:KeyDown( IN_ATTACK ) && inRange ) then
	
		self:UpdateAttack()
		
	elseif ( self.Owner:KeyReleased( IN_ATTACK ) && inRange ) then
	
		self:EndAttack( true )
	
	end
	
	//Changed from KeyDown to prevent random stuck-in-zoom bug.
	if ( self.Owner:KeyPressed( IN_ATTACK2 ) ) then
	
		self:Attack2()
		
	end

end

function SWEP:DoTrace( endpos )
	local trace = {}
		trace.start = self.Owner:GetShootPos()
		trace.endpos = trace.start + (self.Owner:GetAimVector() * 14096) //14096 is length modifier.
		if(endpos) then trace.endpos = (endpos - self.Tr.HitNormal * 7) end
		trace.filter = { self.Owner, self.Weapon }
		
	self.Tr = nil
	self.Tr = util.TraceLine( trace )
end

function SWEP:StartAttack()
	//Get begining and end poins of trace.
	local gunPos = self.Owner:GetShootPos() //Start of distance trace.
	local disTrace = self.Owner:GetEyeTrace() //Store all results of a trace in disTrace.
	local hitPos = disTrace.HitPos //Stores Hit Position of disTrace.
	
	//Calculate Distance
	//Thanks to rgovostes for this code.
	local x = (gunPos.x - hitPos.x)^2;
	local y = (gunPos.y - hitPos.y)^2;
	local z = (gunPos.z - hitPos.z)^2;
	local distance = math.sqrt(x + y + z);
	
	//Only latches if distance is less than distance CVAR
	local distanceCvar = GetConVarNumber("grapple_distance")
	inRange = false
	if distance <= distanceCvar then
		inRange = true
	end
	
	if inRange then
		if (SERVER) then
			
			if (!self.Beam) then //If the beam does not exist, draw the beam.
				//grapple_beam
				self.Beam = ents.Create( "trace1" )
					self.Beam:SetPos( self.Owner:GetShootPos() )
				self.Beam:Spawn()
			end
			
			self.Beam:SetParent( self.Owner )
			self.Beam:SetOwner( self.Owner )
		
		end
		
		self:DoTrace()
		self.speed = 10000 //Rope latch speed. Was 3000.
		self.startTime = CurTime()
		self.endTime = CurTime() + self.speed
		self.stufff = -1
		
		if (SERVER && self.Beam) then
			self.Beam:GetTable():SetEndPos( self.Tr.HitPos )
		end
		
		self:UpdateAttack()
		
		--self.Weapon:EmitSound( sndPowerDown )
	end
	--self.Weapon:EmitSound( sndPowerUp )
end

function SWEP:UpdateAttack()

	self.Owner:LagCompensation( true )
	
	if (!endpos) then endpos = self.Tr.HitPos end
	
	if (SERVER && self.Beam) then
		self.Beam:GetTable():SetEndPos( endpos )
	end

	lastpos = endpos
	
	
			if ( self.Tr.Entity:IsValid() ) then
			
					endpos = self.Tr.Entity:GetPos()
					if ( SERVER ) then
					self.Beam:GetTable():SetEndPos( endpos )
					end
			
			end
			
			local vVel = (endpos - self.Owner:GetPos())
			local Distance = endpos:Distance(self.Owner:GetPos())
			
			local et = (self.startTime + (Distance/self.speed))
			if(self.stufff != 0) then
				self.stufff = (et - CurTime()) / (et - self.startTime)
			end
			if(self.stufff < 0) then
				--self.Weapon:EmitSound( sndPowerUp )
				self.stufff = 0
			end
			
			if(self.stufff == 0) then
			zVel = self.Owner:GetVelocity().z
			vVel = vVel:GetNormalized()*(math.Clamp(Distance,0,7))
				if( SERVER ) then
				local gravity = GetConVarNumber("sv_Gravity")
				vVel:Add(Vector(0,0,(gravity/100)*1.5)) //Player speed. DO NOT MESS WITH THIS VALUE!
				if(zVel < 0) then
					vVel:Sub(Vector(0,0,zVel/100))
				end
				self.Owner:SetVelocity(vVel)
				end
			end
	
	endpos = nil
	
	self.Owner:LagCompensation( false )
	
end

function SWEP:EndAttack( shutdownsound )
	
	if ( shutdownsound ) then
		--self.Weapon:EmitSound( sndPowerDown )
	end
	
	if ( CLIENT ) then return end
	if ( !self.Beam ) then return end
	
	self.Beam:Remove()
	self.Beam = nil
	
end

function SWEP:Attack2() //Zoom.
			
//	--self.Weapon:EmitSound( self.Secondary.Sound, 50, 100 )
	if (CLIENT) then return end
		local CF = self.Owner:GetFOV()
		if CF == 90 then
			self.Owner:SetFOV(30,.3)
		elseif CF == 30 then
			self.Owner:SetFOV(90,.3)
//			self.Scope = true
//		elseif CF == 0 then
//			self.Owner:SetFOV(90,.3)
	end
end

function SWEP:Holster()
	self:EndAttack( false )
	return true
end

function SWEP:OnRemove()
	self:EndAttack( false )
	return true
end


function SWEP:PrimaryAttack()
end

function SWEP:SecondaryAttack()
end


I put – in front of everything with snd and emit

Any errors in console as it’s loading? It looks some lines are commented (with //) that shouldn’t be commented, within Attack2

No errors in console, I removed the commented lines in Attack2 and that didn’t fix anything.
halp

If you’ve commented out all the lines playing sound and restarted the game and it’s still happening then I’d say you still have another copy of the original weapon somewhere. If this is a weapon you’ve made a copy of and are editting then make sure the original copy isn’t being loaded (eg remove addon or unsubscribe)

[lua]
if SERVER then
CreateConVar(“grapple_distance”, 10000, false) // dont edit this
AddCSLuaFile( “shared.lua” )
end

if CLIENT then
SWEP.PrintName = “Grapple Hook”
SWEP.Slot = 7 – add 1 to get the slot number key

SWEP.ViewModelFOV = 72
SWEP.ViewModelFlip = false
end

SWEP.Base = “weapon_tttbase”

if CLIENT then
function SWEP:CustomAmmoDisplay()
self.AmmoDisplay = self.AmmoDisplay or {}
//attempt to remove ammo display
self.AmmoDisplay.Draw = false

	self.AmmoDisplay.PrimaryClip 	= 1
	self.AmmoDisplay.PrimaryAmmo 	= -1
	self.AmmoDisplay.SecondaryAmmo 	= -1

	return self.AmmoDisplay
end

function SWEP:SetWeaponHoldType( t )
	// Just a fake function so we can define 
	// weapon holds in shared files without errors
end

end

SWEP.Spawnable = false
SWEP.AdminSpawnable = false
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
SWEP.ViewModel = “models/weapons/v_crossbow.mdl”
SWEP.WorldModel = “models/weapons/w_crossbow.mdl”

SWEP.Kind = WEAPON_EQUIP1
SWEP.AutoSpawnable = false
SWEP.AmmoEnt = “none”
SWEP.CanBuy = { ROLE_TRAITOR, ROLE_DETECTIVE } – Remove ROLE_DETECTIVE or ROLE_TRAITOR to make it show only for traitor or detectives.
SWEP.InLoadoutFor = nil
SWEP.LimitedStock = true
SWEP.AllowDrop = true
SWEP.IsSilent = false
SWEP.NoSights = true

if CLIENT then
– Path to the icon material
SWEP.Icon = “VGUI/ttt/ICONNAMEHERE” – Replace with your own dont have one sorry :@

– Text shown in the equip menu
SWEP.EquipMenuData = {
type = “Weapon”,
desc = “Its a grappling hook.”
};
end

if SERVER then
resource.AddFile(“materials/VGUI/ttt/ICONNAMEHERE.vmt”)
end

function SWEP:Initialize()

nextshottime = CurTime()
self:SetWeaponHoldType( "smg" )

end

function SWEP:Think()

if (!self.Owner || self.Owner == NULL) then return end

if ( self.Owner:KeyPressed( IN_ATTACK ) ) then

	self:StartAttack()
	
elseif ( self.Owner:KeyDown( IN_ATTACK ) && inRange ) then

	self:UpdateAttack()
	
elseif ( self.Owner:KeyReleased( IN_ATTACK ) && inRange ) then

	self:EndAttack( true )

end

//Changed from KeyDown to prevent random stuck-in-zoom bug.
if ( self.Owner:KeyPressed( IN_ATTACK2 ) ) then

	self:Attack2()
	
end

end

function">function SWEP:DoTrace( endpos )
local trace = {}
trace.start = self.Owner:GetShootPos()
trace.endpos = trace.start + (self.Owner:GetAimVector() * 14096) //14096 is length modifier.
if(endpos) then trace.endpos = (endpos - self.Tr.HitNormal * 7) end
trace.filter = { self.Owner, self.Weapon }

self.Tr = nil
self.Tr = function"&gt;util.TraceLine( trace )

end

function SWEP:StartAttack()
//Get begining and end poins of trace.
local gunPos = self.Owner:GetShootPos() //Start of distance trace.
local disTrace = self.Owner:GetEyeTrace() //Store all results of a trace in disTrace.
local hitPos = disTrace.HitPos //Stores Hit Position of disTrace.

//Calculate Distance
//Thanks to rgovostes for this code.
local x = (gunPos.x - hitPos.x)^2;
local y = (gunPos.y - hitPos.y)^2;
local z = (gunPos.z - hitPos.z)^2;
local distance = math.sqrt(x + y + z);

//Only latches if distance is less than distance CVAR
local distanceCvar = GetConVarNumber("grapple_distance")
inRange = false
if distance &lt;= distanceCvar then
	inRange = true
end

if inRange then
	if (SERVER) then
		
		if (!self.Beam) then //If the beam does not exist, draw the beam.
			//grapple_beam
			self.Beam = function"&gt;ents.Create( "trace1" )
				self.Beam:SetPos( self.Owner:GetShootPos() )
			self.Beam:Spawn()
		end
		
		self.Beam:SetParent( self.Owner )
		self.Beam:SetOwner( self.Owner )
	
	end
	
	self:DoTrace()
	self.speed = 10000 //Rope latch speed. Was 3000.
	self.startTime = CurTime()
	self.endTime = CurTime() + self.speed
	self.stufff = -1
	
	if (SERVER && self.Beam) then
		self.Beam:GetTable():SetEndPos( self.Tr.HitPos )
	end
	
	self:UpdateAttack()
end

end

function SWEP:UpdateAttack()

self.Owner:LagCompensation( true )

if (!endpos) then endpos = self.Tr.HitPos end

if (SERVER && self.Beam) then
	self.Beam:GetTable():SetEndPos( endpos )
end

lastpos = endpos


		if ( self.Tr.Entity:IsValid() ) then
		
				endpos = self.Tr.Entity:GetPos()
				if ( SERVER ) then
				self.Beam:GetTable():SetEndPos( endpos )
				end
		
		end
		
		local vVel = (endpos - self.Owner:GetPos())
		local Distance = endpos:Distance(self.Owner:GetPos())
		
		local et = (self.startTime + (Distance/self.speed))
		if(self.stufff != 0) then
			self.stufff = (et - CurTime()) / (et - self.startTime)
		end
		if(self.stufff &lt; 0) then
			self.stufff = 0
		end
		
		if(self.stufff == 0) then
		zVel = self.Owner:GetVelocity().z
		vVel = vVel:GetNormalized()*(function"&gt;math.Clamp(Distance,0,7))
			if( SERVER ) then
			local gravity = GetConVarNumber("sv_Gravity")
			vVel:Add(Vector(0,0,(gravity/100)*1.5)) //Player speed. DO NOT MESS WITH THIS VALUE!
			="keyword"&gt;if(zVel &lt; 0) then
				vVel:Sub(Vector(0,0,zVel/100))
			end
			self.Owner:SetVelocity(vVel)
			end
		end

endpos = nil

self.Owner:LagCompensation( ="constant language"&gt;false )

end

function SWEP:EndAttack( shutdownsound )

if ( CLIENT ) then return end
if ( !self.Beam ) then return end

self.Beam:Remove()
self.Beam = nil

end

function SWEP:Attack2() //Zoom.

// self.Weapon:EmitSound( self.Secondary.Sound, 50, 100 )
if (CLIENT) then return end
local CF = self.Owner:GetFOV()
if CF == 90 then
self.Owner:SetFOV(30,.3)
elseif CF == 30 then
self.Owner:SetFOV(90,.3)
// self.Scope = true
// elseif CF == 0 then
// self.Owner:SetFOV(90,.3)
end
end

function">function SWEP:Holster()
self:EndAttack( false )
return true
end

function">function SWEP:OnRemove()
self:EndAttack( false )
return true
end

function SWEP:PrimaryAttack()
end

function SWEP:SecondaryAttack()
end
[/lua]
Edited this from my phone so expect a stupid little typo xP

Idk how, but that didn’t fix it either. Is there a way to just delete the sound file?