Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- local function Arc( ent,attacker,attacked )
- if not ( ent:IsValid() and ent:IsPlayer() and ent:Team() == TEAM_UNDEAD and ent:Alive() ) then return end
- if attacked[ent] then return end
- for k,v in pairs( ents.FindInSphere( ent:GetPos(), 150 ) ) do
- if attacked[ent] then return end
- local effectdata = EffectData()
- effectdata:SetStart( ent:GetPos() )
- effectdata:SetOrigin( v:GetPos() )
- util.Effect( "arcbeam", effectdata )
- timer.Simple( 0.1, function()
- if attacker:IsValid() then
- Arc( v, ent, attacked )
- end
- end )
- attacked[ent] = true
- end
- end
- function SWEP.BulletCallback( attacker, tr, dmginfo )
- local ent = tr.Entity
- timer.Simple( 0.1, function()
- if attacker:IsValid() then
- Arc( ent, attacker, {} )
- end
- end )
- // below this is just shooting effects
- local effectdata = EffectData()
- effectdata:SetOrigin( tr.HitPos + tr.HitNormal )
- effectdata:SetAngles( tr.HitNormal:Angle() )
- effectdata:SetScale( 1 )
- util.Effect( "cball_bounce", effectdata )
- local hitpos, hitnorm, shootpos = tr.HitPos, tr.HitNormal, attacker:GetShootPos()
- ArcEffect( hitpos + hitnorm, shootpos + attacker:EyeAngles():Right() * 9 + attacker:EyeAngles():Forward() * 40 + attacker:EyeAngles():Up() * -5 )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement