Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // this is extremely inefficient but it works.
- local s, e = pcall(function()
- local find = function()
- local cgui = game:GetService("CoreGui")
- for i, v in pairs(cgui:GetChildren()) do
- if v:FindFirstChild("ScriptEditor") then
- return v;
- end
- end
- return nil;
- end
- local notify = function(msg)
- game.StarterGui:SetCore("SendNotification", {
- Title = "Notification:";
- Text = msg;
- Duration = 15;
- })
- end
- if shared.gone then
- notify("You've already executed this!")
- while wait() do
- end
- end
- local dex = find()
- local t = 0;
- while not find() and wait() do
- t = t + 1
- end
- if t >= 5 then -- means it took more than 5 seconds to find dex meaning this is most likely auto-execute now it will wait for dex to load.
- wait(3)
- end
- dex = find();
- notify("Loading script editor mod..")
- local add = function(editor) -- adds the search ui btw
- local a=Instance.new("Frame")local b=Instance.new("TextBox")local c=Instance.new("UITextSizeConstraint")local d=Instance.new("TextLabel")local e=Instance.new("UITextSizeConstraint")local f=Instance.new("ImageButton")local g=Instance.new("ImageButton")local h=Instance.new("ImageButton")a.Name="Addon"a.Parent=editor;a.BackgroundColor3=Color3.fromRGB(30,30,30)a.BorderSizePixel=0;a.ClipsDescendants=true;a.Position=UDim2.new(0.548286617,0,0,0)a.Size=UDim2.new(0,275,0,30)a.ZIndex=100;b.Parent=a;b.AnchorPoint=Vector2.new(0.5,0.5)b.BackgroundColor3=Color3.fromRGB(50,50,50)b.BorderSizePixel=0;b.Position=UDim2.new(0.239772722,0,0.5,0)b.Size=UDim2.new(0.434545457,0,0.600000024,0)b.ZIndex=555;b.Font=Enum.Font.Code;b.PlaceholderText="Find"b.Text=""b.TextColor3=Color3.fromRGB(255,255,255)b.TextScaled=true;b.TextSize=14.000;b.TextWrapped=true;b.ClearTextOnFocus=false;c.Parent=b;c.MaxTextSize=13;d.Name="Amount"d.Parent=a;d.AnchorPoint=Vector2.new(0,0.5)d.BackgroundColor3=Color3.fromRGB(255,255,255)d.BackgroundTransparency=1.000;d.Position=UDim2.new(0.49454546,0,0.5,0)d.Size=UDim2.new(-0.534545481,200,1,0)d.ZIndex=100;d.Font=Enum.Font.Code;d.Text="3 of 5"d.TextColor3=Color3.fromRGB(255,255,255)d.TextScaled=true;d.TextSize=14.000;d.TextWrapped=true;e.Parent=d;e.MaxTextSize=15;f.Name="forward"f.Parent=a;f.AnchorPoint=Vector2.new(0.5,0.5)f.BackgroundTransparency=1.000;f.Position=UDim2.new(0.843636394,0,0.5,0)f.Size=UDim2.new(0,20,0,20)f.ZIndex=115;f.Image="rbxassetid://3926307971"f.ImageRectOffset=Vector2.new(564,284)f.ImageRectSize=Vector2.new(36,36)g.Name="back"g.Parent=a;g.AnchorPoint=Vector2.new(0.5,0.5)g.BackgroundTransparency=1.000;g.Position=UDim2.new(0.74909097,0,0.5,0)g.Size=UDim2.new(0,20,0,20)g.ZIndex=105;g.Image="rbxassetid://3926307971"g.ImageRectOffset=Vector2.new(124,324)g.ImageRectSize=Vector2.new(36,36)h.Name="close"h.Parent=a;h.AnchorPoint=Vector2.new(0,0.5)h.BackgroundTransparency=1.000;h.Position=UDim2.new(0.899999976,0,0.5,0)h.Size=UDim2.new(0,20,0,20)h.ZIndex=2000;h.Image="rbxassetid://3926305904"h.ImageRectOffset=Vector2.new(284,4)h.ImageRectSize=Vector2.new(24,24)return a
- end
- if dex then
- shared.gone = true;
- local editor = dex.ScriptEditor.Editor;
- local tokens = dex.ScriptEditor.Editor.Container.TextArea.Tokens;
- local open = editor.Parent.OpenScript;
- local uis = game:GetService("UserInputService")
- local panel = add(editor)
- panel.Size = UDim2.new(panel.Size.X.Scale, panel.Size.X.Offset, 0, 0)
- local close = function()
- panel:TweenSize(UDim2.new(panel.Size.X.Scale, panel.Size.X.Offset, 0, 0), Enum.EasingDirection.In, Enum.EasingStyle.Bounce, .35, true)
- end
- local events = {
- getselection = function()
- local bindable = dex.ExplorerPanel.GetSelection;
- local items = bindable:Invoke();
- return items;
- end
- }
- local looking = {
- [Enum.KeyCode.LeftControl] = true;
- [Enum.KeyCode.RightControl] = true;
- [Enum.KeyCode.F] = true;
- }
- local ctrls = {
- [Enum.KeyCode.LeftControl] = true;
- [Enum.KeyCode.RightControl] = true;
- }
- local data = {
- ["ctrl"] = false;
- ["f"] = false;
- }
- local reset = function()
- for key, value in pairs(data) do
- data[key] = false;
- end
- end
- local pullup = function()
- reset();
- if editor.Parent.Visible then
- panel:TweenSize(UDim2.new(panel.Size.X.Scale, panel.Size.X.Offset, 0, 30), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, .35, true)
- end
- spawn(function()
- wait(.35)
- panel.TextBox:CaptureFocus()
- end)
- end
- local paneldata = {
- numbers = {
- at = 0;
- amount = 0;
- -- 0 of 0
- };
- results = {
- -- anything found via searching.
- }
- }
- local textarea = editor.Container.TextArea
- local scanning = false;
- local panelopen = false;
- local index = function(num)
- local s, e = pcall(function()
- if num == 0 then
- textarea.CanvasPosition = Vector2.new(0, 0)
- end
- local results = paneldata.results;
- if #results >= num then
- textarea.CanvasPosition = Vector2.new(0, results[num].Position.Y.Offset)
- else
- textarea.CanvasPosition = Vector2.new(0, 0)
- end
- end)
- end
- local t = 0;
- local set = function()
- t = tick();
- local cur = t;
- end
- local last = '';
- local search = function(txt, b)
- if panelopen then
- local td = {}
- local c = tokens:GetChildren();
- for i = 1, #c do
- local item = c[i];
- if td[item.Text] then
- if item.Position == td[item.Text][1] then
- td[item.Text][2]:Destroy();
- end
- else
- td[item.Text] = {
- item.Position,
- item
- };
- end
- end
- local s, e = pcall(function()
- for i = 1, #paneldata.results do
- local v = paneldata.results[i];
- v.BackgroundTransparency = 1;
- end
- if txt == '' then
- return false;
- end
- local results = {};
- last = txt;
- set()
- local current = t;
- paneldata.results = {}; -- resets to prevent any erroring.
- local children = tokens:GetChildren()
- local nextvalue = function(n, pre)
- local t = n.Text:lower();
- local lo = txt:lower();
- if t:sub(1, 1) == lo:sub(#pre + 1, #pre + 1) then
- return true;
- end
- return false;
- end
- for i = 1, #children do
- local value = children[i];
- if t == current then
- if value.Text:lower():find(txt:lower()) then
- table.insert(paneldata.results, value)
- -- ignore this, I was trying to filter through the next results to allow you to use stuff like require( in the search.
- --[[if nextvalue(children[i+1],value.Text) then
- table.insert(paneldata.results, children[i+1])
- end--]]
- end
- end
- end
- if t == current then
- paneldata.numbers.amount = #paneldata.results;
- for i = 1, #paneldata.results do
- paneldata.results[i].BackgroundColor3 = Color3.fromRGB(255, 255, 0)
- paneldata.results[i].BackgroundTransparency = .5;
- end
- end
- end)
- end
- end
- panel.close.MouseButton1Click:Connect(function()
- panelopen = false;
- panel.TextBox.Text = '';
- paneldata.numbers.amount = 0;
- paneldata.numbers.at = 0;
- local c = tokens:GetChildren()
- for i = 1, #tokens:GetChildren() do
- local v = c[i];
- v.BackgroundTransparency = 1;
- end
- close();
- end)
- local add = function()
- local n = paneldata.numbers.at;
- local new = n + 1;
- if new < paneldata.numbers.amount or new == paneldata.numbers.amount then
- paneldata.numbers.at = n + 1;
- end
- end
- local up = function()
- local nums = paneldata.numbers;
- if nums.at == nums.amount then
- if nums.amount == 0 and nums.at == 0 then
- else
- add()
- end
- else
- add()
- end
- end
- local back = function()
- local nums = paneldata.numbers;
- if nums.at == 0 then
- else
- paneldata.numbers.at = paneldata.numbers.at - 1;
- if paneldata.numbers.at == 0 and paneldata.numbers.amount >= 1 then
- paneldata.numbers.at = paneldata.numbers.at + 1;
- end
- end
- end
- panel.back.MouseButton1Click:Connect(function()
- back()
- end)
- panel.forward.MouseButton1Click:Connect(function()
- up()
- end)
- spawn(function()
- game:GetService('RunService').Heartbeat:Connect(function()
- local amount = paneldata.numbers.amount;
- local at = paneldata.numbers.at;
- if at == 0 and amount == 0 then
- panel.Amount.Text = '';
- else
- panel.Amount.Text = at..' of '..amount
- end
- end)
- end)
- local can = function(t)
- if #t >= 500 then
- notify("String is too long!")
- return false;
- end
- for i = 1, #t do
- if t:sub(i, i) == '' or t:sub(i, i) == ' ' then
- else
- return true;
- end
- end
- return false;
- end
- local val = Instance.new("IntValue")
- val.Name = 'Position'
- spawn(function()
- while wait() do
- val.Value = paneldata.numbers.at;
- if paneldata.numbers.amount == 0 then
- paneldata.numbers.at = 0;
- val.Value = paneldata.numbers.at
- end
- if panel.TextBox.Text == '' then
- paneldata.numbers.amount = 0;
- paneldata.numbers.at = 0;
- search('')
- end
- if paneldata.numbers.at == 0 and paneldata.numbers.amount >= 1 then
- paneldata.numbers.at = 1;
- end
- end
- end)
- val.Changed:Connect(function(n)
- if not scanning then
- index(val.Value)
- end
- end)
- textarea.Changed:Connect(function()
- scanning = true;
- search(panel.TextBox.Text)
- wait(.1)
- scanning = false;
- end)
- local last = textarea.CanvasPosition;
- panel.TextBox.Changed:Connect(function()
- local txt = panel.TextBox.Text
- if can(txt) then
- search(txt)
- end
- end)
- panel.TextBox.FocusLost:Connect(function(ep, random)
- if ep then
- wait()
- up();
- wait()
- panel.TextBox:CaptureFocus();
- end
- end)
- local last;
- uis.InputBegan:Connect(function(input, proccessed)
- if not proccessed then
- if input.KeyCode then
- if looking[input.KeyCode] then
- if not last or data.ctrl == true then
- if ctrls[input.KeyCode] then
- data.ctrl = true;
- else
- data.f = true;
- end
- if data.f and data.ctrl and input.KeyCode == Enum.KeyCode.F then
- panelopen = true;
- pullup()
- end
- else
- reset();
- end
- end
- end
- end
- end)
- else
- notify("Error")
- end
- notify("Done! Enjoy :D")
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement