client,service=nil,nil return function(z,y)local C if y then setfenv(1,y)end local v=y.client local x=y.service local W=y.gui local c=v.UI local V=v.Remote local h=v.Variables local m=v.Functions local L=v.Deps local U=c.Make("\087\105\110\100\111\119",{Name="\083\101\116\116\105\110\103\115",Title="\083\101\116\116\105\110\103\115",Size={225;200};AllowMultiple=false})local Y={{Text="\075\101\121\098\105\110\100\115\058 ",Desc="- \069\110\097\098\108\101\115\047\068\105\115\097\098\108\101\115 \075\101\121\098\105\110\100\115";Entry="\066\111\111\108\101\097\110";Value=h.KeybindsEnabled;Function=function(z,y)h.KeybindsEnabled=z local C=y.Text y.Text="\083\097\118\105\110\103\046\046"V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\075\101\121\098\105\110\100\115\069\110\097\098\108\101\100",z)y.Text=C end},{Text="\085\073 \075\101\101\112 \065\108\105\118\101\058 ";Desc="- \080\114\101\118\101\110\116\115 \065\100\111\110\105\115 \085\073 \100\101\108\101\116\105\111\110 \111\110 \100\101\097\116\104";Entry="\066\111\111\108\101\097\110",Value=h.UIKeepAlive,Function=function(z,y)h.UIKeepAlive=z local C=y.Text y.Text="\083\097\118\105\110\103\046\046"V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\085\073\075\101\101\112\065\108\105\118\101",z)y.Text=C end};{Text="\080\097\114\116\105\099\108\101 \069\102\102\101\099\116\115\058 ",Desc="- \069\110\097\098\108\101\115\047\068\105\115\097\098\108\101\115 \099\101\114\116\097\105\110 \065\100\111\110\105\115 \109\097\100\101 \101\102\102\101\099\116\115 \108\105\107\101 \115\112\097\114\107\108\101\115",Entry="\066\111\111\108\101\097\110",Value=h.ParticlesEnabled,Function=function(z,y)h.ParticlesEnabled=z local C=y.Text y.Text="\083\097\118\105\110\103\046\046"V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\080\097\114\116\105\099\108\101\115\069\110\097\098\108\101\100",z)y.Text=C end};{Text="\067\097\112\101\115\058 ",Desc="- \065\108\108\111\119\115 \121\111\117 \116\111 \100\105\115\097\098\108\101 \097\108\108 \112\108\097\121\101\114 \099\097\112\101\115 \108\111\099\097\108\108\121";Entry="\066\111\111\108\101\097\110",Value=h.CapesEnabled,Function=function(z,y)h.CapesEnabled=z local C=y.Text y.Text="\083\097\118\105\110\103\046\046"V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\067\097\112\101\115\069\110\097\098\108\101\100",z)y.Text=C end};{Text="\072\105\100\101 \067\104\097\116 \067\111\109\109\097\110\100\115\058 ",Desc="- \072\105\100\101 \099\111\109\109\097\110\100\115 \114\097\110 \102\114\111\109 \116\104\101 \099\104\097\116",Entry="\066\111\111\108\101\097\110",Setting="\072\105\100\101\067\104\097\116\067\111\109\109\097\110\100\115",Value=h.HideChatCommands or false,Function=function(z,y)h.HideChatCommands=z local C=y.Text y.Text="\083\097\118\105\110\103\046\046"V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\072\105\100\101\067\104\097\116\067\111\109\109\097\110\100\115",z)y.Text=C end};{Text="\067\111\110\115\111\108\101 \075\101\121\058 ",Desc="\075\101\121 \117\115\101\100 \116\111 \111\112\101\110 \116\104\101 \099\111\110\115\111\108\101",Entry="\066\117\116\116\111\110",Value=m.KeyCodeToName(Enum.KeyCode[h.CustomConsoleKey or V.Get("\083\101\116\116\105\110\103","\067\111\110\115\111\108\101\075\101\121\067\111\100\101")or"\085\110\107\110\111\119\110"].Value);Function=function(z)local y,C z.Text="\087\097\105\116\105\110\103\046\046\046"local v=x.UserInputService.InputBegan:Connect(function(z)local v=x.UserInputService:GetFocusedTextBox()if not v and rawequal(z.UserInputType,Enum.UserInputType.Keyboard)then y,C=z.KeyCode.Name,m.KeyCodeToName(z.KeyCode.Value)end end)repeat wait()until y h.CustomConsoleKey=y v:Disconnect()z.Text="\083\097\118\105\110\103\046\046"V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\067\117\115\116\111\109\067\111\110\115\111\108\101\075\101\121",h.CustomConsoleKey)z.Text=C end};{Text="\084\104\101\109\101\058 ";Desc="- \065\108\108\111\119\115 \121\111\117 \116\111 \115\101\116 \116\104\101 \065\100\111\110\105\115 \085\073 \116\104\101\109\101",Entry="\068\114\111\112\068\111\119\110",Setting="\067\117\115\116\111\109\084\104\101\109\101",Function=function(z)local y=z.TextButton local C=W.ThemePicker local v=C.Frame local c=C.Entry local function m()v:ClearAllChildren()local z=UDim2.fromOffset local W={"\068\101\102\097\117\108\116"}for z,y in ipairs(L.UI:GetChildren())do table.insert(W,y.Name)end local m=0 for W,L in pairs(W)do local U=c:Clone()U.Text=L U.Position=z(0,20*m)U.Visible=true U.MouseButton1Click:Connect(function()x.Debounce("\067\108\105\101\110\116\083\101\108\101\099\116\105\110\103\084\104\101\109\101",function()C.Visible=false y.Text=L h.CustomTheme=L if L=="\068\101\102\097\117\108\116"then V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\067\117\115\116\111\109\084\104\101\109\101",nil)else V.Get("\085\112\100\097\116\101\067\108\105\101\110\116","\067\117\115\116\111\109\084\104\101\109\101",L)end end)end)U.Parent=v m+=1 end C.Position=z(y.AbsolutePosition.X+15,y.AbsolutePosition.Y)C.Visible=true end y.MouseButton1Click:Connect(function()x.Debounce("\067\108\105\101\110\116\068\105\115\112\108\097\121\084\104\101\109\101\115",function()if C.Visible then C.Visible=false else m()end end)end)if h.CustomTheme then y.Text=h.CustomTheme else y.Text="\068\101\102\097\117\108\116"end end}}if U then local z=U:Add("\084\097\098\070\114\097\109\101",{Size=UDim2.new(1,-10,1,-10),Position=UDim2.new(0,5,0,5)})local y=z:NewTab("\067\108\105\101\110\116",{Text="\067\108\105\101\110\116"})local v=z:NewTab("\071\097\109\101",{Text="\071\097\109\101"})for z,C in next,Y do if C.Entry=="\066\111\111\108\101\097\110"then local v=y:Add("\084\101\120\116\076\097\098\101\108",{Size=UDim2.new(1,-10,0,25);Position=UDim2.new(0,5,0,25*(z-1)),TextXAlignment="\076\101\102\116";Enabled=C.Value;Text=C.Text;ToolTip=C.Desc})v:Add("\066\111\111\108\101\097\110",{Size=UDim2.new(0,100,0,20),Position=UDim2.new(1,-100,0,0);Enabled=C.Value,OnToggle=function(z,y)print("\084\111\103\103\108\101\100 \116\104\105\110\103\101\114")end})end end y:ResizeCanvas(false,true)C=U.gTable U:Ready()end end
client, service = nil, nil

return function(data, env)
	local gTable

	if env then
		setfenv(1, env)
	end

	local client = env.client
	local service = env.service
	local gui = env.gui

	local UI = client.UI
	local Remote = client.Remote
	local Variables = client.Variables
	local Functions = client.Functions
	local Deps = client.Deps

	local window = UI.Make("Window",{
		Name  = "Settings";
		Title = "Settings";
		Size  = {225, 200};
		AllowMultiple = false;
	})

	local cliSettings = {
		{
			Text = "Keybinds: ";
			Desc = "- Enables/Disables Keybinds";
			Entry = "Boolean";
			Value = Variables.KeybindsEnabled;
			Function = function(enabled, toggle)
				Variables.KeybindsEnabled = enabled
				local text = toggle.Text
				toggle.Text = "Saving.."
				Remote.Get("UpdateClient","KeybindsEnabled",enabled)
				toggle.Text = text
			end
		};
		{
			Text = "UI Keep Alive: ";
			Desc = "- Prevents Adonis UI deletion on death";
			Entry = "Boolean";
			Value = Variables.UIKeepAlive;
			Function = function(enabled, toggle)
				Variables.UIKeepAlive = enabled
				local text = toggle.Text
				toggle.Text = "Saving.."
				Remote.Get("UpdateClient","UIKeepAlive",enabled)
				toggle.Text = text
			end
		};
		{
			Text = "Particle Effects: ";
			Desc = "- Enables/Disables certain Adonis made effects like sparkles";
			Entry = "Boolean";
			Value = Variables.ParticlesEnabled;
			Function = function(enabled, toggle)
				Variables.ParticlesEnabled = enabled
				local text = toggle.Text
				toggle.Text = "Saving.."
				Remote.Get("UpdateClient","ParticlesEnabled",enabled)
				toggle.Text = text
			end
		};
		{
			Text = "Capes: ";
			Desc = "- Allows you to disable all player capes locally";
			Entry = "Boolean";
			Value = Variables.CapesEnabled;
			Function = function(enabled, toggle)
				Variables.CapesEnabled = enabled
				local text = toggle.Text
				toggle.Text = "Saving.."
				Remote.Get("UpdateClient","CapesEnabled",enabled)
				toggle.Text = text
			end
		};
		{
			Text = "Hide Chat Commands: ";
			Desc = "- Hide commands ran from the chat";
			Entry = "Boolean";
			Setting = "HideChatCommands";
			Value = Variables.HideChatCommands or false;
			Function = function(enabled, toggle)
				Variables.HideChatCommands = enabled

				local text = toggle.Text
				toggle.Text = "Saving.."
				Remote.Get("UpdateClient","HideChatCommands",enabled)
				toggle.Text = text
			end
		};
		{
			Text = "Console Key: ";
			Desc = "Key used to open the console";
			Entry = "Button";
			Value = Functions.KeyCodeToName(Enum.KeyCode[Variables.CustomConsoleKey or Remote.Get("Setting","ConsoleKeyCode") or "Unknown"].Value);
			Function = function(toggle)
				local gotKey, visualName
				toggle.Text = "Waiting..."
				local event = service.UserInputService.InputBegan:Connect(function(InputObject)
					local textbox = service.UserInputService:GetFocusedTextBox()
					if not (textbox) and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) then
						gotKey, visualName = InputObject.KeyCode.Name, Functions.KeyCodeToName(InputObject.KeyCode.Value)
					end
				end)

				repeat wait() until gotKey

				Variables.CustomConsoleKey = gotKey
				event:Disconnect()
				toggle.Text = "Saving.."
				Remote.Get("UpdateClient","CustomConsoleKey",Variables.CustomConsoleKey)
				toggle.Text = visualName
			end
		};
		{
			Text = "Theme: ";
			Desc = "- Allows you to set the Adonis UI theme";
			Entry = "DropDown";
			Setting = "CustomTheme";
			Function = function(clone)
				local toggle = clone.TextButton
				local themePicker = gui.ThemePicker
				local themeFrame = themePicker.Frame
				local themeEnt = themePicker.Entry
				local function showThemes()
					themeFrame:ClearAllChildren()

					local fromOffset = UDim2.fromOffset

					local Themes = {"Default"}
					for i,v in ipairs(Deps.UI:GetChildren()) do
						table.insert(Themes,v.Name)
					end

					local num = 0
					for i,v in pairs(Themes) do
						local new = themeEnt:Clone()
						new.Text = v
						new.Position = fromOffset(0, 20*num)
						new.Visible = true
						new.MouseButton1Click:Connect(function()
							service.Debounce("ClientSelectingTheme",function()
								themePicker.Visible = false
								toggle.Text = v
								Variables.CustomTheme = v
								if v == "Default" then
									Remote.Get("UpdateClient","CustomTheme",nil)
								else
									Remote.Get("UpdateClient","CustomTheme",v)
								end
							end)
						end)
						new.Parent = themeFrame
						num += 1
					end

					themePicker.Position = fromOffset(toggle.AbsolutePosition.X+15, toggle.AbsolutePosition.Y)
					themePicker.Visible = true
				end

				toggle.MouseButton1Click:Connect(function()
					service.Debounce("ClientDisplayThemes",function()
						if themePicker.Visible then
							themePicker.Visible = false
						else
							showThemes()
						end
					end)
				end)

				if Variables.CustomTheme then
					toggle.Text = Variables.CustomTheme
				else
					toggle.Text = "Default"
				end
			end
		}
	}

	if window then
		local tabFrame = window:Add("TabFrame",{
			Size = UDim2.new(1, -10, 1, -10);
			Position = UDim2.new(0, 5, 0, 5);
		})

		local clientTab = tabFrame:NewTab("Client",{
			Text = "Client";
		})

		local gameTab = tabFrame:NewTab("Game",{
			Text = "Game";
		})

		--[[local clientList = clientTab:Add
		})("ScrollingFrame",{


		local gameList = gameTab:Add("ScrollingFrame",{

		})--]]

		for i,v in next,cliSettings do
			if v.Entry == "Boolean" then
				local new = clientTab:Add("TextLabel", {
					Size = UDim2.new(1, -10, 0, 25);
					Position = UDim2.new(0, 5, 0, 25*(i-1));
					TextXAlignment = "Left";
					Enabled = v.Value;
					Text = v.Text;
					ToolTip = v.Desc;
				})

				new:Add("Boolean", {
					Size = UDim2.new(0, 100, 0, 20);
					Position = UDim2.new(1, -100, 0, 0);
					Enabled = v.Value;
					OnToggle = function(enabled, button)
						print("Toggled thinger")
					end
				})
			end
		end

		clientTab:ResizeCanvas(false, true)

		gTable = window.gTable
		window:Ready()
	end
end
