local k=script:FindFirstAncestor("\077\097\105\110\085\073")local u=game.Players.LocalPlayer local B=require(script.Parent)local R=game["\082\117\110 \083\101\114\118\105\099\101"]local H=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local O=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local z=game:GetService("\071\117\105\083\101\114\118\105\099\101")local t=game:GetService("\077\097\114\107\101\116\112\108\097\099\101\083\101\114\118\105\099\101")local X=script.Parent.Parent.Parent local j=(X:WaitForChild("\076\111\098\098\121\070\114\097\109\101")):WaitForChild("\083\105\100\101\066\117\116\116\111\110\115")local v=(X:WaitForChild("\076\111\098\098\121\070\114\097\109\101")):WaitForChild("\083\104\111\112")local S=(X:WaitForChild("\076\111\098\098\121\070\114\097\109\101")):WaitForChild("\065\099\104\105\101\118\101\109\101\110\116\115")local C=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\082\101\112\108\105\099\097\068\097\116\097\077\111\100\117\108\101"))local G=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\065\099\104\105\101\118\101\109\101\110\116\115"))local E=require(((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\067\108\105\101\110\116\077\111\100\117\108\101\115")):WaitForChild("\071\101\116\080\114\111\100\117\099\116\080\114\105\099\101"))local Q=require((game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")):WaitForChild("\080\114\111\100\117\099\116\115"))while true do wait(.5)if X.LobbyFrame.WarningScreen.Visible==false then break end end j.Visible=true j:TweenPosition(UDim2.new(0,0,.5,50),"\079\117\116","\081\117\097\100",1,true)local l=O.GamepadEnabled function update()if l then if v.Visible then z.SelectedObject=v.Frame.Products.Boost elseif S.Visible then z.SelectedObject=S.Frame else z.SelectedObject=nil end else z.SelectedObject=nil end if S.Visible then return end if v.Visible then if C.data then if C.data.PaidInKnobs then if 2400<=C.data.PaidInKnobs then v.Frame.Products.Frame[1].Visible=false v.Frame.Products.Frame[2].Visible=false v.Frame.Products.Frame[3].Visible=false v.Frame.Products.Frame[4].Visible=false v.Frame.Products.Frame[5].Visible=true v.Frame.Products.Frame[6].Visible=true v.Frame.Products.Frame[7].Visible=true v.Frame.Products.Frame.Back.Visible=true end end end end end j.ButtonShop.MouseButton1Down:Connect(function()v.Visible=not v.Visible S.Visible=false update()end)j.ButtonAchievements.MouseButton1Down:Connect(function()S.Visible=not S.Visible v.Visible=false update()end)v.CloseButton.MouseButton1Down:Connect(function()v.Visible=false update()end);(v:WaitForChild("\067\111\100\101")).Confirm.MouseButton1Down:Connect(function()game.ReplicatedStorage.Bricks.ShopCode:FireServer(v.Code.Text)end);(v:WaitForChild("\067\111\100\101")).ReturnPressedFromOnScreenKeyboard:Connect(function()game.ReplicatedStorage.Bricks.ShopCode:FireServer(v.Code.Text)end);(v:WaitForChild("\067\111\100\101")).FocusLost:Connect(function()game.ReplicatedStorage.Bricks.ShopCode:FireServer(v.Code.Text)end)S.CloseButton.MouseButton1Down:Connect(function()S.Visible=false update()end)for k,B in v()do if B:IsA("\084\101\120\116\066\117\116\116\111\110")then if B:GetAttribute("\080\114\111\100\117\099\116\073\068")~=nil and(B.Visible or B:GetAttribute("\068\111\065\110\121\119\097\121"))then B.Price.Text=E(B:GetAttribute("\080\114\111\100\117\099\116\073\068"))B.MouseButton1Down:Connect(function()t:PromptProductPurchase(u,B:GetAttribute("\080\114\111\100\117\099\116\073\068"))end)elseif B:GetAttribute("\066\117\121\080\114\101\109\105\117\109")then B.MouseButton1Down:Connect(function()t:PromptPremiumPurchase(u)end)pcall(function()if u.MembershipType==Enum.MembershipType.Premium then B.Visible=false end end)elseif B:GetAttribute("\071\111\066\097\099\107")then v.Frame.Products.Frame[1].Visible=true v.Frame.Products.Frame[2].Visible=true v.Frame.Products.Frame[3].Visible=true v.Frame.Products.Frame[4].Visible=true v.Frame.Products.Frame[5].Visible=false v.Frame.Products.Frame[6].Visible=false v.Frame.Products.Frame[7].Visible=false v.Frame.Products.Frame.Back.Visible=false end end end O.InputBegan:Connect(function(k,u)if u then return end if k.KeyCode==Enum.KeyCode.ButtonB then v.Visible=false S.Visible=false update()return end if k.KeyCode==Enum.KeyCode.ButtonX then if not z.SelectedObject then z.SelectedObject=j.ButtonShop return end else return end v.Visible=false S.Visible=false z.SelectedObject=nil end)local function e()l=O.GamepadEnabled for k,u in pairs((game:GetService("\067\111\108\108\101\099\116\105\111\110\083\101\114\118\105\099\101")):GetTagged("\088\066\111\120"))do u.Visible=l end end O.GamepadConnected:Connect(e)O.GamepadDisconnected:Connect(e)l=O.GamepadEnabled for k,u in pairs((game:GetService("\067\111\108\108\101\099\116\105\111\110\083\101\114\118\105\099\101")):GetTagged("\088\066\111\120"))do u.Visible=l end while true do wait(1)if C.data then break end end for k,u in pairs(S.List:GetChildren())do if u:IsA("\073\109\097\103\101\066\117\116\116\111\110")and u.Visible then u:Destroy()end end if C.data then local k,u,B=pairs(G)while true do local R,H=k(u,B)if not R then break end local O=H:GetInfo()local z=S.List.Badge:Clone()for k,u in pairs(O)do z:SetAttribute(k,u)end z.Image=O.Image z.Name="\065\099\104\105\101\118\101\109\101\110\116"..O.Name z.Parent=S.List z.LayoutOrder=1000+O.Category z.Visible=true if table.find(C.data.Achievements,O.Name)then z.ImageColor3=Color3.new(1,1,1)z.ImageTransparency=0 z.LayoutOrder=z.LayoutOrder-1000 z.UIStroke.Enabled=false O.Hidden=-1 end local function t()S.Frame.Title.Text=O.Hidden<3 and O.Title or"\076\111\099\107\101\100 \065\099\104\105\101\118\101\109\101\110\116"S.Frame.Desc.Text=O.Hidden<2 and O.Desc or"\085\110\108\111\099\107 \116\104\105\115 \097\099\104\105\101\118\101\109\101\110\116 \116\111 \118\105\101\119 \105\116\115 \100\101\115\099\114\105\112\116\105\111\110\033"S.Frame.Reason.Text=O.Hidden<1 and O.Reason or""S.Frame.ImageLabel.Image=O.Image S.Frame.Visible=true end z.MouseButton1Down:Connect(t)z.SelectionGained:Connect(t)end end


