zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_crowbar.lua
JetBoom 0bbff7e4dd Added fists.
Added fists.
Fixed insane knockback on melee.
Ragdolls on zombies now knocked back by melee/stone deaths.
2014-11-09 22:51:43 -05:00

45 lines
1,017 B
Lua

AddCSLuaFile()
if CLIENT then
SWEP.PrintName = "Crowbar"
SWEP.Description = "Instantly kills headcrabs."
SWEP.ViewModelFOV = 65
end
SWEP.Base = "weapon_zs_basemelee"
SWEP.ViewModel = "models/weapons/c_crowbar.mdl"
SWEP.WorldModel = "models/weapons/w_crowbar.mdl"
SWEP.UseHands = true
SWEP.HoldType = "melee"
SWEP.MeleeDamage = 35
SWEP.MeleeRange = 55
SWEP.MeleeSize = 1.5
SWEP.MeleeKnockBack = 10
SWEP.Primary.Delay = 0.7
SWEP.SwingTime = 0.4
SWEP.SwingRotation = Angle(30, -30, -30)
SWEP.SwingHoldType = "grenade"
function SWEP:PlaySwingSound()
self:EmitSound("Weapon_Crowbar.Single")
end
function SWEP:PlayHitSound()
self:EmitSound("Weapon_Crowbar.Melee_HitWorld")
end
function SWEP:PlayHitFleshSound()
self:EmitSound("Weapon_Crowbar.Melee_Hit")
end
function SWEP:OnMeleeHit(hitent, hitflesh, tr)
if hitent:IsValid() and hitent:IsPlayer() and hitent:Team() == TEAM_UNDEAD and hitent:IsHeadcrab() and gamemode.Call("PlayerShouldTakeDamage", hitent, self.Owner) then
hitent:SetHealth(1)
end
end