Weapon Similar to Flare Gun?

Hello. I’m making a weapon similar to the TTT Flare gun. (Same Code)

The only problem is that I need to remove the part of the code that burns bodies?

If someone could point out this code it would be very helpful.

Thanks in advanced.

[lua]
local function RunIgniteTimer(ent, timer_name)
if IsValid(ent) and ent:IsOnFire() then
if ent:WaterLevel() > 0 then
ent:Extinguish()
elseif CurTime() > ent.burn_destroy then
ent:SetNotSolid(true)
ent:Remove()
else
– keep on burning
return
end
end

timer.Destroy(timer_name) – stop running timer
end
[/lua]
cough “ent:Remove()” cough
To further my point
[lua]
if ent:IsPlayer() then
timer.Simple(dur + 0.1, function()
if IsValid(ent) then
ent.ignite_info = nil
end
end)

  elseif ent:GetClass() == "prop_ragdoll" then
     ScorchUnderRagdoll(ent)

     local burn_time = 6
     local tname = Format("ragburn_%d_%d", ent:EntIndex(), math.ceil(CurTime()))

     ent.burn_destroy = CurTime() + burn_time

     timer.Create(tname,
                  0.1,
                  math.ceil(1 + burn_time / 0.1), -- upper limit, failsafe
                  function()
                     RunIgniteTimer(ent, tname) -- <-- Hey look its only on the ragdoll :O
                  end)
  end

[/lua]

So you want an empty gun with a 357 model?

Hyper, It will still ignite those who’re alive.
It just won’t burn dead bodies.

[editline]19th February 2013[/editline]



if SERVER then
   AddCSLuaFile( "shared.lua" )
end

SWEP.HoldType           = "ar2"

if CLIENT then
   SWEP.PrintName          = "Weapon Name (Beta)"

   SWEP.Slot               = 2

   SWEP.Icon = "VGUI/ttt/icon_weaponicon" 
end

SWEP.EquipMenuData = {
   type = "Weapon Name (Beta)",
   desc = "Shooting fire out of a "
};

SWEP.Base               = "weapon_tttbase"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.Kind = WEAPON_HEAVY
SWEP.WeaponID = AMMO_FLARE

SWEP.Primary.Delay          = 1.5
SWEP.Primary.Recoil         = 7
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "AR2AltFire"
SWEP.Primary.Damage = 10
SWEP.Primary.Cone = 0.005
SWEP.Primary.ClipSize = 5
SWEP.Primary.ClipMax = 5 -- keep mirrored to ammo
SWEP.Primary.DefaultClip = 5

SWEP.ViewModel = "models/weapons/weaponmodel"
SWEP.WorldModel = "models/weapons/weaponmodel"

SWEP.Primary.Sound = Sound(")noise")
SWEP.Secondary.Sound = Sound("Booom")

SWEP.AutoSpawnable      = false
SWEP.CanBuy = { ROLE_TRAITOR }

local function RunIgniteTimer(ent, timer_name)
   if IsValid(ent) and ent:IsOnFire() then
      if ent:WaterLevel() > 0 then
         ent:Extinguish()
      elseif CurTime() > ent.burn_destroy then
         ent:SetNotSolid(true)
      else
         -- keep on burning
         return
      end
   end

   timer.Destroy(timer_name) -- stop running timer
end

function SWEP:ShootFlare()
   local cone = self.Primary.Cone
   local bullet = {}
   bullet.Num       = 1
   bullet.Src       = self.Owner:GetShootPos()
   bullet.Dir       = self.Owner:GetAimVector()
   bullet.Spread    = Vector( cone, cone, 0 )
   bullet.Tracer    = 1
   bullet.Force     = 2
   bullet.Damage    = self.Primary.Damage
   bullet.TracerName = self.Tracer
   bullet.Callback = IgniteTarget

   self.Owner:FireBullets( bullet )
end

function SWEP:PrimaryAttack()
   self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )

   if not self:CanPrimaryAttack() then return end

   self.Weapon:EmitSound( self.Primary.Sound )

   self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )

   self:ShootFlare()

   self:TakePrimaryAmmo( 1 )

   if IsValid(self.Owner) then
      self.Owner:SetAnimation( PLAYER_ATTACK1 )

      self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) )
   end

   if ( (game.SinglePlayer() && SERVER) || CLIENT ) then
      self.Weapon:SetNetworkedFloat( "LastShootTime", CurTime() )
   end
end

I know the model and name are wrong, it’s just so people don’t steal my idea :3

It ignites people and still burns their body? What have I done wrong?

I think there is a bit more wrong than just the name and model lol


SWEP.Secondary.Sound = Sound("Booom")

BOOM!

I know, It would reveal what the weapon was though.

Nobody cares about your idea, you don’t have to keep it a secret. If we really did, we could go on your server later and see.

Just being safe. Anyway, anyone know what I’m missing?

Do you have eyes? I Just told you…

Pandaman09, where is that second piece of code found?

In the file… Just look, it’s not like its complicated. (P.s. I don’t remember and don’t feel like looking since its easy to fine…)

These are the skids that make Lua look bad.
You know, the ones that want to be spoonfed and change a sound so we don’t “steal” it when I could literally make this in 5 minutes. But because I am not a complete asshole and was only expressing my opion, I’ll give you a hint.

Check one of the bullet.callback settings.