zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_broadside/init.lua
William Moodhe e9da54c2f9 ZS updates for 2014-2018
Too many changes to list.
2018-05-01 18:32:59 -04:00

28 lines
672 B
Lua

INC_SERVER()
SWEP.Primary.Projectile = "projectile_rocket"
SWEP.Primary.ProjVelocity = 900
SWEP.Primary.ProjExplosionTaper = 0.95
function SWEP:EntModify(ent)
local owner = self:GetOwner()
owner.RemoteDetRocket = ent
owner:SetGroundEntity(NULL)
owner:SetVelocity(-220 * owner:GetAimVector())
ent.ProjTaper = self.Primary.ProjExplosionTaper
self:SetNextSecondaryFire(CurTime() + 0.5)
end
function SWEP:SecondaryAttack()
if self:GetNextSecondaryFire() > CurTime() then return end
for k,v in pairs(ents.FindByClass(self.Primary.Projectile)) do
if v:GetOwner() == self:GetOwner() then
v:Explode()
end
end
self:SetNextSecondaryFire(CurTime() + 0.5)
end