Wizey! made this script a while ago for me so that players must press E to pick up weapons. A side effect, though, is that you can no longer left-click on a weapon to spawn it, you have to right-click while looking at the ground.
What I want is to keep that function of having to press E, but I also want to be able to just left-click on one to spawn it.
Here is the script, if you are interested.
[lua]if ( CLIENT ) then return end
local function PlayerCanPickupWeapon( ply, weap )
if ( CurTime() <= ( ply.UseWeaponSpawn or 0 ) ) then return end
if ( !ply:KeyDown( IN_USE ) ) then return false end
local trace = util.QuickTrace( ply:GetShootPos(), ply:GetAimVector() * 8192, ply )
if ( !trace.Entity || !trace.Entity:IsValid() || trace.Entity != weap ) then
hook.Add( “PlayerCanPickupWeapon”, “UseWeapon”, PlayerCanPickupWeapon )
local function PlayerSpawn( ply )
ply.UseWeaponSpawn = CurTime()
hook.Add( “PlayerSpawn”, “UseWeapon”, PlayerSpawn )[/lua]