daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rb655_AddForcePower( {
  2.     name = "Lightsaber Throw",
  3.     material = Material( "lightsaber_icons/repulse.png" ),
  4.     description = "Throw your lightsaber!"
  5.     action = function(self)
  6.     if self:GetForce() < 20 then return end
  7.     self:SetForce( self:GetForce() - 20 )
  8.     self:SetEnabled(false)
  9.     self:SetBladeLength(0)
  10.     self:SetNextAttack( 1 )
  11.     self:GetOwner():DrawWorldModel(false)
  12.  
  13.     local ent = ents.Create("ent_lightsaber_thrown")
  14.     ent:SetModel(self:GetWorldModel())
  15.     ent:Spawn()
  16.     ent:SetBladeLength(self:GetMaxLength())
  17.     ent:SetMaxLength(self:GetMaxLength())
  18.     ent:SetCrystalColor(self:GetCrystalColor())
  19.     ent:SetDarkInner( self:GetDarkInner() )
  20.  
  21.     local pos = self:GetSaberPosAng()
  22.     ent:SetPos(pos)
  23.     pos = pos + self.Owner:GetAimVector() * 750
  24.     ent:SetEndPos(pos)
  25.     ent:SetOwner(self.Owner)
  26.   end
  27.   } )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top