local V=nil;(coroutine.wrap(function()V=require(game.ReplicatedStorage:WaitForChild("\082\101\115\111\117\114\099\101\115"))end))()local B B={HasAccess=function(I,b)if not V.Saving.Get(I)then return false end local K=V.Directory.Worlds[b]if not K then return false end local D=K.requiredArea if D and not B.HasArea(I,D)then return false end return true end}local I=game.ServerStorage:WaitForChild("\095\095\087\079\082\076\068\083")function B.Load(b,K)if b then local D=V.Saving.Get(b)local J=b:FindFirstChild("\080\108\097\121\101\114\071\117\105")if D and J then local W=V.Directory.Worlds[K]if not W or W.disabled then print("\084\114\105\101\100 \116\111 \108\111\097\100 \119\111\114\108\100 "..(K.."\044 \100\111\101\115\110\'\116 \101\120\105\115\116"),true)K="\083\112\097\119\110"end if not V.Shared.IsTradingPlaza and K=="\084\114\097\100\105\110\103 \080\108\097\122\097"then K="\083\112\097\119\110"elseif V.Shared.IsTradingPlaza then K="\084\114\097\100\105\110\103 \080\108\097\122\097"end if not B.HasAccess(b,K)then print("\067\104\097\110\103\105\110\103 "..(b.Name.."\'\115 \119\111\114\108\100 \116\111 \083\112\097\119\110 \098\101\099\097\117\115\101 \114\101\113\117\101\115\116\101\100 \119\111\114\108\100 \105\115 \108\111\099\107\101\100"))K="\083\112\097\119\110"end if K=="\086\111\105\100"and not D.HackerPortalUnlocked then print("\067\104\097\110\103\105\110\103 "..(b.Name.."\'\115 \119\111\114\108\100 \116\111 \083\112\097\119\110 \098\101\099\097\117\115\101 \104\101 \100\111\101\115 \110\111\116 \104\097\118\101 \116\104\101 \104\097\099\107\101\114 \112\111\114\116\097\108 \117\110\108\111\099\107\101\100"))K="\083\112\097\119\110"end if K=="\070\097\110\116\097\115\121"then(coroutine.wrap(function()wait(3)if not B.HasArea(b,"\069\110\099\104\097\110\116\101\100 \070\111\114\101\115\116")then B.GiveArea(b,"\069\110\099\104\097\110\116\101\100 \070\111\114\101\115\116")B.GiveArea(b,"\070\097\110\116\097\115\121 \083\104\111\112")V.Achievements.Add(b,"\085\110\108\111\099\107 \070\097\110\116\097\115\121",1)end end))()elseif K=="\084\101\099\104"then(coroutine.wrap(function()wait(3)if not B.HasArea(b,"\084\101\099\104 \067\105\116\121")then B.GiveArea(b,"\084\101\099\104 \067\105\116\121")B.GiveArea(b,"\084\101\099\104 \083\104\111\112")V.Achievements.Add(b,"\085\110\108\111\099\107 \084\101\099\104",1)end end))()elseif K=="\083\101\099\114\101\116"then(coroutine.wrap(function()wait(3)B.GiveArea(b,"\067\097\116")end))()elseif K=="\084\114\097\100\105\110\103 \080\108\097\122\097"then(coroutine.wrap(function()wait(3)B.GiveArea(b,"\080\108\097\122\097 \080\114\101\115\101\110\116\115")V.Achievements.Add(b,"\074\111\105\110 \084\114\097\100\105\110\103 \080\108\097\122\097",1)end))()elseif K=="\072\097\108\108\111\119\101\101\110 \069\118\101\110\116"then(coroutine.wrap(function()wait(3)B.GiveArea(b,"\072\097\108\108\111\119\101\101\110")V.Achievements.Add(b,"\072\097\108\108\111\119\101\101\110 \050\048\050\049",1)end))()elseif K=="\067\104\114\105\115\116\109\097\115 \069\118\101\110\116"then(coroutine.wrap(function()wait(3)B.GiveArea(b,"\067\104\114\105\115\116\109\097\115")V.Achievements.Add(b,"\067\104\114\105\115\116\109\097\115 \050\048\050\049",1)end))()elseif K=="\086\111\105\100"then(coroutine.wrap(function()wait(3)if not B.HasArea(b,"\084\104\101 \086\111\105\100")then B.GiveArea(b,"\084\104\101 \086\111\105\100")V.Achievements.Add(b,"\085\110\108\111\099\107 \086\111\105\100",1)end end))()elseif K=="\065\120\111\108\111\116\108 \079\099\101\097\110"then(coroutine.wrap(function()wait(3)if not B.HasArea(b,"\065\120\111\108\111\116\108 \079\099\101\097\110")then B.GiveArea(b,"\065\120\111\108\111\116\108 \079\099\101\097\110")V.Achievements.Add(b,"\085\110\108\111\099\107 \065\120\111\108\111\116\108 \079\099\101\097\110",1)end end))()elseif K=="\080\105\120\101\108"then(coroutine.wrap(function()wait(3)if not B.HasArea(b,"\080\105\120\101\108 \070\111\114\101\115\116")then B.GiveArea(b,"\080\105\120\101\108 \070\111\114\101\115\116")V.Achievements.Add(b,"\085\110\108\111\099\107 \080\105\120\101\108 \087\111\114\108\100",1)end end))()end local g=(I:FindFirstChild(K)):Clone()g.Name="\095\095\077\065\080"g.Parent=J D.World=K V.Signal.Fire("\087\111\114\108\100 \067\104\097\110\103\101\100",b,K)end end end function B.GetNetworkList(B)local I={}for b,K in ipairs(game.Players:GetPlayers())do local D=V.Saving.Get(K)if D and B==D.World then table.insert(I,K)end end return I end function B.HasArea(B,I)local b=V.Saving.Get(B)if b and V.Functions.SearchDictionary(b.AreasUnlocked,I)then return true end return false end function B.GiveArea(I,b)local K=V.Saving.Get(I)if not K or not(not B.HasArea(I,b))then return end table.insert(K.AreasUnlocked,b)return true end;(V.Network.Fired("\082\101\113\117\101\115\116 \087\111\114\108\100")):Connect(B.Load)return B


local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local u2
u2 = {
	HasAccess = function(p1, p2)
		if not u1.Saving.Get(p1) then
			return false;
		end;
		local v1 = u1.Directory.Worlds[p2];
		if not v1 then
			return false;
		end;
		local l__requiredArea__2 = v1.requiredArea;
		if l__requiredArea__2 and not u2.HasArea(p1, l__requiredArea__2) then
			return false;
		end;
		return true;
	end
};
local l____WORLDS__3 = game.ServerStorage:WaitForChild("__WORLDS");
function u2.Load(p3, p4)
	if p3 then
		local v3 = u1.Saving.Get(p3);
		local l__PlayerGui__4 = p3:FindFirstChild("PlayerGui");
		if v3 and l__PlayerGui__4 then
			local v5 = u1.Directory.Worlds[p4];
			if not v5 or v5.disabled then
				print("Tried to load world " .. p4 .. ", doesn't exist", true);
				p4 = "Spawn";
			end;
			if not u1.Shared.IsTradingPlaza and p4 == "Trading Plaza" then
				p4 = "Spawn";
			elseif u1.Shared.IsTradingPlaza then
				p4 = "Trading Plaza";
			end;
			if not u2.HasAccess(p3, p4) then
				print("Changing " .. p3.Name .. "'s world to Spawn because requested world is locked");
				p4 = "Spawn";
			end;
			if p4 == 'Void' and not v3.HackerPortalUnlocked then
				print("Changing " .. p3.Name .. "'s world to Spawn because he does not have the hacker portal unlocked");
				p4 = "Spawn";
			end
			if p4 == "Fantasy" then
				coroutine.wrap(function()
					wait(3);
					if not u2.HasArea(p3, "Enchanted Forest") then
						u2.GiveArea(p3, "Enchanted Forest");
						u2.GiveArea(p3, "Fantasy Shop");
						u1.Achievements.Add(p3, "Unlock Fantasy", 1);
					end;
				end)();
			elseif p4 == "Tech" then
				coroutine.wrap(function()
					wait(3);
					if not u2.HasArea(p3, "Tech City") then
						u2.GiveArea(p3, "Tech City");
						u2.GiveArea(p3, "Tech Shop");
						u1.Achievements.Add(p3, "Unlock Tech", 1);
					end;
				end)();
			elseif p4 == 'Secret' then
				coroutine.wrap(function()
					wait(3);
					u2.GiveArea(p3, "Cat");
				end)();
			elseif p4 == "Trading Plaza" then
				coroutine.wrap(function()
					wait(3);
					u2.GiveArea(p3, "Plaza Presents");
					u1.Achievements.Add(p3, "Join Trading Plaza", 1);
				end)();
			elseif p4 == "Halloween Event" then
				coroutine.wrap(function()
					wait(3);
					u2.GiveArea(p3, "Halloween");
					u1.Achievements.Add(p3, "Halloween 2021", 1);
				end)();
			elseif p4 == "Christmas Event" then
				coroutine.wrap(function()
					wait(3);
					u2.GiveArea(p3, "Christmas");
					u1.Achievements.Add(p3, "Christmas 2021", 1);
				end)();
			elseif p4 == "Void" then
				coroutine.wrap(function()
					wait(3);
					if not u2.HasArea(p3, "The Void") then
						u2.GiveArea(p3, "The Void");
						u1.Achievements.Add(p3, "Unlock Void", 1);
					end;
				end)();
			elseif p4 == "Axolotl Ocean" then
				coroutine.wrap(function()
					wait(3);
					if not u2.HasArea(p3, "Axolotl Ocean") then
						u2.GiveArea(p3, "Axolotl Ocean");
						u1.Achievements.Add(p3, "Unlock Axolotl Ocean", 1);
					end;
				end)();
			elseif p4 == "Pixel" then
				coroutine.wrap(function()
					wait(3);
					if not u2.HasArea(p3, "Pixel Forest") then
						u2.GiveArea(p3, "Pixel Forest");
						u1.Achievements.Add(p3, "Unlock Pixel World", 1);
					end;
				end)();
			end;
			local v6 = l____WORLDS__3:FindFirstChild(p4):Clone();
			v6.Name = "__MAP";
			v6.Parent = l__PlayerGui__4;
			v3.World = p4;
			u1.Signal.Fire("World Changed", p3, p4);
		end;
	end;
end;
function u2.GetNetworkList(p5)
	local v7 = {};
	for v8, v9 in ipairs(game.Players:GetPlayers()) do
		local v10 = u1.Saving.Get(v9);
		if v10 and p5 == v10.World then
			table.insert(v7, v9);
		end;
	end;
	return v7;
end;
function u2.HasArea(p6, p7)
	local v11 = u1.Saving.Get(p6);
	if v11 and u1.Functions.SearchDictionary(v11.AreasUnlocked, p7) then
		return true;
	end;
	return false;
end;
function u2.GiveArea(p8, p9)
	local v12 = u1.Saving.Get(p8);
	if not v12 or not (not u2.HasArea(p8, p9)) then
		return;
	end;
	table.insert(v12.AreasUnlocked, p9);
	return true;
end;
u1.Network.Fired('Request World'):Connect(u2.Load)
return u2;
