People picking up guns by walking over them

Hi, I was working on a DarkRP server today, when I tested the single weapons I added, I realized that I could pick them up simply by walking over them. How would I go about making it so that the players must click their use key while looking at the weapon to pick it up instead of just walking over it. It only picks it up when being walked over the first time it is spawned. If you drop it and walk over it, it won’t pick up.

Here’s an example/the setup I used when creating the single weapons that are experiencing this bug:

AddEntity("AK47", "weapon_real_cs_ak47", "models/weapons/w_rif_ak47.mdl", 725, 10, "/buyak47", {TEAM_GUN})

Thanks! By the way, I put that code (above) in ‘shipments.lua’.

Return false on PlayerCanPickupWeapon unless the user is looking at the weapon.

Thank you, Acecool. By the way, I think I remember you from a clan I used to be in a long time ago. Haha, anyways, thanks. :smiley: