Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- AddCSLuaFile( "shared.lua" )
- resource.AddFile("models/weapons/v_healthkit.mdl")
- resource.AddFile("materials/vgui/ttt/icon_gp_hpkit.vmt")
- end
- SWEP.HoldType = "slam"
- if CLIENT then
- SWEP.PrintName = "Portable Healthkit"
- SWEP.Slot = 7
- SWEP.EquipMenuData = {
- type = "Buff",
- desc = "Left click to heal for a swanky 25 HP!"
- };
- SWEP.Icon = "VGUI/ttt/icon_gp_hpkit"
- end
- SWEP.Base = "weapon_tttbase"
- SWEP.Kind = WEAPON_EQUIP2
- SWEP.WeaponID = AMMO_HPKIT
- SWEP.CanBuy = {ROLE_TRAITOR, ROLE_DETECTIVE, ROLE_INNOCENT} -- only traitors can buy
- SWEP.LimitedStock = false -- only buyable once
- SWEP.AutoSpawnable = false
- SWEP.AllowDrop = true
- SWEP.NoSights = true
- SWEP.ViewModel = "models/weapons/v_healthkit.mdl"
- SWEP.WorldModel = "models/Items/HealthKit.mdl"
- SWEP.Primary.Recoil = 0
- SWEP.Primary.Damage = 0
- SWEP.Primary.NumShots = 1
- SWEP.Primary.Cone = 0
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.Delay = 0
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.NumShots = 1
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = true
- SWEP.Secondary.Ammo = "none"
- local ShootSound = Sound ("items/smallmedkit1.wav")
- function SWEP:OnRemove()
- if CLIENT and ValidEntity(self.Owner) and self.Owner == LocalPlayer() and self.Owner:Alive() then
- RunConsoleCommand("lastinv")
- end
- end
- function SWEP:PrimaryAttack()
- if not self.Weapon:GetOwner():Health() < self.Weapon:GetOwner():GetMaxHealth() then
- self.Weapon:EmitSound( ShootSound, 60, 100 )
- self.Weapon:GetOwner():SetHealth( self.Weapon:GetOwner():Health() + 25 )
- if SERVER then
- self.Owner:StripWeapon("weapon_ttt_healthkit")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement