local l=nil;(coroutine.wrap(function()l=require(game.ReplicatedStorage:WaitForChild("\082\101\115\111\117\114\099\101\115"))end))()local b={}b={Add=function(A,L,K)local a=l.Saving.Get(A)if not a then return end local Z=l.Directory.Achievements[L]if not Z then return end local M=a.Achievements[L]if not M then a.Achievements[L]={stage=1,progress=0}M=a.Achievements[L]end M.progress=M.progress+K local R=M.stage if Z[R]and Z[R].amount<=M.progress then b.Advance(A,L)end end,Advance=function(A,L)local K=l.Saving.Get(A)if not K then return end local a=l.Directory.Achievements[L]local Z=K.Achievements[L]Z.stage=Z.stage+1 Z.progress=0 b.Reward(A,L,Z.stage-1);(coroutine.wrap(function()l.Signal.Fire("\065\099\104\105\101\118\101\109\101\110\116 \067\111\109\112\108\101\116\101\100",A,L,Z.stage)l.Network.Fire("\065\099\104\105\101\118\101\109\101\110\116 \067\111\109\112\108\101\116\101\100",A,L,Z.stage)l.Network.FireAll("\070\105\114\101\119\111\114\107\115 \065\110\105\109\097\116\105\111\110",A)end))()end}local A=Random.new()function b.Reward(b,L,K)if not l.Saving.Get(b)then return end local a=l.Directory.Achievements[L][K]local Z=a.rewardType local M=a.reward if Z~="\068\105\097\109\111\110\100\115"and Z~="\067\111\105\110\115"then if Z=="\080\101\116"then l.Pets.Create(b,M,nil,true)return elseif Z=="\071\111\108\100\101\110\080\101\116"then local L=l.Directory.Pets[M]l.Pets.Create(b,M,{g=true;s=A:NextInteger(L.strengthMin,L.strengthMax)*l.Settings.GoldPetsMult},true,nil,true)return elseif Z=="\082\097\105\110\098\111\119\080\101\116"then local L=l.Directory.Pets[M]l.Pets.Create(b,M,{r=true,s=A:NextInteger(L.strengthMin,L.strengthMax)*l.Settings.RainbowPetsMult},true,nil,true)if L.rarity=="\069\120\099\108\117\115\105\118\101"then end return elseif Z=="\068\097\114\107\077\097\116\116\101\114\080\101\116"then local L=l.Directory.Pets[M]l.Pets.Create(b,M,{dm=true;s=A:NextInteger(L.strengthMin,L.strengthMax)*l.Settings.DarkMatterPetsMult},true,nil,true)return else if Z=="\083\108\111\116\115"then l.Give.Slots(b,M)end return end end l.Give.Currency(b,M,Z)end return b


local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local u2 = {}
 u2 = {
	Add = function(p1, p2, p3)
		local v1 = u1.Saving.Get(p1);
		if not v1 then
			return;
		end;
		local v2 = u1.Directory.Achievements[p2];
		if not v2 then
			return;
		end;
		local v3 = v1.Achievements[p2];
		if not v3 then
			v1.Achievements[p2] = {
				stage = 1, 
				progress = 0
			};
			v3 = v1.Achievements[p2];
		end;
		v3.progress = v3.progress + p3;
		local l__stage__4 = v3.stage;
		if v2[l__stage__4] and v2[l__stage__4].amount <= v3.progress then
			u2.Advance(p1, p2);
		end;
	end, 
	Advance = function(p4, p5)
		local v5 = u1.Saving.Get(p4);
		if not v5 then
			return;
		end;
		local v6 = u1.Directory.Achievements[p5];
		local v7 = v5.Achievements[p5];
		v7.stage = v7.stage + 1;
		v7.progress = 0;
		u2.Reward(p4, p5, v7.stage - 1);
		coroutine.wrap(function()
			u1.Signal.Fire("Achievement Completed", p4, p5, v7.stage);
			u1.Network.Fire("Achievement Completed", p4, p5, v7.stage);
			u1.Network.FireAll("Fireworks Animation", p4);
		end)();
	end
};
local u3 = Random.new();
function u2.Reward(p6, p7, p8)
	if not u1.Saving.Get(p6) then
		return;
	end;
	local v8 = u1.Directory.Achievements[p7][p8];
	local l__rewardType__9 = v8.rewardType;
	local l__reward__10 = v8.reward;
	if l__rewardType__9 ~= "Diamonds" and l__rewardType__9 ~= "Coins" then
		if l__rewardType__9 == "Pet" then
			u1.Pets.Create(p6, l__reward__10, nil, true);
			return;
		elseif l__rewardType__9 == "GoldenPet" then
			local v11 = u1.Directory.Pets[l__reward__10];
			u1.Pets.Create(p6, l__reward__10, {
				g = true, 
				s = u3:NextInteger(v11.strengthMin, v11.strengthMax) * u1.Settings.GoldPetsMult
			}, true, nil, true);
			return;
		elseif l__rewardType__9 == "RainbowPet" then
			local v12 = u1.Directory.Pets[l__reward__10];
			u1.Pets.Create(p6, l__reward__10, {
				r = true, 
				s = u3:NextInteger(v12.strengthMin, v12.strengthMax) * u1.Settings.RainbowPetsMult
			}, true, nil, true);
			if v12.rarity == 'Exclusive' then
				
			end
			return;
		elseif l__rewardType__9 == "DarkMatterPet" then
			local v13 = u1.Directory.Pets[l__reward__10];
			u1.Pets.Create(p6, l__reward__10, {
				dm = true, 
				s = u3:NextInteger(v13.strengthMin, v13.strengthMax) * u1.Settings.DarkMatterPetsMult
			}, true, nil, true);
			return;
		else
			if l__rewardType__9 == "Slots" then
				u1.Give.Slots(p6, l__reward__10);
			end;
			return;
		end;
	end;
	u1.Give.Currency(p6, l__reward__10, l__rewardType__9);
end;
return u2;
