Advertisement
Guest User

weapon_ttt_healgun

a guest
Nov 20th, 2016
65
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AddCSLuaFile()
  2.  
  3. if SERVER then
  4.    resource.AddFile("materials/vgui/ttt/icon_healgun.png")
  5. end
  6.  
  7. if CLIENT then
  8.    SWEP.PrintName = "Healing Shotgun"
  9.    SWEP.Slot = 6
  10.    SWEP.Icon = "materials/vgui/ttt/icon_healgun.png"
  11. end
  12.  
  13. SWEP.HealPercent = 1
  14. SWEP.ClipPercent = 0.5
  15. SWEP.DamagePercent = 0.5
  16.  
  17. SWEP.EquipMenuData = {
  18.     type = "item_weapon",
  19.     desc = "Heals user on hit."
  20. };
  21. if SWEP.ClipPercent < 1 then SWEP.EquipMenuData.desc=SWEP.EquipMenuData.desc.."\n-"..tostring(100-100*SWEP.ClipPercent).."% clip size" end
  22. if SWEP.DamagePercent < 1 then SWEP.EquipMenuData.desc=SWEP.EquipMenuData.desc.."\n-"..tostring(100-100*SWEP.DamagePercent).."% damage dealt" end
  23. if SWEP.ClipPercent > 1 then SWEP.EquipMenuData.desc=SWEP.EquipMenuData.desc.."\n+"..tostring(100-100*SWEP.ClipPercent).."% clip size" end
  24. if SWEP.DamagePercent > 1 then SWEP.EquipMenuData.desc=SWEP.EquipMenuData.desc.."\n+"..tostring(100-100*SWEP.DamagePercent).."% damage dealt" end
  25.  
  26. SWEP.Base  = "weapon_zm_shotgun"
  27.  
  28. SWEP.CanBuy = {ROLE_DETECTIVE}
  29. SWEP.LimitedStock = true
  30. SWEP.Kind = WEAPON_EQUIP1
  31. SWEP.WeaponID = nil
  32. SWEP.InLoadoutFor = nil
  33. SWEP.AutoSpawnable = false
  34.  
  35. SWEP.Primary.ClipSize  = 8*SWEP.ClipPercent
  36. SWEP.Primary.Damage = 11*SWEP.DamagePercent
  37.  
  38. SWEP.ViewModel = "models/weapons/cstrike/c_shot_xm1014.mdl"
  39. SWEP.WorldModel = "models/weapons/w_shot_xm1014.mdl"
  40.  
  41. function SWEP:ShootBullet( damage, num_bullets, aimcone )
  42.     if self.Owner:Health()+damage*self.HealPercent <= 100 then
  43.         self.Owner:SetHealth(self.Owner:Health()+damage*self.HealPercent)
  44.     end
  45. end
  46.  
  47. function SWEP:WasBought(buyer)
  48.    if IsValid(buyer) then
  49.       buyer:GiveAmmo( 20, "Buckshot" )
  50.    end
  51. end
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement