zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_crow/shared.lua

45 lines
905 B
Lua
Raw Permalink Normal View History

2014-10-02 08:49:54 +08:00
SWEP.ZombieOnly = true
SWEP.IsMelee = true
SWEP.IsCrow = true
SWEP.ViewModel = "models/weapons/v_knife_t.mdl"
SWEP.WorldModel = "models/weapons/w_knife_t.mdl"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "none"
SWEP.Primary.Delay = 2
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "none"
function SWEP:Initialize()
self:HideViewAndWorldModel()
end
function SWEP:OnRemove()
local owner = self:GetOwner()
2014-10-02 08:49:54 +08:00
if owner and owner:IsValid() then
if owner.Flapping then
owner:StopSound("NPC_Crow.Flap")
end
owner.Flapping = nil
end
end
SWEP.Holster = SWEP.OnRemove
function SWEP:SetPeckEndTime(time)
self:SetDTFloat(0, time)
end
function SWEP:GetPeckEndTime()
return self:GetDTFloat(0)
end
function SWEP:IsPecking()
return CurTime() < self:GetPeckEndTime()
end