Applejack cl_init.lua error

Hello,

I’m trying to set up Applejack for my personal server but I keep getting this error:

[ERROR] gamemodes/applejack/gamemode/cl_init.lua:944: attempt to index field ‘Config’ (a nil value)

  1. unknown - gamemodes/applejack/gamemode/cl_init.lua:944

Here’s the code around 944:


-- Called every frame.
function GM:Think()
	if ( self.Config["Local Voice"] ) then
		for k, v in pairs( player.GetAll() ) do
			if ( hook.Call("PlayerCanVoice",GAMEMODE, v) ) then
				if ( v:IsMuted() ) then v:SetMuted(); end
			else
				if ( !v:IsMuted() ) then v:SetMuted(); end
			end
		end
	end

Can anyone help?

GM.Config doesn’t exist in that realm ( client / server ) or doesn’t exist at all.

Find out why, in the mean time, this should prevent the error, and make it work once self.Config is valid:



if ( self.Config and self.Config[ "Local Voice" ] ) then
    ...
end


It fixed it, thank you!