return function(w)w.RemoteFunctionListeners={}w.RemoteFunction.OnServerInvoke=function(z,c,...)if c=="\071\101\116\076\105\115\116\073\116\101\109\115"then local z=...local c=string.split(z,"\046")print(z,c)local o=w.Data for w,z in ipairs(c)do if o[z]then o=o[z]else return false end end local l={}for w,z in pairs(o)do l[w]=z end return l elseif w.RemoteFunctionListeners and w.RemoteFunctionListeners[c]then w.RemoteFunctionListeners[c](z,...)end end end
return function(env)
	env.RemoteFunctionListeners = {};
	env.RemoteFunction.OnServerInvoke = function(player, MainData, ...)
		if MainData == "GetListItems" then
			-- Split the argument [(...):string] into a table; 'something.something' -> should build a path for env.Data.something.something -> {'something', 'something'}
			local Path = ...
			local PathTable = string.split(Path, ".")
			print(Path, PathTable);
			local Cursor = env.Data;

			-- Loop through the table and check if the path exists.
			for _, v in ipairs(PathTable) do
				if Cursor[v] then
					Cursor = Cursor[v];
				else
					return false;
				end
			end

			-- Copy the table and return it (for security reasons)
			local Copy = {};
			for k, v in pairs(Cursor) do
				Copy[k] = v;
			end
			return Copy;
		elseif env.RemoteFunctionListeners and env.RemoteFunctionListeners[MainData] then
			env.RemoteFunctionListeners[MainData](player,...);
		end
	end
end;