2014-10-02 08:49:54 +08:00
SWEP.Base = " weapon_zs_basemelee "
2018-05-02 06:32:59 +08:00
SWEP.PrintName = " Carpenter's Hammer "
SWEP.Description = " A simple but extremely useful tool. Allows you to hammer in nails to make barricades. \n Press SECONDARY FIRE to hammer in nail. It will be attached to whatever is behind it. \n Press RELOAD to take a nail out. \n Use PRIMARY FIRE to bash zombie brains or to repair damaged nails. \n You get a point bonus for repairing damaged nails but a point penalty for removing another player's nails. "
2014-10-02 08:49:54 +08:00
SWEP.DamageType = DMG_CLUB
2018-05-02 06:32:59 +08:00
SWEP.ViewModel = " models/weapons/v_hammer/c_hammer.mdl "
2014-10-02 08:49:54 +08:00
SWEP.WorldModel = " models/weapons/w_hammer.mdl "
2018-05-02 06:32:59 +08:00
SWEP.UseHands = true
2014-10-02 08:49:54 +08:00
SWEP.Primary . ClipSize = 1
SWEP.Primary . Automatic = true
SWEP.Primary . Ammo = " GaussEnergy "
SWEP.Primary . Delay = 1
SWEP.Primary . DefaultClip = 16
2015-04-19 13:54:47 +08:00
SWEP.Secondary . ClipSize = 1
SWEP.Secondary . DefaultClip = 1
SWEP.Secondary . Ammo = " dummy "
2014-10-02 08:49:54 +08:00
2018-05-02 06:32:59 +08:00
--SWEP.MeleeDamage = 35 -- Reduced due to instant swing speed
SWEP.MeleeDamage = 15
2014-10-02 08:49:54 +08:00
SWEP.MeleeRange = 50
SWEP.MeleeSize = 0.875
2018-05-02 06:32:59 +08:00
SWEP.MaxStock = 5
2014-10-02 08:49:54 +08:00
SWEP.UseMelee1 = true
SWEP.NoPropThrowing = true
SWEP.HitGesture = ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE
SWEP.MissGesture = SWEP.HitGesture
SWEP.HealStrength = 1
SWEP.NoHolsterOnCarry = true
2018-05-02 06:32:59 +08:00
SWEP.NoGlassWeapons = true
SWEP.AllowQualityWeapons = true
GAMEMODE : SetPrimaryWeaponModifier ( SWEP , WEAPON_MODIFIER_FIRE_DELAY , - 0.04 )
GAMEMODE : AttachWeaponModifier ( SWEP , WEAPON_MODIFIER_MELEE_RANGE , 3 , 1 )
function SWEP : SetNextAttack ( )
local owner = self : GetOwner ( )
local armdelay = owner : GetMeleeSpeedMul ( )
self : SetNextPrimaryFire ( CurTime ( ) + self.Primary . Delay * ( owner.HammerSwingDelayMul or 1 ) * armdelay )
end
2014-10-02 08:49:54 +08:00
function SWEP : PlayHitSound ( )
self : EmitSound ( " weapons/melee/crowbar/crowbar_hit- " .. math.random ( 4 ) .. " .ogg " , 75 , math.random ( 110 , 115 ) )
end
function SWEP : PlayRepairSound ( hitent )
hitent : EmitSound ( " npc/dog/dog_servo " .. math.random ( 7 , 8 ) .. " .wav " , 70 , math.random ( 100 , 105 ) )
end