Advertisement
MVGDaniel

Untitled

Apr 25th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. wOS.ForcePowers:RegisterNewPower({
  2.  
  3. name = "Electric Judgement",
  4.  
  5. icon = "EJ",
  6.  
  7. description = "The truth can blind us all.",
  8.  
  9. image = "wos/forceicons/icefuse/electric_judgement.png",
  10.  
  11. cooldown = 0,
  12.  
  13. manualaim = false,
  14.  
  15. action = function( self )
  16.  
  17. if ( self:GetForce() < 5 ) then return end
  18.  
  19. local tr = util.TraceLine( util.GetPlayerTrace( self.Owner ) )
  20.  
  21. local ent = tr.Entity
  22.  
  23. if not ent then return end
  24.  
  25. if not ent:IsPlayer() then return end
  26.  
  27. if self.Owner:GetPos():Distance( ent:GetPos() ) > 300 then return end
  28.  
  29. local ed = EffectData()
  30.  
  31. ed:SetOrigin( self:GetSaberPosAng() )
  32.  
  33. ed:SetEntity( ent )
  34.  
  35. util.Effect( "wos_emerald_lightning", ed, true, true )
  36.  
  37. if ent.IsBlocking then
  38.  
  39. ent:EmitSound( "lightsaber/saber_hit_laser" .. math.random( 1, 4 ) .. ".wav" )
  40.  
  41. if wOS.EnableStamina then
  42.  
  43. ent:AddStamina( -5 )
  44.  
  45. else
  46.  
  47. ent:GetActiveWeapon():SetForce( ent:GetActiveWeapon():GetForce() - 1 )
  48.  
  49. end
  50.  
  51. ent:SetSequenceOverride( "h_block", 0.5 )
  52.  
  53. else
  54.  
  55. ent:SetNW2Float( "wOS.DisorientTime", CurTime() + 7 )
  56.  
  57. ent:SetNW2Float( "wOS.SaberAttackDelay", CurTime() + 7 )
  58.  
  59. end
  60.  
  61. self.Owner:SetNW2Float( "wOS.ForceAnim", CurTime() + 0.5 )
  62.  
  63. self:SetForce( self:GetForce() - 5 )
  64.  
  65. if ( !self.SoundLightning ) then
  66.  
  67. self.SoundLightning = CreateSound( self.Owner, "ambient/wind/wind_snippet2.wav" )
  68.  
  69. self.SoundLightning:PlayEx( 0.5, 100 )
  70.  
  71. else
  72.  
  73. self.SoundLightning:PlayEx( 0.5, 100 )
  74.  
  75. end
  76.  
  77. timer.Create( "test" .. self.Owner:SteamID64(), 0.2, 1, function() if ( self.SoundLightning ) then self.SoundLightning:Stop() self.SoundLightning = nil end end )
  78.  
  79. -- self:SetNextAttack( 0.1 )
  80.  
  81. return true
  82.  
  83. end,
  84.  
  85. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement