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

35 lines
1.3 KiB
Lua

AddCSLuaFile()
SWEP.Base = "weapon_zs_basetrinket"
SWEP.PrintName = "Resupply Pack"
SWEP.Description = "Allows humans to resupply from you.\nPress LMB with the pack in your hand to resupply yourself."
if CLIENT then
SWEP.VElements = {
["base"] = { type = "Model", model = "models/Items/ammocrate_ar2.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(4, 2, -1), angle = Angle(0, -90, 180), size = Vector(0.35, 0.35, 0.35), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.WElements = {
["base"] = { type = "Model", model = "models/Items/ammocrate_ar2.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(4, 2, -1), angle = Angle(0, -90, 180), size = Vector(0.35, 0.35, 0.35), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
}
SWEP.ShowViewModel = false
SWEP.ShowWorldModel = false
end
SWEP.Primary.Automatic = false
SWEP.Primary.Delay = 1
function SWEP:PrimaryAttack()
if not self:CanPrimaryAttack() then return end
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
if CLIENT then return end
local owner = self:GetOwner()
for _, ent in pairs(ents.FindByClass("status_resupplypack")) do
if ent:GetOwner() == owner then
owner:Resupply(owner, ent)
end
end
end