Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SWEP:Think()
- if ( self:GetPickpocketing() ) then
- local target = self:GetPickpocketTarget()
- if ( not self:CanPickpocket( target ) or self.Owner:GetEyeTrace().Entity ~= target ) then
- self:SetPickpocketing( false )
- else
- if ( NextSound < CurTime() ) then
- self.Owner:EmitSound( "garrysmod/save_load1.wa" )
- NextSound = CurTime() + self.SoundFrequency
- end
- if ( self:GetPickpocketTime() < CurTime() ) then
- self:SetPickpocketing( false )
- if ( math.Rand( 0, 1 ) > self.PickpocketFailureChance ) then
- if ( self:GetPickpocketMode() == "money" ) then
- local money = math.random( 100 , 5000 )
- money = math.Clamp( money + 10 , 0 , self.PickpocketMax )
- if ( self.DarkRP25 ) then
- target:addMoney( -money )
- self.Owner:addMoney( money )
- else
- target:AddMoney( -money )
- self.Owner:AddMoney( money )
- end
- self.Owner:MultiversionNotify(NOTIFY_GENERIC, "You stole $"..tostring(money)..", 2 Minute cooldown",10) -- notifies person who stole money
- 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