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

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
