return function(X)local G local F=client.UI.Make("\087\105\110\100\111\119",{Name="\065\108\105\097\115\101\115",Title="\065\108\105\097\115 \069\100\105\116\111\114";Size={420,240},AllowMultiple=false})local c={Alias="",Args={Names={},Defaults={}};Command="";Description=""}for G,F in pairs(c)do if not X[G]then X[G]=F end end if F then local c=F:Add("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{BackgroundColor3=(Color3.fromRGB(31,31,31)):lerp(Color3.new(1,1,1),.2);Size=UDim2.new(1,-10,1,-10);Position=UDim2.new(0,5,0,5)})local T=c:Add("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{Size=UDim2.new(1,-10,1,-35);Position=UDim2.new(0,5,0,5),BackgroundTransparency=.5})local a local I,K,n local B B=F:Add("\070\114\097\109\101",{Visible=false,Size=UDim2.new(0,200,0,150);Position=UDim2.new(.5,-100,.5,-75),Children={{Class="\084\101\120\116\076\097\098\101\108";Text="\065\114\103\117\109\101\110\116 \078\097\109\101\058";Position=UDim2.new(0,0,0,10);Size=UDim2.new(1,0,0,20);BackgroundTransparency=1};{Class="\084\101\120\116\076\097\098\101\108";Text="\068\101\102\097\117\108\116\058";Position=UDim2.new(0,0,0,65);Size=UDim2.new(1,0,0,20),BackgroundTransparency=1};{Class="\084\101\120\116\066\117\116\116\111\110";Text="\083\097\118\101";Position=UDim2.new(.5,0,1,-30),Size=UDim2.new(.5,-20,0,20);BackgroundTransparency=1;OnClicked=function()if n==0 then table.insert(X.Args.Names,I)table.insert(X.Args.Defaults,K or"")else X.Args.Names[n]=I X.Args.Defaults[n]=K or""end a()I=nil K=nil B.Visible=false end}}})local Z=B:Add({Class="\084\101\120\116\066\117\116\116\111\110";Text="\082\101\109\111\118\101",Position=UDim2.new(0,10,1,-30);Size=UDim2.new(.5,-20,0,20),BackgroundTransparency=1,OnClicked=function()if n~=0 then table.remove(X.Args.Names,n)table.remove(X.Args.Defaults,n)end a()I=nil K=nil B.Visible=false end})local r=B:Add("\084\101\120\116\066\111\120",{Text=I or"\110\097\109\101";Position=UDim2.new(0,10,0,35),Size=UDim2.new(1,-20,0,20),TextChanged=function(X,G,F)I=X end})local V=B:Add("\084\101\120\116\066\111\120",{Text=K or"",Position=UDim2.new(0,10,0,90);Size=UDim2.new(1,-20,0,20);TextChanged=function(X,G,F)K=X end})B.BackgroundColor3=B.BackgroundColor3:lerp(Color3.new(1,1,1),.05)r.BackgroundColor3=r.BackgroundColor3:lerp(Color3.new(1,1,1),.1)V.BackgroundColor3=r.BackgroundColor3 local function g(X)if not B.Visible then if X then I=X.Name K=X.Default end if n==0 then Z.Text="\067\097\110\099\101\108"else Z.Text="\082\101\109\111\118\101"end r.Text=I or"\110\097\109\101"V.Text=K or""B.Visible=true end end function a()T:ClearAllChildren()local G=1 T:Add("\084\101\120\116\076\097\098\101\108",{Text="  \065\108\105\097\115\058 ",ToolTip="\083\101\116 \116\104\101 \097\108\105\097\115 \065\100\111\110\105\115 \115\104\111\117\108\100 \099\104\101\099\107 \102\111\114 \105\110 \099\104\097\116",BackgroundTransparency=G%2==0 and 0 or.2,Size=UDim2.new(1,-10,0,30),Position=UDim2.new(0,5,0,30*(G-1)+5);TextXAlignment="\076\101\102\116",Children={[X.ExistingAlias and"\084\101\120\116\076\097\098\101\108"or"\084\101\120\116\066\111\120"]={Text=X.Alias or"",Size=UDim2.new(0,200,1,0),Position=UDim2.new(1,-200,0,0);BackgroundTransparency=1;TextChanged=not X.ExistingAlias and function(G,F,c)X.Alias=G end or nil}}})G=G+1 T:Add("\084\101\120\116\076\097\098\101\108",{Text="  \067\111\109\109\097\110\100\058 ",ToolTip="\083\101\116 \116\104\101 \099\111\109\109\097\110\100\040\115\041 \065\100\111\110\105\115 \115\104\111\117\108\100 \101\120\101\099\117\116\101 \119\104\101\110 \102\105\110\100\105\110\103 \116\104\101 \097\108\105\097\115";BackgroundTransparency=G%2==0 and 0 or.2;Size=UDim2.new(1,-10,0,30),Position=UDim2.new(0,5,0,30*(G-1)+5),TextXAlignment="\076\101\102\116";Children={TextBox={Text=X.Command or"",Size=UDim2.new(0,200,1,0),Position=UDim2.new(1,-200,0,0);BackgroundTransparency=1,TextChanged=function(G,F,c)X.Command=G end}}})G=G+1 T:Add("\084\101\120\116\076\097\098\101\108",{Text="  \068\101\115\099\114\105\112\116\105\111\110\058 ",ToolTip="\087\104\097\116 \100\111\101\115 \116\104\101 \097\108\105\097\115 \100\111\063";BackgroundTransparency=G%2==0 and 0 or.2;Size=UDim2.new(1,-10,0,30),Position=UDim2.new(0,5,0,30*(G-1)+5);TextXAlignment="\076\101\102\116",Children={TextBox={Text=X.Description or"",Size=UDim2.new(0,200,1,0),Position=UDim2.new(1,-200,0,0),BackgroundTransparency=1,TextChanged=function(G,F,c)X.Description=G end}}})G=G+2 T:Add("\084\101\120\116\066\117\116\116\111\110",{Text="\065\100\100 \065\114\103\117\109\101\110\116";BackgroundTransparency=G%2==0 and 0 or.2;Size=UDim2.new(1,-10,0,30);Position=UDim2.new(0,5,0,30*(G-1)+5);OnClicked=function(X)n=0 g()end})for F,c in ipairs(X.Args.Names)do G=G+1 T:Add("\084\101\120\116\066\117\116\116\111\110",{Text="\065\114\103\117\109\101\110\116\058 "..(c..(" \124 \068\101\102\097\117\108\116\058 "..X.Args.Defaults[F])),BackgroundTransparency=G%2==0 and 0 or.2,Size=UDim2.new(1,-10,0,30),Position=UDim2.new(0,5,0,30*(G-1)+5),OnClicked=function(G)n=F g({Name=c,Default=X.Args.Defaults[F]})end})end T:ResizeCanvas(false,true,false,false,5,5)c:Add("\084\101\120\116\066\117\116\116\111\110",{Text="\067\097\110\099\101\108";Position=UDim2.new(0,5,1,-25);Size=UDim2.new(.33333333333333,-8,0,20);OnClicked=function(X)F:Close()end})c:Add("\084\101\120\116\066\117\116\116\111\110",{Text="\082\101\109\111\118\101",Position=UDim2.new(.33333333333333,3,1,-25);Size=UDim2.new(.33333333333333,-7,0,20);OnClicked=function(G)if X.ExistingAlias then client.Functions.RemoveAlias(X.Alias)client.UI.Remove("\085\115\101\114\080\097\110\101\108")client.UI.Make("\085\115\101\114\080\097\110\101\108",{Tab="\065\108\105\097\115\101\115"})end F:Close()end})c:Add("\084\101\120\116\066\117\116\116\111\110",{Text="\083\097\118\101";Position=UDim2.new(.66666666666667,3,1,-25);Size=UDim2.new(.33333333333333,-8,0,20),OnClicked=function(G)if X.Alias==""or X.Command==""then client.UI.Make("\079\117\116\112\117\116",{Message="\065 \114\101\113\117\105\114\101\100 \102\105\101\108\100 \105\115 \109\105\115\115\105\110\103\033"})else client.Functions.SetAlias(X.Alias,X)client.UI.Remove("\085\115\101\114\080\097\110\101\108")client.UI.Make("\085\115\101\114\080\097\110\101\108",{Tab="\065\108\105\097\115\101\115"})F:Close()end end})end a()G=F.gTable F:Ready()end end
--// Ported from Kronos

