Retro HL2RP

Hi, ive never realy had to do this as i’m usualy very good at fixing things myself.
But I seem to have a problem now that I have no idea of fixing.

I am making a server wich is kind of retro HL2RP.
However as ive noticed the old code doesn’t seem to be very compatible with the new.
As I could only download Nexus in its latest form.

Most functions work but for some reason stamina is not showing up when sprinting, furthermore I can’t pick up any items, nor open any containers/shipments as I get the following error:

[nexus\gamemode\core\sh_core.lua:1436] attempt to get length of field ‘Panels’ (a nil value)(Hook: KeyRelease)
This sais something is wrong at line 1436 though I have tried lots of things I can’t get it fixed. (for reference il paste the part.)


	-- A function to handle an entity's menu.
	function NEXUS:HandleEntityMenu(entity)
		local options = {};
		local menu;
		
		nexus.mount.Call("GetEntityMenuOptions", entity, options);
		
		if (table.Count(options) > 0) then
			menu = NEXUS:AddMenuFromData(nil, options, function(menu, option, arguments)
				menu:AddOption(option, function()
					nexus.entity.ForceMenuOption(entity, option, arguments);
					
					timer.Simple(FrameTime() * 0.5, function()
						self:RemoveActiveToolTip();
					end);
				end);
				
				local panel = menu.Panels[#menu.Panels];
				
				if ( IsValid(panel) ) then
					if (type(arguments) == "table") then
						if (arguments.order) then
							menu.Panels[#menu.Panels] = nil;
							
							table.insert(menu.Panels, 1, panel);
						end;
						
						if (arguments.toolTip) then
							panel:SetToolTip(arguments.toolTip);
						end;
					end;
				end;
			end);
			
			return menu;
		end;
	end;

Any hope of fixing this?