What is this Addon?

I have been looking for a couple addons i have seen on some servers. One is the ‘[Use] To Swap Weapons’. The other is the little popup that comes up when you hover over a weapon and it gives you some weapon stats. Only have 1 screenshot

I’ve seen stuff like that on a lot of servers; pretty sure it’s custom. Looks like a simple quick drop and pick-up script.

so is this good? I’m not sure how to use it. Do i make it into a lua file then put it in /lua/autorun ?


CreateConVar("weapon_pickup_on_use", 1)
hook.Add( "PlayerSpawn", "PickupTimeout", function( ply )
    ply.PickupTimeout = CurTime() + 0.5
end )
 
hook.Add( "PlayerCanPickupWeapon", "NoPickup", function( ply, wep )
	if (GetConVarNumber("weapon_pickup_on_use") == 0) then return; end
    if ( ( ply.PickupTimeout or 0 ) < CurTime() ) then return false end
end )
 
hook.Add( "KeyPress", "PressUse", function( ply, key )
	if (GetConVarNumber("weapon_pickup_on_use") == 0) then return; end
    if ( key == IN_USE ) then
        local tr = ply:GetEyeTrace()
        if ( ValidEntity( tr.Entity ) and tr.Entity:IsWeapon() and tr.Entity:GetPos():Distance( ply:GetShootPos() ) < 64 ) then
            ply.PickupTimeout = CurTime() + 0.5
 
            ply:Give( tr.Entity:GetClass() )
            tr.Entity:Remove()
        end
    end
end )

anyone?

Yes, just put it in lua/autorun.

thanks :slight_smile: