local z=game:GetService("\080\108\097\121\101\114\115")local R={AnchorPoint=Vector2.new(.5,.5);BackgroundColor3=Color3.fromRGB(17,17,17),BackgroundTransparency=.05;BorderColor3=Color3.fromRGB(17,17,17);BorderSizePixel=20;ClearTextOnFocus=false;MultiLine=true;Position=UDim2.new(.5,0,.5,0);Size=UDim2.new(.5,0,.4,0),Font=Enum.Font.Code;TextColor3=Color3.fromRGB(241,241,241),TextWrapped=true;TextSize=18,TextXAlignment="\076\101\102\116";TextYAlignment="\084\111\112";AutoLocalize=false;PlaceholderText="\082\105\103\104\116 \099\108\105\099\107 \116\111 \101\120\105\116"}local y return{Name="\101\100\105\116";Aliases={};Description="\069\100\105\116 \116\101\120\116 \105\110 \097 \084\101\120\116\066\111\120";Group="\068\101\102\097\117\108\116\085\116\105\108",Args={{Type="\115\116\114\105\110\103",Name="\073\110\112\117\116 \116\101\120\116",Description="\084\104\101 \116\101\120\116 \121\111\117 \119\105\115\104 \116\111 \101\100\105\116",Default=""};{Type="\115\116\114\105\110\103";Name="\068\101\108\105\109\105\116\101\114";Description="\084\104\101 \099\104\097\114\097\099\116\101\114 \116\104\097\116 \115\101\112\097\114\097\116\101\115 \101\097\099\104 \108\105\110\101",Default="\044"}},ClientRun=function(r,f,l)y=y or r.Cmdr.Util.Mutex()local o=y()r:Reply("\082\105\103\104\116-\099\108\105\099\107 \111\110 \116\104\101 \116\101\120\116 \097\114\101\097 \116\111 \101\120\105\116\046",Color3.fromRGB(158,158,158))local M=Instance.new("\083\099\114\101\101\110\071\117\105")M.Name="\067\109\100\114\069\100\105\116\066\111\120"M.ResetOnSpawn=false local C=Instance.new("\084\101\120\116\066\111\120")for z,R in pairs(R)do C[z]=R end C.Text=f:gsub(l,"\n")C.Parent=M M.Parent=z.LocalPlayer:WaitForChild("\080\108\097\121\101\114\071\117\105")local P=coroutine.running()C.InputBegan:Connect(function(z)if z.UserInputType==Enum.UserInputType.MouseButton2 then coroutine.resume(P,C.Text:gsub("\n",l))M:Destroy()o()end end)return coroutine.yield()end}
local Players = game:GetService("Players")

local TEXT_BOX_PROPERTIES = {
	AnchorPoint = Vector2.new(0.5, 0.5),
	BackgroundColor3 = Color3.fromRGB(17, 17, 17),
	BackgroundTransparency = 0.05,
	BorderColor3 = Color3.fromRGB(17, 17, 17),
	BorderSizePixel = 20,
	ClearTextOnFocus = false,
	MultiLine = true,
	Position = UDim2.new(0.5, 0, 0.5, 0),
	Size = UDim2.new(0.5, 0, 0.4, 0),
	Font = Enum.Font.Code,
	TextColor3 = Color3.fromRGB(241, 241, 241),
	TextWrapped = true,
	TextSize = 18,
	TextXAlignment = "Left",
	TextYAlignment = "Top",
	AutoLocalize = false,
	PlaceholderText = "Right click to exit",
}

local lock

return {
	Name = "edit";
	Aliases = {};
	Description = "Edit text in a TextBox";
	Group = "DefaultUtil";
	Args = {
		{
			Type = "string";
			Name = "Input text";
			Description = "The text you wish to edit";
			Default = "";
		},
		{
			Type = "string";
			Name = "Delimiter";
			Description = "The character that separates each line";
			Default = ",";
		}
	};

	ClientRun = function(context, text, delimeter)
		lock = lock or context.Cmdr.Util.Mutex()

		local unlock = lock()

		context:Reply("Right-click on the text area to exit.", Color3.fromRGB(158, 158, 158))

		local screenGui = Instance.new("ScreenGui")
		screenGui.Name = "CmdrEditBox"
		screenGui.ResetOnSpawn = false

		local textBox = Instance.new("TextBox")

		for key, value in pairs(TEXT_BOX_PROPERTIES) do
			textBox[key] = value
		end

		textBox.Text = text:gsub(delimeter, "\n")
		textBox.Parent = screenGui

		screenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")

		local thread = coroutine.running()

		textBox.InputBegan:Connect(function(input)
			if input.UserInputType == Enum.UserInputType.MouseButton2 then
				coroutine.resume(thread, textBox.Text:gsub("\n", delimeter))
				screenGui:Destroy()
				unlock()
			end
		end)

		return coroutine.yield()
	end
}