local v1 = script:FindFirstAncestor("MainUI");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v3 = require(script.Parent);
local v4 = game["Run Service"];
local l__TweenService__5 = game:GetService("TweenService");
local l__UserInputService__6 = game:GetService("UserInputService");
local l__GuiService__7 = game:GetService("GuiService");
local l__MarketplaceService__8 = game:GetService("MarketplaceService");
local l__Parent__9 = script.Parent.Parent.Parent;
local l__SideButtons__10 = l__Parent__9:WaitForChild("LobbyFrame"):WaitForChild("SideButtons");
local l__Shop__11 = l__Parent__9:WaitForChild("LobbyFrame"):WaitForChild("Shop");
local l__Achievements__12 = l__Parent__9:WaitForChild("LobbyFrame"):WaitForChild("Achievements");
local v13 = require(game:GetService("ReplicatedStorage"):WaitForChild("ReplicaDataModule"));
local v14 = require(game:GetService("ReplicatedStorage"):WaitForChild("Achievements"));
local v15 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientModules"):WaitForChild("GetProductPrice"));
local v16 = require(game:GetService("ReplicatedStorage"):WaitForChild("Products"));
while true do
	wait(0.5);
	if l__Parent__9.LobbyFrame.WarningScreen.Visible == false then
		break;
	end;
