Lua error help

I’m getting this weird lua error from a file that i’ve never touched and didn’t add any addons lately



[ERROR] gamemodes/terrortown/gamemode/cl_lang.lua:61: attempt to index upvalue 'cached_active' (a nil value)
  1. GetTranslation - gamemodes/terrortown/gamemode/cl_lang.lua:61
   2. SetMuteState - gamemodes/terrortown/gamemode/cl_voice.lua:580
    3. CycleMuteState - gamemodes/terrortown/gamemode/cl_voice.lua:591
     4. ClearClientState - gamemodes/terrortown/gamemode/cl_init.lua:237
      5. unknown - gamemodes/terrortown/gamemode/cl_init.lua:68


any reason why

[editline]11th November 2016[/editline]

I figured it out.
For anyone with the same error you need to go to lua/includes/extensions/string.lua around line 89 there is a function called string.Explode. Like this



function string.Explode(separator, str, withpattern)	
	if ( separator == "" ) then return totable( str ) end
	if ( withpattern == nil ) then withpattern = false end

	local ret = {}
	local current_pos = 1

	for i = 1, string_len( str ) do
		local start_pos, end_pos = string_find( str, separator, current_pos, !withpattern )
		if ( !start_pos ) then break end
		ret[ i ] = string_sub( str, current_pos, start_pos - 1 )
		current_pos = end_pos + 1
	end

	ret[ #ret + 1 ] = string_sub( str, current_pos )

	return ret
end


right after the start of the function put if str == nil then str = “” end
like this



function string.Explode(separator, str, withpattern)
	if str == nil then str = "" end
	
	if ( separator == "" ) then return totable( str ) end
	if ( withpattern == nil ) then withpattern = false end

	local ret = {}
	local current_pos = 1

	for i = 1, string_len( str ) do
		local start_pos, end_pos = string_find( str, separator, current_pos, !withpattern )
		if ( !start_pos ) then break end
		ret[ i ] = string_sub( str, current_pos, start_pos - 1 )
		current_pos = end_pos + 1
	end

	ret[ #ret + 1 ] = string_sub( str, current_pos )

	return ret
end


Your “fix” is shit. Never edit any core files unless you don’t have to.

I know what your problem is.
You’ve edited the gamemode files from TTT. Because of this the gamemode is broken and a error occurs as soon as the round ends.

Edit:
Here is the reason why I know that he edited the gamemode files: The line numbers from the error message don’t match the one from the original files.

you should not edit it. But you can create a similar Function with another name like string.Explode2