How do i change the way to pick items up with this inventory?

i assume this is the part of the file that involves how to pick it up(i wanna make it so u pick it up with alt + e):
[lua]local function StoreItem( ply, key )
if ( key == IN_USE or key == IN_WALK ) and ( ply:KeyDown( IN_USE ) and ply:KeyDown( IN_WALK ) ) then
local tracedata = {}
tracedata.start = ply:GetShootPos()
tracedata.endpos = ply:GetShootPos()+(ply:GetAimVector()*80)
tracedata.filter = ply
local trace = util.TraceLine(tracedata)

	if !IsValid(trace.Entity) then return end
	if trace.Entity:GetClass() != "spawned_weapon" and trace.Entity:GetClass() != "spawned_shipment" then return end
	
	if !ply:HasItem("extra") then return end
	
	if trace.Entity:GetClass() == "spawned_weapon" then
		for k, v in pairs( InventoryItems ) do
			if v.slot == "weapon" and v.class == trace.Entity.weaponclass then
				ply:GiveItem( v.name, { clip = trace.Entity.clip1 or weapons.Get(trace.Entity.weaponclass).Primary.DefaultClip } )
				trace.Entity:Remove()
				
				break
			end
		end
	elseif trace.Entity:GetClass() == "spawned_shipment" then
		for k, v in pairs( InventoryItems ) do
			if v.slot == "shipment" and v.class == CustomShipments[trace.Entity:Getcontents()].entity then
				ply:GiveItem( v.name, { quantity = trace.Entity:Getcount() } )
				trace.Entity:Remove()
				
				break
			end
		end
	end
end

end[/lua]

if nobody knows how can they at least tell me how to pick it up currently?

Hi T0M your name sounds familiar. I believe I met you in Navi’s server


	if ( key == IN_USE or key == IN_WALK ) and ( ply:KeyDown( IN_USE ) and ply:KeyDown( IN_WALK ) ) then

That is the only logical thing I see in your code that would invoke a pickup. Looks like it would be CTRL+E? or whatever your key is to go to walking speed + your use key. If this works for you I can show you how to modify that line to make it alt+e

hi. i remember you too. also it would be alt+e but for some odd reason that is not working in game and there is no error


( key == IN_USE or key == IN_WALK ) and 

try removing that from there and running and see what happens.

or if you’re just running a test server just leave


 if ply:KeyDown( IN_WALK ) ) then 

and test if it is actually running the code when you are looking at a gun.

Don’t use alt+e as it’s occupied by the Sit Anywhere Script and will probably conflict if you’re using it.

got rid of the sit anywhere script, still dont work

Do you mean that exactly or do u mean replace this:


( key == IN_USE or key == IN_WALK ) and 

with this?


 (if ply:KeyDown( IN_WALK ) ) then 

^forgot a parentheses OR u included the if from the beginning

Just


if (ply:KeyDown(IN_WALK)) then

should be triggered by alt. If that doesn’t work play with it. Use different keys for it

Many inventories used ALT + E before Sit Anywhere, tbh.

Okay? The point is that he should not use Alt+e, not who used it first…