zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_shitslapper/init.lua

24 lines
584 B
Lua
Raw Permalink Normal View History

INC_SERVER()
function SWEP:ApplyMeleeDamage(ent, trace, damage)
if ent:IsValid() then
--[[local vel = ent:GetPos() - self:GetOwner():GetPos()
vel.z = 0
vel:Normalize()
vel = vel * 800
vel.z = 350
ent:KnockDown()
ent:SetGroundEntity(NULL)
ent:SetVelocity(vel)]]
local noknockdown = true
if CurTime() >= (ent.NextKnockdown or 0) then
noknockdown = false
ent.NextKnockdown = CurTime() + 4
end
ent:ThrowFromPositionSetZ(trace.StartPos, ent:IsPlayer() and 600 or 1600, nil, noknockdown)
end
self.BaseClass.ApplyMeleeDamage(self, ent, trace, damage)
end