end;
l__SideButtons__10.Visible = true;
l__SideButtons__10:TweenPosition(UDim2.new(0, 0, 0.5, 50), "Out", "Quad", 1, true);
local u1 = l__UserInputService__6.GamepadEnabled;
function update()
	if u1 then
		if l__Shop__11.Visible then
			l__GuiService__7.SelectedObject = l__Shop__11.Frame.Products.Boost;
		elseif l__Achievements__12.Visible then
			l__GuiService__7.SelectedObject = l__Achievements__12.Frame;
		else
			l__GuiService__7.SelectedObject = nil;
		end;
	else
		l__GuiService__7.SelectedObject = nil;
	end;
	if l__Achievements__12.Visible then
		return;
	end;
	if l__Shop__11.Visible then
		if v13.data then
			if v13.data.PaidInKnobs then
				if 2400 <= v13.data.PaidInKnobs then
					l__Shop__11.Frame.Products.Frame[1].Visible = false;
					l__Shop__11.Frame.Products.Frame[2].Visible = false;
					l__Shop__11.Frame.Products.Frame[3].Visible = false;
					l__Shop__11.Frame.Products.Frame[4].Visible = false;
					l__Shop__11.Frame.Products.Frame[5].Visible = true;
					l__Shop__11.Frame.Products.Frame[6].Visible = true;
					l__Shop__11.Frame.Products.Frame[7].Visible = true;
					l__Shop__11.Frame.Products.Frame.Back.Visible = true;
				end;
			end;
		end;
	end;
end;
l__SideButtons__10.ButtonShop.MouseButton1Down:Connect(function()
	l__Shop__11.Visible = not l__Shop__11.Visible;
	l__Achievements__12.Visible = false;
	update();
end);
l__SideButtons__10.ButtonAchievements.MouseButton1Down:Connect(function()
	l__Achievements__12.Visible = not l__Achievements__12.Visible;
	l__Shop__11.Visible = false;
	update();
end);
l__Shop__11.CloseButton.MouseButton1Down:Connect(function()
	l__Shop__11.Visible = false;
	update();
end);
l__Shop__11:WaitForChild("Code").Confirm.MouseButton1Down:Connect(function()
	game.ReplicatedStorage.Bricks.ShopCode:FireServer(l__Shop__11.Code.Text);
end);
l__Shop__11:WaitForChild("Code").ReturnPressedFromOnScreenKeyboard:Connect(function()
	game.ReplicatedStorage.Bricks.ShopCode:FireServer(l__Shop__11.Code.Text);
end);
l__Shop__11:WaitForChild("Code").FocusLost:Connect(function()
	game.ReplicatedStorage.Bricks.ShopCode:FireServer(l__Shop__11.Code.Text);
end);
l__Achievements__12.CloseButton.MouseButton1Down:Connect(function()
	l__Achievements__12.Visible = false;
	update();
end);
for v17, v18 in l__Shop__11() do
	if v18:IsA("TextButton") then
		if v18:GetAttribute("ProductID") ~= nil and (v18.Visible or v18:GetAttribute("DoAnyway")) then
			v18.Price.Text = v15(v18:GetAttribute("ProductID"));
			v18.MouseButton1Down:Connect(function()
				l__MarketplaceService__8:PromptProductPurchase(l__LocalPlayer__2, v18:GetAttribute("ProductID"));
			end);
		elseif v18:GetAttribute("BuyPremium") then
			v18.MouseButton1Down:Connect(function()
				l__MarketplaceService__8:PromptPremiumPurchase(l__LocalPlayer__2);
			end);
			pcall(function()
				if l__LocalPlayer__2.MembershipType == Enum.MembershipType.Premium then
					v18.Visible = false;
				end;
			end);
		elseif v18:GetAttribute("GoBack") then
			l__Shop__11.Frame.Products.Frame[1].Visible = true;
			l__Shop__11.Frame.Products.Frame[2].Visible = true;
			l__Shop__11.Frame.Products.Frame[3].Visible = true;
			l__Shop__11.Frame.Products.Frame[4].Visible = true;
			l__Shop__11.Frame.Products.Frame[5].Visible = false;
			l__Shop__11.Frame.Products.Frame[6].Visible = false;
			l__Shop__11.Frame.Products.Frame[7].Visible = false;
			l__Shop__11.Frame.Products.Frame.Back.Visible = false;
		end;
	end;
