Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* I copied the skeleton of this from the flechette gun, and changed it to set the owner on fire. Simple. Whiterabbit */
- /*
- http://steamcommunity.com/sharedfiles/filedetails/?id=174382408
- */
- AddCSLuaFile()
- SWEP.Author = "Whiterabbit"
- SWEP.Instructions = "Ignites yourself"
- SWEP.Spawnable = true
- SWEP.AdminOnly = false
- SWEP.UseHands = true
- SWEP.ViewModel = "models/weapons/c_smg1.mdl"
- SWEP.WorldModel = "models/weapons/w_smg1.mdl"
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.PrintName = "Backfire Gun"
- SWEP.Category = "Whiterabbit Server Weapons"
- SWEP.Slot = 1
- SWEP.SlotPos = 2
- SWEP.DrawAmmo = false
- local ShootSound = Sound( "garrysmod/balloon_pop_cute.wav" )
- /*---------------------------------------------------------
- Reload does nothing
- ---------------------------------------------------------*/
- function SWEP:Reload()
- end
- /*---------------------------------------------------------
- Think does nothing
- ---------------------------------------------------------*/
- function SWEP:Think()
- end
- /*---------------------------------------------------------
- PrimaryAttack
- ---------------------------------------------------------*/
- function SWEP:PrimaryAttack()
- self:SetNextPrimaryFire( CurTime() + 0.2175 )
- self:EmitSound( ShootSound ) --shooting sound
- self:ShootEffects( self ) --eject a bullet cartridge / muzzle flash
- -- The rest is only done on the server
- if (!SERVER) then return end
- if not IsValid(self.Owner) then return end --no owner to ignite?
- self.Owner:Ignite(3, 0) --ignite the weapon holder
- end
- /*---------------------------------------------------------
- SecondaryAttack
- ---------------------------------------------------------*/
- function SWEP:SecondaryAttack()
- if CLIENT then return end --only need to run this serverside
- if not IsValid(self.Owner) then return end --no owner to extinguish?
- self.Owner:Extinguish() --extinguish the owner
- end
- /*---------------------------------------------------------
- Name: ShouldDropOnDie
- Desc: Should this weapon be dropped when its owner dies?
- ---------------------------------------------------------*/
- function SWEP:ShouldDropOnDie()
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment