Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. hook.Add( "PlayerSpawn", "Spawned Weapons", function( ply )
  2.     ply.PickupDelay = CurTime() + 0.8
  3.     ply.Start = CurTime() + 0.5
  4. end )
  5.  
  6. function GM:PlayerCanPickupWeapon( ply, entity )
  7.     if ply.Start > CurTime() then return true end
  8.     if ply.PickupDelay > CurTime() then return false end
  9.  
  10.     if ply:KeyDown( IN_USE ) then
  11.         local tr = ply:GetEyeTrace()
  12.         if ValidEntity( tr.Entity ) and tr.Entity == entity and tr.Entity:GetPos():Distance( ply:GetShootPos() ) < 80 then
  13.             ply.PickupDelay = CurTime() + 0.8
  14.             return true
  15.         end
  16.     end
  17.     return false
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement