local v=Frames.OptionsFrame local R=v.BaseFrame local E=v.Frames local e=nil local U=nil local Z=false local a=false local function F()for v=1,.6,-0.025 do U.Visible=true U.BackgroundTransparency=v Frames.Back.Transparency=v print(v)U=true a=true task.wait()end end local function k()for v=.6,1,.025 do U.BackgroundTransparency=v Frames.Back.Transparency=v print(v)task.wait()end U.Visible=false Z=false task.wait(.4)a=false end for v,B in pairs(Buttonsframe:GetDescendants())do if B:IsA("\084\101\120\116\066\117\116\116\111\110")then B.MouseButton1Click:Connect(function()e=B.Name.."\070\114\097\109\101"U=E:FindFirstChild(e)if not U.Visible then if not Z and not a then for v,R in pairs(R:GetDescendants())do if R:IsA("\084\101\120\116\066\117\116\116\111\110")and B.Name~=ButtonSelected then R.BackgroundTransparency=.95 R.Selectable=false B.BackgroundTransparency=.5 end end F()end else for v,R in pairs(R:GetDescendants())do if R:IsA("\084\101\120\116\066\117\116\116\111\110")and B.Name~=ButtonSelected then R.BackgroundTransparency=.6 R.Selectable=true B.BackgroundTransparency=.6 end end k()end end)end end
--OptionsManager
local OptionsFrame = Frames.OptionsFrame
local FrameBase = OptionsFrame.BaseFrame
local OptionsFrames = OptionsFrame.Frames
local OptionFrameName = nil
local OptionFrameToOpen = nil
local OptionFrameIsOpened = false
local OptionDebounce = false

local function OptionOpenGUI()
	for i = 1, 0.6, -0.025 do
		OptionFrameToOpen.Visible = true
		OptionFrameToOpen.BackgroundTransparency = i
		Frames.Back.Transparency = i
		print(i)
		OptionFrameToOpen = true
		OptionDebounce = true
		task.wait()
	end
end

local function OptionCloseGUI()
	for i = 0.6, 1, 0.025 do
		OptionFrameToOpen.BackgroundTransparency = i
		Frames.Back.Transparency = i
		print(i)
		task.wait()
	end
	OptionFrameToOpen.Visible = false
	OptionFrameIsOpened = false
	task.wait(0.4)
	OptionDebounce = false
end

for _, OptionButton in pairs(Buttonsframe:GetDescendants()) do
	if OptionButton:IsA("TextButton") then
		OptionButton.MouseButton1Click:Connect(function()
			OptionFrameName = OptionButton.Name .. "Frame"
			OptionFrameToOpen = OptionsFrames:FindFirstChild(OptionFrameName)
			if not OptionFrameToOpen.Visible then
				if not OptionFrameIsOpened and not OptionDebounce then
					for _, OptionButtons in pairs(FrameBase:GetDescendants()) do
						if OptionButtons:IsA("TextButton") and OptionButton.Name ~= ButtonSelected then
							OptionButtons.BackgroundTransparency = 0.95
							OptionButtons.Selectable = false
							OptionButton.BackgroundTransparency = 0.5
						end
					end
					OptionOpenGUI()
				end
			else
				for _, OptionButtons in pairs(FrameBase:GetDescendants()) do
					if OptionButtons:IsA("TextButton") and OptionButton.Name ~= ButtonSelected then
						OptionButtons.BackgroundTransparency = 0.6
						OptionButtons.Selectable = true
						OptionButton.BackgroundTransparency = 0.6
					end
				end
				OptionCloseGUI()
			end
		end)
	end
end
