I need help making a melee swep

Hi, so I am trying to make melee sweps out of TF2 V_models, so If you want a copy of My LUA script, its a REALLY simple layout, so could someone please tell me what to type in, and where

SWEP.base = “weapon_base”
SWEP.Category = “cool”;
SWEP.PrintName = “knife”;
SWEP.Slot = 2;
SWEP.SlotPos = 2;
SWEP.DrawCrosshair = true;
SWEP.DrawAmmo = true;
SWEP.ViewModel = “models/weapons/v_models/v_knife_spy.mdl”;
SWEP.WorldModel = “models/weapons/w_models/w_knife_spy.mdl”;
SWEP.ViewModelFOV = 64;
SWEP.ReloadSound = “weapons/pistol/pistol_reload1.wav”;
SWEP.HoldType = “pistol”;
SWEP.Spawnable = true;
SWEP.AdminSpawnable = true;
SWEP.Weight = 1;
SWEP.AutoSwitchTo = false;
SWEP.AutoSwitchFrom = true;
SWEP.FiresUnderwater = true;

SWEP.Primary.Sound = “weapons/ar2/fire1.wav”
SWEP.Primary.Tracer = 1;
SWEP.Primary.Automatic = true;
SWEP.Primary.Force = 40;
SWEP.Primary.FireFromHip = true;
SWEP.Primary.Weld = false;
SWEP.Primary.Ammo = “melee”;
SWEP.Primary.BreakAll = true;
SWEP.Primary.Ignite = false;
SWEP.Primary.ClipSize = 1;
SWEP.Primary.DefaultClip = 1;
SWEP.Primary.Recoil = 0.00;
SWEP.Primary.Damage = 0;
SWEP.Primary.Spread = 0;
SWEP.Primary.Delay = 0.6;
SWEP.Primary.Model = “models/props_c17/FurnitureChair001a.mdl”;
SWEP.Primary.ExplosionSound = “weapon_AWP.Single”;
SWEP.Primary.ExplosionSoundDistance = 400;
SWEP.Primary.ExplosionSize = 175;
SWEP.Primary.TakeAmmo = 0;

Look at the katana swep for help. I havn’t created one so I don’t know how, on primary fire, check if the ent the player is looking at is within a distance of 100 or so, if it is then do the normal code for creating a bullet. if not, then don’t.

hope that helps.