Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. if CLIENT then
  2.  
  3.     local function Arc( ent,attacker,attacked )
  4.      
  5.        if not ( ent:IsValid() and ent:IsPlayer() and ent:Team() == TEAM_UNDEAD and ent:Alive() ) then return end
  6.      
  7.        if attacked[ent] then return end
  8.      
  9.        for k,v in pairs( ents.FindInSphere( ent:GetPos(), 150 ) ) do
  10.      
  11.             if attacked[ent] then return end
  12.      
  13.             local effectdata = EffectData()
  14.             effectdata:SetStart( ent:GetPos() )
  15.             effectdata:SetOrigin( v:GetPos() )
  16.      
  17.             util.Effect( "arcbeam", effectdata )
  18.            
  19.             timer.Simple( 0.1, function()
  20.      
  21.                 if attacker:IsValid() then
  22.                     Arc( v, ent, attacked )
  23.                 end
  24.      
  25.             end )
  26.            
  27.             attacked[ent] = true
  28.      
  29.         end
  30.      
  31.     end
  32.  
  33.     function SWEP.BulletCallback( attacker, tr, dmginfo )
  34.  
  35.         local ent = tr.Entity
  36.  
  37.         timer.Simple( 0.1, function()
  38.  
  39.             if attacker:IsValid() then
  40.                 Arc( ent, attacker, {} )
  41.             end
  42.  
  43.         end )
  44.  
  45.         // below this is just shooting effects
  46.         local effectdata = EffectData()
  47.         effectdata:SetOrigin( tr.HitPos + tr.HitNormal )
  48.         effectdata:SetAngles( tr.HitNormal:Angle() )
  49.         effectdata:SetScale( 1 )
  50.  
  51.         util.Effect( "cball_bounce", effectdata )
  52.  
  53.         local hitpos, hitnorm, shootpos = tr.HitPos, tr.HitNormal, attacker:GetShootPos()
  54.         ArcEffect( hitpos + hitnorm, shootpos + attacker:EyeAngles():Right() * 9 + attacker:EyeAngles():Forward() * 40 + attacker:EyeAngles():Up() * -5 )
  55.  
  56.     end
  57.  
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement