Guest User

Backfire Gun [Whiterabbit]

a guest
Aug 30th, 2013
2
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.46 KB | None | 0 0
  1.  
  2. /* I copied the skeleton of this from the flechette gun, and changed it to set the owner on fire. Simple. Whiterabbit */
  3.  
  4. /*
  5.  
  6.     http://steamcommunity.com/sharedfiles/filedetails/?id=1
  7.    
  8. */
  9.  
  10. AddCSLuaFile()
  11.  
  12. SWEP.Author         = "Whiterabbit"
  13. SWEP.Instructions   = "Ignites yourself"
  14.  
  15. SWEP.Spawnable          = true
  16. SWEP.AdminOnly          = false
  17. SWEP.UseHands           = true
  18.  
  19. SWEP.ViewModel          = "models/weapons/c_smg1.mdl"
  20. SWEP.WorldModel         = "models/weapons/w_smg1.mdl"
  21.  
  22. SWEP.Primary.ClipSize       = -1
  23. SWEP.Primary.DefaultClip    = -1
  24. SWEP.Primary.Automatic      = true
  25. SWEP.Primary.Ammo           = "none"
  26.  
  27. SWEP.Secondary.ClipSize     = -1
  28. SWEP.Secondary.DefaultClip  = -1
  29. SWEP.Secondary.Automatic    = false
  30. SWEP.Secondary.Ammo         = "none"
  31.  
  32. SWEP.AutoSwitchTo       = false
  33. SWEP.AutoSwitchFrom     = false
  34.  
  35. SWEP.PrintName          = "Backfire Gun"
  36. SWEP.Category           = "Whiterabbit Server Weapons"
  37. SWEP.Slot               = 1
  38. SWEP.SlotPos            = 2
  39. SWEP.DrawAmmo           = false
  40.  
  41. local ShootSound = Sound( "garrysmod/balloon_pop_cute.wav" )
  42.  
  43. /*---------------------------------------------------------
  44.     Reload does nothing
  45. ---------------------------------------------------------*/
  46. function SWEP:Reload()
  47. end
  48.  
  49. /*---------------------------------------------------------
  50.    Think does nothing
  51. ---------------------------------------------------------*/
  52. function SWEP:Think()
  53. end
  54.  
  55.  
  56. /*---------------------------------------------------------
  57.     PrimaryAttack
  58. ---------------------------------------------------------*/
  59. function SWEP:PrimaryAttack()
  60.  
  61.     self:SetNextPrimaryFire( CurTime() + 0.2175 )
  62.  
  63.     self:EmitSound( ShootSound ) --shooting sound
  64.     self:ShootEffects( self ) --eject a bullet cartridge / muzzle flash
  65.    
  66.     -- The rest is only done on the server
  67.     if (!SERVER) then return end
  68.    
  69.     if not IsValid(self.Owner) then return end --no owner to ignite?
  70.    
  71.     self.Owner:Ignite(3, 0) --ignite the weapon holder
  72.  
  73. end
  74.  
  75. /*---------------------------------------------------------
  76.     SecondaryAttack
  77. ---------------------------------------------------------*/
  78. function SWEP:SecondaryAttack()
  79.     if CLIENT then return end --only need to run this serverside
  80.     if not IsValid(self.Owner) then return end --no owner to extinguish?
  81.     self.Owner:Extinguish() --extinguish the owner
  82. end
  83.  
  84.  
  85. /*---------------------------------------------------------
  86.    Name: ShouldDropOnDie
  87.    Desc: Should this weapon be dropped when its owner dies?
  88. ---------------------------------------------------------*/
  89. function SWEP:ShouldDropOnDie()
  90.     return false
  91. end
Advertisement
Add Comment
Please, Sign In to add comment