end;
l__UserInputService__6.InputBegan:Connect(function(p1, p2)
	if p2 then
		return;
	end;
	if p1.KeyCode == Enum.KeyCode.ButtonB then
		l__Shop__11.Visible = false;
		l__Achievements__12.Visible = false;
		update();
		return;
	end;
	if p1.KeyCode == Enum.KeyCode.ButtonX then
		if not l__GuiService__7.SelectedObject then
			l__GuiService__7.SelectedObject = l__SideButtons__10.ButtonShop;
			return;
		end;
	else
		return;
	end;
	l__Shop__11.Visible = false;
	l__Achievements__12.Visible = false;
	l__GuiService__7.SelectedObject = nil;
end);
local function v19()
	u1 = l__UserInputService__6.GamepadEnabled;
	for v20, v21 in pairs(game:GetService("CollectionService"):GetTagged("XBox")) do
		v21.Visible = u1;
	end;
end;
l__UserInputService__6.GamepadConnected:Connect(v19);
l__UserInputService__6.GamepadDisconnected:Connect(v19);
u1 = l__UserInputService__6.GamepadEnabled;
for v22, v23 in pairs(game:GetService("CollectionService"):GetTagged("XBox")) do
	v23.Visible = u1;
end;
while true do
	wait(1);
	if v13.data then
		break;
	end;
end;
for v24, v25 in pairs(l__Achievements__12.List:GetChildren()) do
	if v25:IsA("ImageButton") and v25.Visible then
		v25:Destroy();
	end;
end;
if v13.data then
	local v26, v27, v28 = pairs(v14);
	while true do
		local v29, v30 = v26(v27, v28);
		if not v29 then
			break;
		end;
		local v31 = v30:GetInfo();
		local v32 = l__Achievements__12.List.Badge:Clone();
		for v33, v34 in pairs(v31) do
			v32:SetAttribute(v33, v34);
		end;
		v32.Image = v31.Image;
		v32.Name = "Achievement" .. v31.Name;
		v32.Parent = l__Achievements__12.List;
		v32.LayoutOrder = 1000 + v31.Category;
		v32.Visible = true;
		if table.find(v13.data.Achievements, v31.Name) then
			v32.ImageColor3 = Color3.new(1, 1, 1);
			v32.ImageTransparency = 0;
			v32.LayoutOrder = v32.LayoutOrder - 1000;
			v32.UIStroke.Enabled = false;
			v31.Hidden = -1;
		end;
		local function v35()
			l__Achievements__12.Frame.Title.Text = v31.Hidden < 3 and v31.Title or "Locked Achievement";
			l__Achievements__12.Frame.Desc.Text = v31.Hidden < 2 and v31.Desc or "Unlock this achievement to view its description!";
			l__Achievements__12.Frame.Reason.Text = v31.Hidden < 1 and v31.Reason or "";
			l__Achievements__12.Frame.ImageLabel.Image = v31.Image;
			l__Achievements__12.Frame.Visible = true;
		end;
		v32.MouseButton1Down:Connect(v35);
		v32.SelectionGained:Connect(v35);	
	end;
end;
