-- Decompiled with the Synapse X Luau decompiler.


local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
function CanOpenWindow()
	local v2 = v1.Variables.OpeningEgg;
	if not v2 then
		v2 = v1.Variables.UsingMachine or (v1.Variables.UsingCannon or (v1.Variables.LoadingWorld or (v1.Variables.PickingStarter or v1.Variables.Trading)));
	end;
	return not v2;
end;
local u1 = false;
local l__ID__2 = v1.Directory.Gamepasses.Teleport.ID;
function HookButton(p1)
	local l__Button__3 = p1.Button;
	local l__Name__4 = p1.Name;
	local v5 = v1.GUI[l__Name__4];
	v1.GFX.Button(l__Button__3);
	if not v5 then
		return;
	end;
	local function u3()
		if not u1 then
			u1 = true;
			if not CanOpenWindow() then
				if v5.Gui.Enabled then
					if v5.Gui.Name ~= "Trading" then
						if v5.Gui.Enabled == true then
						
							v1.Window.GuaranteeCloseCurrentWindow(l__Name__4)
						else
							v1.Window.GuaranteeOpenWindow(l__Name__4)
						end
					end;
				end;
			elseif l__Name__4 == "Teleport" then
				if not v1.Gamepasses.Owns(l__ID__2) then
					v1.Functions.PromptPurchase(l__ID__2);
				else
					if v5.Gui.Enabled == true then
						v1.Window.GuaranteeCloseCurrentWindow(l__Name__4)
					else
						v1.Window.GuaranteeOpenWindow(l__Name__4)					
					end
				end;
			else
				if v5.Gui.Enabled == true then
					v1.Window.GuaranteeCloseCurrentWindow(l__Name__4)
				else
					v1.Window.GuaranteeOpenWindow(l__Name__4)
				end
			end;
			u1 = false;
		end;
	end;
	l__Button__3.Activated:Connect(function()
		u3();
	end);
	if p1.Name == "Inventory" then
		v1.UserInputService.InputBegan:Connect(function(p2, p3)
			if not p3 then
				if p2.KeyCode ~= Enum.KeyCode.X then
					if p2.KeyCode == Enum.KeyCode.ButtonY then

					else
						return;
					end;
				else
					u3();
					return;
				end;
			else
				return;
			end;
			u3();
		end);
	end;
	if p1:FindFirstChild("Title") then
		l__Button__3.MouseEnter:Connect(function()
			if not v1.Variables.Mobile then
				p1.Title.Visible = true;
			end;
		end);
		l__Button__3.MouseLeave:Connect(function()
			if not v1.Variables.Mobile then
				p1.Title.Visible = false;
			end;
		end);
	end;
end;

	for v6, v7 in ipairs(v1.GUI.Main.LeftButtons:GetChildren()) do
	if not v6 then
		break;
	end;
	if v7:IsA("GuiObject") then

			for v9, v10 in ipairs(v7:GetChildren()) do
			if not v9 then
				break;
			end;
			if v10:IsA("GuiObject") then
				HookButton(v10);
			end;		
		end;
	end;
end;