return function(data)
	local gTable

	local window = client.UI.Make("Window", {
		Name = "Aliases",
		Title = "Alias Editor",
		Size = { 420, 240 },
		AllowMultiple = false,
	})

	local template = {
		Alias = "",
		Args = { Names = {}, Defaults = {} },
		Command = "",
		Description = "",
	}
	for i, v in pairs(template) do
		if not data[i] then
			data[i] = v
		end
	end

	if window then
		local bg = window:Add("ScrollingFrame", {
			BackgroundColor3 = Color3.fromRGB(31, 31, 31):lerp(Color3.new(1, 1, 1), 0.2),
			Size = UDim2.new(1, -10, 1, -10),
			Position = UDim2.new(0, 5, 0, 5),
		})

		local content = bg:Add("ScrollingFrame", {
			Size = UDim2.new(1, -10, 1, -35),
			Position = UDim2.new(0, 5, 0, 5),
			BackgroundTransparency = 0.5,
		})

		local draw
		local curArgName, curArgDefault, argIndex
		local argBox
		argBox = window:Add("Frame", {
			Visible = false,
			Size = UDim2.new(0, 200, 0, 150),
			Position = UDim2.new(0.5, -100, 0.5, -75),
			Children = {
				{
					Class = "TextLabel",
					Text = "Argument Name:",
					Position = UDim2.new(0, 0, 0, 10),
					Size = UDim2.new(1, 0, 0, 20),
					BackgroundTransparency = 1,
				},
				{
					Class = "TextLabel",
					Text = "Default:",
					Position = UDim2.new(0, 0, 0, 65),
					Size = UDim2.new(1, 0, 0, 20),
					BackgroundTransparency = 1,
				},
				{
					Class = "TextButton",
					Text = "Save",
					Position = UDim2.new(0.5, 0, 1, -30),
					Size = UDim2.new(0.5, -20, 0, 20),
					BackgroundTransparency = 1,
					OnClicked = function()
						if argIndex == 0 then
							table.insert(data.Args.Names, curArgName)
							table.insert(data.Args.Defaults, curArgDefault or "")
						else
							data.Args.Names[argIndex] = curArgName
							data.Args.Defaults[argIndex] = curArgDefault or ""
						end
						draw()
						curArgName = nil
						curArgDefault = nil
						argBox.Visible = false
					end,
				},
			},
		})

		local endBtn = argBox:Add({
			Class = "TextButton",
			Text = "Remove",
			Position = UDim2.new(0, 10, 1, -30),
			Size = UDim2.new(0.5, -20, 0, 20),
			BackgroundTransparency = 1,
			OnClicked = function()
				if argIndex ~= 0 then
					table.remove(data.Args.Names, argIndex)
					table.remove(data.Args.Defaults, argIndex)
				end
				draw()
				curArgName = nil
				curArgDefault = nil
				argBox.Visible = false
			end,
		})

		local argNameBox = argBox:Add("TextBox", {
			Text = curArgName or "name",
			Position = UDim2.new(0, 10, 0, 35),
			Size = UDim2.new(1, -20, 0, 20),
			TextChanged = function(newText, enter, box)
				curArgName = newText
			end,
		})

		local argDefaultBox = argBox:Add("TextBox", {
			Text = curArgDefault or "",
			Position = UDim2.new(0, 10, 0, 90),
			Size = UDim2.new(1, -20, 0, 20),
			TextChanged = function(newText, enter, box)
				curArgDefault = newText
			end,
		})

		argBox.BackgroundColor3 = argBox.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.05)
		argNameBox.BackgroundColor3 = argNameBox.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.1)
		argDefaultBox.BackgroundColor3 = argNameBox.BackgroundColor3

		local function showArgBox(argData)
			if not argBox.Visible then
				if argData then
					curArgName = argData.Name
					curArgDefault = argData.Default
				end
				if argIndex == 0 then
					endBtn.Text = "Cancel"
				else
					endBtn.Text = "Remove"
				end
				argNameBox.Text = curArgName or "name"
				argDefaultBox.Text = curArgDefault or ""
				argBox.Visible = true
			end
		end

		function draw()
			content:ClearAllChildren()

			local i = 1
			content:Add("TextLabel", {
				Text = "  " .. "Alias" .. ": ",
				ToolTip = "Set the alias Adonis should check for in chat",
				BackgroundTransparency = (i % 2 == 0 and 0) or 0.2,
				Size = UDim2.new(1, -10, 0, 30),
				Position = UDim2.new(0, 5, 0, (30 * (i - 1)) + 5),
				TextXAlignment = "Left",
				Children = {
					[data.ExistingAlias and "TextLabel" or "TextBox"] = {
						Text = data.Alias or "",
						Size = UDim2.new(0, 200, 1, 0),
						Position = UDim2.new(1, -200, 0, 0),
						BackgroundTransparency = 1,
						TextChanged = not data.ExistingAlias and function(text, enter, new)
							data.Alias = text
						end or nil,
					},
				},
			})
			i = i + 1
			content:Add("TextLabel", {
				Text = "  " .. "Command" .. ": ",
				ToolTip = "Set the command(s) Adonis should execute when finding the alias",
				BackgroundTransparency = (i % 2 == 0 and 0) or 0.2,
				Size = UDim2.new(1, -10, 0, 30),
				Position = UDim2.new(0, 5, 0, (30 * (i - 1)) + 5),
				TextXAlignment = "Left",
				Children = {
					TextBox = {
						Text = data.Command or "",
						Size = UDim2.new(0, 200, 1, 0),
						Position = UDim2.new(1, -200, 0, 0),
						BackgroundTransparency = 1,
						TextChanged = function(text, enter, new)
							data.Command = text
						end,
					},
				},
			})
			i = i + 1
			content:Add("TextLabel", {
				Text = "  " .. "Description" .. ": ",
				ToolTip = "What does the alias do?",
				BackgroundTransparency = (i % 2 == 0 and 0) or 0.2,
				Size = UDim2.new(1, -10, 0, 30),
				Position = UDim2.new(0, 5, 0, (30 * (i - 1)) + 5),
				TextXAlignment = "Left",
				Children = {
					TextBox = {
						Text = data.Description or "",
						Size = UDim2.new(0, 200, 1, 0),
						Position = UDim2.new(1, -200, 0, 0),
						BackgroundTransparency = 1,
						TextChanged = function(text, enter, new)
							data.Description = text
						end,
					},
				},
			})
			i = i + 2
			content:Add("TextButton", {
				Text = "Add Argument",
				BackgroundTransparency = (i % 2 == 0 and 0) or 0.2,
				Size = UDim2.new(1, -10, 0, 30),
				Position = UDim2.new(0, 5, 0, (30 * (i - 1)) + 5),
				OnClicked = function(button)
					argIndex = 0
					showArgBox()
				end,
			})
			for index, arg in ipairs(data.Args.Names) do
				i = i + 1
				content:Add("TextButton", {
					Text = "Argument: " .. arg .. " | Default: " .. data.Args.Defaults[index],
					BackgroundTransparency = (i % 2 == 0 and 0) or 0.2,
					Size = UDim2.new(1, -10, 0, 30),
					Position = UDim2.new(0, 5, 0, (30 * (i - 1)) + 5),
					OnClicked = function(button)
						argIndex = index
						showArgBox({ Name = arg, Default = data.Args.Defaults[index] })
					end,
				})
			end

			content:ResizeCanvas(false, true, false, false, 5, 5)

			bg:Add("TextButton", {
				Text = "Cancel",
				Position = UDim2.new(0, 5, 1, -25),
				Size = UDim2.new(1 / 3, -8, 0, 20),
				OnClicked = function(button)
					window:Close()
				end,
			})

			bg:Add("TextButton", {
				Text = "Remove",
				Position = UDim2.new(1 / 3, 3, 1, -25),
				Size = UDim2.new(1 / 3, -7, 0, 20),
				OnClicked = function(button)
					if data.ExistingAlias then
						client.Functions.RemoveAlias(data.Alias)
						client.UI.Remove("UserPanel")
						client.UI.Make("UserPanel", { Tab = "Aliases" })
					end
					window:Close()
				end,
			})

			bg:Add("TextButton", {
				Text = "Save",
				Position = UDim2.new(2 / 3, 3, 1, -25),
				Size = UDim2.new(1 / 3, -8, 0, 20),
				OnClicked = function(button)
					if data.Alias == "" or data.Command == "" then
						client.UI.Make("Output", { Message = "A required field is missing!" })
					else
						client.Functions.SetAlias(data.Alias, data)
						client.UI.Remove("UserPanel")
						client.UI.Make("UserPanel", { Tab = "Aliases" })
						window:Close()
					end
				end,
			})
		end

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