2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
|
|
|
|
|
|
|
SWEP.Base = "weapon_zs_butcherknife"
|
|
|
|
|
|
|
|
SWEP.ZombieOnly = true
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.MeleeDamage = 28
|
|
|
|
SWEP.OriginalMeleeDamage = SWEP.MeleeDamage
|
|
|
|
SWEP.Primary.Delay = 0.45
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
function SWEP:OnMeleeHit(hitent, hitflesh, tr)
|
|
|
|
if not hitent:IsPlayer() then
|
2018-05-02 06:32:59 +08:00
|
|
|
self.MeleeDamage = 18
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PostOnMeleeHit(hitent, hitflesh, tr)
|
2018-05-02 06:32:59 +08:00
|
|
|
self.MeleeDamage = self.OriginalMeleeDamage
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
function SWEP:SetNextAttack()
|
|
|
|
local owner = self:GetOwner()
|
|
|
|
local armdelay = owner:GetMeleeSpeedMul()
|
|
|
|
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay * armdelay)
|
|
|
|
end
|