Attempting to fix an old CSS Knife "self.Owner:RangedTrace(self.Range)"

So im attempting to fix an old CSS knife for my server, but im getting this error and I can’t find any method of fixing it.
Any ideas as to how to fix it?


[ERROR] ...modes/minigames/entities/weapons/weapon_knife/shared.lua:61: attempt to call method 'RangedTrace' (a nil value)
  1. unknown - ...modes/minigames/entities/weapons/weapon_knife/shared.lua:61


[HR][/HR]

And this is the file.




if ( SERVER ) then

	AddCSLuaFile( "shared.lua" )
	
	SWEP.HoldType			= "melee"
	
end

if ( CLIENT ) then

	SWEP.PrintName			= "Knife"			
	SWEP.Author				= "Gmod4ever"
	SWEP.Slot				= 2
	SWEP.SlotPos			= 3
	SWEP.IconLetter			= "u"
	SWEP.ViewModelFOV 		= 70
	SWEP.ViewModelFlip 		= false
	
	killicon.AddFont( "weapon_mu_m4", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
	
end


SWEP.Base				= "weapon_cs_base"

SWEP.Spawnable			= true
SWEP.AdminSpawnable		= true

SWEP.ViewModel 			= "models/weapons/v_knife_t.mdl"
SWEP.WorldModel 		= "models/weapons/w_knife_t.mdl"

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

SWEP.Primary.Sound			= Sound( "Weapon_M4A1.Single" )
SWEP.Primary.Recoil			= 1.2
SWEP.Primary.Damage			= 3000
SWEP.Primary.NumShots		= 1
SWEP.Primary.Cone			= 0.03
SWEP.Primary.ClipSize		= -1
SWEP.Primary.Delay			= 0.6
SWEP.Primary.DefaultClip	= -1
SWEP.Primary.Automatic		= true
SWEP.Primary.Ammo			= "none"

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

SWEP.Range = 64

SWEP.LastSwing = 0
function SWEP:PrimaryAttack()
	if CurTime() < self.LastSwing then return end
	self.LastSwing = CurTime() + self.Primary.Delay
	
	**local tr = self.Owner:RangedTrace(self.Range)**
	if tr.Hit then
		if tr.MatType == MAT_FLESH or tr.MatType == MAT_BLOODYFLESH or tr.MatType == MAT_ANTLION or tr.MatType == MAT_ALIENFLESH then
			self.Owner:EmitSound(Sound("weapons/knife/knife_hit"..math.random(1,4)..".wav"))
			util.Decal("Blood", tr.HitPos + tr.HitNormal * 8, tr.HitPos - tr.HitNormal * 8)
		else
			self.Owner:EmitSound(Sound("weapons/knife/knife_hitwall1.wav"))
			util.Decal("ManhackCut", tr.HitPos + tr.HitNormal * 8, tr.HitPos - tr.HitNormal * 8)
		end
	end
	if tr.HitNonWorld then
		local ent = tr.Entity
		if ent:GetClass() == "func_breakable_surf" then
			ent:Fire("break", "", 0)
		else
			ent:TakeDamage(self.Primary.Damage, self.Owner)
		end
	end
	
	self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
	
	self.Owner:EmitSound(Sound("weapons/knife/knife_slash"..math.random(1,2)..".wav"))
	self.Owner:SetAnimation(PLAYER_ATTACK1)
end
		

Thanks,
Matt