Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. function SWEP:Think()
  2. if ( self:GetPickpocketing() ) then
  3. local target = self:GetPickpocketTarget()
  4.  
  5. if ( not self:CanPickpocket( target ) or self.Owner:GetEyeTrace().Entity ~= target ) then
  6. self:SetPickpocketing( false )
  7. else
  8. if ( NextSound < CurTime() ) then
  9. self.Owner:EmitSound( "garrysmod/save_load1.wa" )
  10. NextSound = CurTime() + self.SoundFrequency
  11. end
  12.  
  13. if ( self:GetPickpocketTime() < CurTime() ) then
  14. self:SetPickpocketing( false )
  15.  
  16. if ( math.Rand( 0, 1 ) > self.PickpocketFailureChance ) then
  17. if ( self:GetPickpocketMode() == "money" ) then
  18. local money = math.random( 100 , 5000 )
  19. money = math.Clamp( money + 10 , 0 , self.PickpocketMax )
  20.  
  21.  
  22. if ( self.DarkRP25 ) then
  23. target:addMoney( -money )
  24. self.Owner:addMoney( money )
  25. else
  26. target:AddMoney( -money )
  27. self.Owner:AddMoney( money )
  28. end
  29.  
  30. self.Owner:MultiversionNotify(NOTIFY_GENERIC, "You stole $"..tostring(money)..", 2 Minute cooldown",10) -- notifies person who stole money
  31. target:MultiversionNotify(NOTIFY_ERROR, "Someone stole $"..money.." from you!") -- notifies person who got money stolen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement