No errors.
idk all what you want to see so... here.
SWEP.Primary.ClipSize = 1
SWEP.Primary.Delay = 0.01
SWEP.Primary.DefaultClip = 10
SWEP.Primary.Force = 0
SWEP.Primary.Damage = 0
SWEP.Primary.NumShots = 1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "pistol"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
-- Some self variables
SWEP.TazedTime = 5
SWEP.ReloadTime = 10
SWEP.ReloadTimer = CurTime()
function SWEP:PrimaryAttack()
if ( !self:CanPrimaryAttack() ) then return end
local eyeTrace = self.Owner:GetEyeTrace()
if !eyeTrace.Entity:IsPlayer() then
return
end
local dist = self.Owner:EyePos():Distance(eyeTrace.Entity:GetPos())
if dist > 200 then
self.Owner:PrintMessage(HUD_PRINTCENTER, "Too Far Away!")
return
end
if eyeTrace.Entity:IsPlayer() and dist < 201 then
self.Weapon:EmitSound("Weapon_StunStick.Activate")
self.BaseClass.ShootEffects(self)
self.ReloadTimer = CurTime() + self.ReloadTime
tazedPlayer = eyeTrace.Entity
oldModel = eyeTrace.Entity:GetMaterial()
self:tasePlayer(eyeTrace.Entity)
self:TakePrimaryAmmo( 1 )
end
end