Guest User

Untitled

a guest
Jan 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. if SERVER then
  2. AddCSLuaFile( "shared.lua" )
  3. end
  4.  
  5. SWEP.HoldType = "slam"
  6.  
  7. if CLIENT then
  8. SWEP.PrintName = "Jihad Bomb"
  9. SWEP.Instructions = "bomb"
  10. SWEP.Slot = 6
  11. SWEP.SlotPos = 0
  12. SWEP.IconLetter = "j"
  13.  
  14. SWEP.EquipMenuData = {
  15. type="Weapon",
  16. model="models/weapons/w_jb.mdl",
  17. name="Jihad",
  18. desc="Powerful explosive./nScream at your Enemies xD."
  19. };
  20.  
  21. SWEP.Icon = "VGUI/ttt/icon_jihad"
  22. end
  23.  
  24. SWEP.Base = "weapon_tttbase"
  25.  
  26. SWEP.Kind = WEAPON_EQUIP
  27. SWEP.CanBuy = {ROLE_TRAITOR} -- only traitors can buy
  28. SWEP.WeaponID = WEAPON_NONE
  29.  
  30. SWEP.Spawnable = false
  31. SWEP.AdminSpawnable = false
  32. SWEP.ViewModel = "models/weapons/v_jb.mdl"
  33. SWEP.WorldModel = "models/weapons/w_jb.mdl" --W
  34. SWEP.Weight = 50
  35. SWEP.AutoSwitchTo = false
  36. SWEP.AutoSwitchFrom = false
  37. SWEP.DrawCrosshair = false
  38. SWEP.ViewModelFlip = false
  39. SWEP.Primary.ClipSize = -1
  40. SWEP.Primary.DefaultClip = -1
  41. SWEP.Primary.Automatic = true
  42. SWEP.Primary.Ammo = "none"
  43. SWEP.Primary.Delay = 2
  44.  
  45. SWEP.Secondary.ClipSize = -1
  46. SWEP.Secondary.DefaultClip = -1
  47. SWEP.Secondary.Automatic = true
  48. SWEP.Secondary.Ammo = "none"
  49. SWEP.Secondary.Delay = 2
  50.  
  51. SWEP.NoSights = true
  52.  
  53.  
  54. function SWEP:Reload()
  55. end
  56.  
  57. function SWEP:Initialize()
  58. util.PrecacheSound("siege/big_explosion.wav")
  59. util.PrecacheSound("siege/jihad.wav")
  60. end
  61.  
  62.  
  63.  
  64. function SWEP:Think()
  65. end
  66.  
  67.  
  68.  
  69. function SWEP:PrimaryAttack()
  70. self.Weapon:SetNextPrimaryFire(CurTime() + 3)
  71.  
  72.  
  73. local effectdata = EffectData()
  74. effectdata:SetOrigin( self.Owner:GetPos() )
  75. effectdata:SetNormal( self.Owner:GetPos() )
  76. effectdata:SetMagnitude( 8 )
  77. effectdata:SetScale( 1 )
  78. effectdata:SetRadius( 16 )
  79. util.Effect( "Sparks", effectdata )
  80.  
  81. self.BaseClass.ShootEffects( self )
  82.  
  83.  
  84.  
  85. if (SERVER) then
  86. timer.Simple(2, function() self:Asplode() end )
  87. self.Owner:EmitSound( "siege/jihad.wav" )
  88. end
  89.  
  90. end
  91.  
  92.  
  93. function SWEP:Asplode()
  94. local k, v
  95.  
  96.  
  97. local ent = ents.Create( "env_explosion" )
  98. ent:SetPos( self.Owner:GetPos() )
  99. ent:SetOwner( self.Owner )
  100. ent:Spawn()
  101. ent:SetKeyValue( "iMagnitude", "250" )
  102. ent:Fire( "Explode", 0, 0 )
  103. ent:EmitSound( "siege/big_explosion.wav", 500, 500 )
  104.  
  105. self.Owner:Kill( )
  106. self.Owner:AddFrags( -1 )
  107.  
  108. for k, v in pairs( player.GetAll( ) ) do
  109. v:ConCommand( "play siege/big_explosion.wav\n" )
  110. end
  111.  
  112. end
  113.  
  114.  
  115.  
  116. function SWEP:SecondaryAttack()
  117.  
  118. self.Weapon:SetNextSecondaryFire( CurTime() + 1 )
  119.  
  120. local TauntSound = Sound( "vo/npc/male01/overhere01.wav" )
  121.  
  122. self.Weapon:EmitSound( TauntSound )
  123.  
  124.  
  125. if (!SERVER) then return end
  126.  
  127. self.Weapon:EmitSound( TauntSound )
  128.  
  129.  
  130. end
  131.  
  132. end
Add Comment
Please, Sign In to add comment