Script error TTT

I keep getting this error. Anyone know why its happening?

[lua]

[ERROR] lua/includes/extensions/table.lua:51: bad argument #1 to ‘pairs’ (table expected, got nil)

  1. pairs - [C]:-1
  2. Empty - lua/includes/extensions/table.lua:51
    3. fn - addons/ulx/lua/ulx/modules/cl/xgui_client.lua:428
    4. func - addons/ulib/lua/ulib/client/cl_util.lua:22
    5. unknown - lua/includes/modules/net.lua:32[/lua]

The grand thing about Lua errors is half the time what they tell you is descriptive enough to fix it! Some code somewhere is trying to loop through a table with an “in pairs” loop but the table either doesnt exist or is empty. That code seems to be coming from ULX based off the filenames in the error.

Try updating ULX or reinstalling it as that would probably be the easiest. I dont really know enough about Ulx to understand why that happens

Line 428 is


table.Empty( xgui.data[datatype] )

This originates from the noted ulib file in this function:


local function ULibRPC()
	local fn_string = net.ReadString()
	local args = net.ReadTable()
	local fn = ULib.findVar( fn_string )
	if type( fn ) ~= "function" then return error( "Received bad RPC, invalid function (" .. tostring( fn_string ) .. ")!" ) end

	-- Since the table length operator can't always be trusted if there are holes in it, find the length by ourself
	local max = 0
	for k, v in pairs( args ) do
		local n = tonumber( k )
		if n and n > max then
			max = n
		end
	end

	fn( unpack( args, 1, max ) )
end
net.Receive( "URPC", ULibRPC )

It means that, essentially, it is being sent a datatype it doesn’t understand.

If you don’t have it up to date already, you should definitely update ulib and ulx as Exho said since this seems to be all background functionality unless you’ve been tinkering.

The ulib and ulx addons are fresh. I just added them to the server, which is a new server. I added other addons and added files to the ulx addon itself when it started doing it. But I have the exact same addons on another server and I dont get this error.

[editline]4th October 2014[/editline]

ok, guess its my APromote addon. Works fine on my other servers, know why it might cause errors on ttt?

[editline]4th October 2014[/editline]

Alright figured it out. I didn’t have the APromote addon added to my workshop collection -_- didn’t even know it was necessary