· 5 years ago · Mar 06, 2020, 10:16 PM
1local coregui = game:GetService("CoreGui");
2assert(not getgenv().dex_loaded, "Dex is already loaded");
3getgenv().dex_loaded = true
4math.randomseed(tick())
5local UserInputService = game:GetService("UserInputService");
6
7local TweenService = game:service'TweenService';
8local setthreadcontext = setthreadcontext or syn.set_thread_identity;
9function RandomCharacters(length)
10 local STR = "";
11 for i = 1, length do
12 STR = STR .. string.char(math.random(65,90));
13 end;
14 return STR;
15end;
16
17local dragger = {};
18do
19 local players = game:service('Players');
20 local player = players.LocalPlayer;
21 local mouse = player:GetMouse();
22 local run = game:service('RunService');
23 local stepped = run.Stepped;
24 dragger.new = function(obj)
25 spawn(function()
26 local minitial;
27 local initial;
28 local isdragging;
29 obj.InputBegan:Connect(function(input)
30 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
31 isdragging = true;
32 minitial = input.Position;
33 initial = obj.Position;
34 local con;
35 con = stepped:Connect(function()
36 if isdragging then
37 local delta = Vector3.new(mouse.X, mouse.Y, 0) - minitial;
38 obj.Position = UDim2.new(initial.X.Scale, initial.X.Offset + delta.X, initial.Y.Scale, initial.Y.Offset + delta.Y);
39 else
40 con:Disconnect();
41 end;
42 end);
43 input.Changed:Connect(function()
44 if input.UserInputState == Enum.UserInputState.End then
45 isdragging = false;
46 end;
47 end);
48 end;
49 end);
50 end)
51 end;
52end;
53
54local localPlayer = game:GetService("Players").LocalPlayer;
55local dexSpy = game:GetObjects("rbxassetid://4543296899")[1];
56local remoteEvent = game:GetObjects("rbxassetid://4543177020")[1];
57local remoteFunction = game:GetObjects("rbxassetid://4543178955")[1];
58remoteEvent.BackgroundColor3 = Color3.fromRGB(140, 30, 49);
59remoteEvent.AutoButtonColor = false;
60remoteFunction.BackgroundColor3 = Color3.fromRGB(140, 30, 49);
61remoteFunction.AutoButtonColor = false;
62local tweenService = game:GetService("TweenService");
63local players = game:GetService("Players");
64local mouse = localPlayer:GetMouse();
65local mainFrame = dexSpy.mainFrame;
66local topbarFrame = mainFrame.topbarFrame;
67local exitBtn = topbarFrame.exitBtn;
68local miniBtn = topbarFrame.miniBtn;
69local scriptsFrame = mainFrame.scriptsFrame;
70local scriptsScrollingFrame = scriptsFrame.scriptsScrollingFrame;
71local scriptsBox = scriptsScrollingFrame.scriptsBox;
72local highlightLabel = scriptsBox.highlightLabel;
73local testLabel = scriptsBox.testLabel;
74local remotesFrame = mainFrame.remotesFrame;
75local remotesScrollingFrame = remotesFrame.remotesScrollingFrame;
76local clearBtn = mainFrame.clearBtn;
77local copyBtn = mainFrame.copyBtn;
78local copyRemBtn = mainFrame.copyRemBtn
79local copyScrBtn = mainFrame.copyScrBtn;
80local currentButton;
81local dlogs, logs = {}, {};
82local syntaxHighlight, transformPath, dumpTable, ValueToReadable;
83local textYSize = scriptsBox.TextSize;
84dexSpy.Enabled = false;
85dexSpy.Parent = coregui;
86
87local function draggable(obj)
88 spawn(function()
89 local dragging = false;
90 local draggableToggle;
91 local draggableInput;
92 local draggableStart;
93
94 obj.topbarFrame.InputBegan:Connect(function(input)
95 if input.UserInputType == Enum.UserInputType.MouseButton1 then
96 dragging = true;
97 draggableStart = input.Position;
98 startPos = obj.AbsolutePosition;
99 end;
100 end);
101
102 obj.topbarFrame.InputEnded:Connect(function(input)
103 if input.UserInputType == Enum.UserInputType.MouseButton1 then
104 dragging = false;
105 end;
106 end);
107
108 UserInputService.InputChanged:Connect(function(input)
109 if obj.Parent.Enabled and input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
110 local res = obj.Parent.AbsoluteSize;
111 obj.Position = UDim2.new(0, startPos.X + (input.Position.X - draggableStart.X), 0, startPos.Y + (input.Position.Y - draggableStart.Y));
112 end;
113 end);
114 end);
115end;
116
117do --// UI Setup
118 draggable(mainFrame);
119
120 local keywords = {
121 {["Keyword"] = "print", ["Color"] = Color3.fromRGB(123, 216, 143)};
122 {["Keyword"] = "warn", ["Color"] = Color3.fromRGB(123, 216, 143)};
123 {["Keyword"] = "FireServer", ["Color"] = Color3.fromRGB(123, 216, 143)};
124 {["Keyword"] = "InvokeServer", ["Color"] = Color3.fromRGB(123, 216, 143)};
125 {["Keyword"] = "game", ["Color"] = Color3.fromRGB(252, 97, 141)};
126 {["Keyword"] = "for", ["Color"] = Color3.fromRGB(252, 97, 141)};
127 {["Keyword"] = "and", ["Color"] = Color3.fromRGB(252, 97, 141)};
128 {["Keyword"] = "or", ["Color"] = Color3.fromRGB(252, 97, 141)};
129 {["Keyword"] = "local", ["Color"] = Color3.fromRGB(252, 97, 141)};
130 {["Keyword"] = "if", ["Color"] = Color3.fromRGB(252, 97, 141)};
131 {["Keyword"] = "then", ["Color"] = Color3.fromRGB(252, 97, 141)};
132 {["Keyword"] = "do", ["Color"] = Color3.fromRGB(252, 97, 141)};
133 {["Keyword"] = "while", ["Color"] = Color3.fromRGB(252, 97, 141)};
134 {["Keyword"] = "repeat", ["Color"] = Color3.fromRGB(252, 97, 141)};
135 {["Keyword"] = "until", ["Color"] = Color3.fromRGB(252, 97, 141)};
136 {["Keyword"] = "end", ["Color"] = Color3.fromRGB(252, 97, 141)};
137 {["Keyword"] = "function", ["Color"] = Color3.fromRGB(252, 97, 141)};
138 {["Keyword"] = "return", ["Color"] = Color3.fromRGB(252, 97, 141)};
139 {["Keyword"] = "break", ["Color"] = Color3.fromRGB(252, 97, 141)};
140 {["Keyword"] = "else", ["Color"] = Color3.fromRGB(252, 97, 141)};
141 {["Keyword"] = "elseif", ["Color"] = Color3.fromRGB(252, 97, 141)};
142 {["Keyword"] = "require", ["Color"] = Color3.fromRGB(252, 97, 141)};
143 {["Keyword"] = "script", ["Color"] = Color3.fromRGB(252, 97, 141)};
144 {["Keyword"] = "loadstring", ["Color"] = Color3.fromRGB(123, 216, 143)};
145 {["Keyword"] = "GetService", ["Color"] = Color3.fromRGB(123, 216, 143)};
146 {["Keyword"] = "self", ["Color"] = Color3.fromRGB(252, 97, 141)};
147 {["Keyword"] = "Ray", ["Color"] = Color3.fromRGB(252, 97, 141)};
148 {["Keyword"] = "Color3", ["Color"] = Color3.fromRGB(252, 97, 141)};
149 {["Keyword"] = "fromRGB", ["Color"] = Color3.fromRGB(123, 216, 143)};
150 {["Keyword"] = "new", ["Color"] = Color3.fromRGB(123, 216, 143)};
151 {["Keyword"] = "in", ["Color"] = Color3.fromRGB(252, 97, 141)};
152 {["Keyword"] = "(", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
153 {["Keyword"] = ")", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
154 {["Keyword"] = "{", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
155 {["Keyword"] = "}", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
156 {["Keyword"] = "[", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
157 {["Keyword"] = "]", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
158 {["Keyword"] = "+", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
159 {["Keyword"] = "-", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
160 {["Keyword"] = "*", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
161 {["Keyword"] = "/", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
162 {["Keyword"] = "%", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
163 {["Keyword"] = "^", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
164 {["Keyword"] = "=", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
165 {["Keyword"] = ",", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
166 {["Keyword"] = "<", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
167 {["Keyword"] = ">", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
168 {["Keyword"] = ";", ["Color"] = Color3.fromRGB(252, 97, 141), ["Independent"] = true};
169 {["Keyword"] = "true", ["Color"] = Color3.fromRGB(122, 114, 185)};
170 {["Keyword"] = "false", ["Color"] = Color3.fromRGB(122, 114, 185)};
171 {["Keyword"] = "nil", ["Color"] = Color3.fromRGB(122, 114, 185)};
172 };
173
174 function syntaxHighlight() [nonamecall]
175 setthreadcontext(6);
176 local text = scriptsBox.Text;
177 local pos = 0;
178 local newLine = 0;
179 local newLinePos = 0;
180 local inString = false;
181 local inComment = false;
182 local blacklistedNumberPos;
183 for i, v in pairs(scriptsBox:GetChildren()) do
184 if v.Name == "highlightLabel" then
185 v:Destroy();
186 end;
187 end;
188 text:gsub(".", function(char)
189 for i, v in pairs(keywords) do
190 if not inString and not inComment and char == v["Keyword"]:sub(1, 1) and text:sub(pos + 1, pos + #v["Keyword"]) == v["Keyword"] then
191 if not v["Independent"] and not text:sub(pos, pos):match("%w") and not text:sub((pos + #v["Keyword"]) + 1, (pos + #v["Keyword"]) + 1):match("%w") then
192 local pastText = text:sub(newLinePos, pos);
193 local testLabel = testLabel:Clone();
194 testLabel.Parent = coregui;
195 testLabel.Text = pastText;
196 local xPos = testLabel.TextBounds.X;
197 testLabel:Destroy();
198 local highlightLabel = highlightLabel:Clone();
199 highlightLabel.Name = "highlightLabel";
200 highlightLabel.TextColor3 = v["Color"];
201 highlightLabel.Text = v["Keyword"];
202 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
203 highlightLabel.Parent = scriptsBox;
204 elseif v["Independent"] then
205 local pastText = text:sub(newLinePos, pos);
206 local testLabel = testLabel:Clone();
207 testLabel.Parent = coregui;
208 testLabel.Text = pastText;
209 local xPos = testLabel.TextBounds.X;
210 testLabel:Destroy();
211 local highlightLabel = highlightLabel:Clone();
212 highlightLabel.Name = "highlightLabel";
213 highlightLabel.TextColor3 = v["Color"];
214 highlightLabel.Text = v["Keyword"];
215 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
216 highlightLabel.Parent = scriptsBox;
217 end;
218 end;
219 end;
220 if not inString and not inComment and tonumber(char) and not text:sub(pos + 2, pos + 2):match("%a") then
221 if not text:sub(pos, pos):match("%a") and pos ~= blacklistedNumberPos then
222 local pastText = text:sub(newLinePos, pos);
223 local testLabel = testLabel:Clone();
224 testLabel.Parent = coregui;
225 testLabel.Text = pastText;
226 local xPos = testLabel.TextBounds.X;
227 testLabel:Destroy();
228 local highlightLabel = highlightLabel:Clone();
229 highlightLabel.Name = "highlightLabel";
230 highlightLabel.TextColor3 = Color3.fromRGB(122, 114, 185);
231 highlightLabel.Text = char;
232 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
233 highlightLabel.Parent = scriptsBox;
234 else
235 blacklistedNumberPos = pos + 1;
236 end;
237 elseif char == '"' and not inComment then
238 inString = not inString;
239 local pastText = text:sub(newLinePos, pos);
240 local testLabel = testLabel:Clone();
241 testLabel.Parent = coregui;
242 testLabel.Text = pastText;
243 local xPos = testLabel.TextBounds.X;
244 testLabel:Destroy();
245 local highlightLabel = highlightLabel:Clone();
246 highlightLabel.Name = "highlightLabel";
247 highlightLabel.TextColor3 = Color3.fromRGB(243, 221, 99);
248 highlightLabel.Text = char;
249 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
250 highlightLabel.Parent = scriptsBox;
251 elseif char == "'" and not inComment then
252 inString = not inString;
253 local pastText = text:sub(newLinePos, pos);
254 local testLabel = testLabel:Clone();
255 testLabel.Parent = coregui;
256 testLabel.Text = pastText;
257 local xPos = testLabel.TextBounds.X;
258 testLabel:Destroy();
259 local highlightLabel = highlightLabel:Clone();
260 highlightLabel.Name = "highlightLabel";
261 highlightLabel.TextColor3 = Color3.fromRGB(243, 221, 99);
262 highlightLabel.Text = char;
263 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
264 highlightLabel.Parent = scriptsBox;
265 elseif char == "-" and text:sub(pos + 2, pos + 2) == "-" and not inString then
266 inComment = true;
267 local pastText = text:sub(newLinePos, pos);
268 local testLabel = testLabel:Clone();
269 testLabel.Parent = coregui;
270 testLabel.Text = pastText;
271 local xPos = testLabel.TextBounds.X;
272 testLabel:Destroy();
273 local highlightLabel = highlightLabel:Clone();
274 highlightLabel.Name = "highlightLabel";
275 highlightLabel.TextColor3 = Color3.fromRGB(105, 103, 108);
276 highlightLabel.Text = char;
277 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
278 highlightLabel.Parent = scriptsBox;
279 elseif char == "\n" then
280 inComment = false;
281 newLinePos = pos + 1;
282 newLine = newLine + 1;
283 else
284 if inString then
285 local pastText = text:sub(newLinePos, pos);
286 local testLabel = testLabel:Clone();
287 testLabel.Parent = coregui;
288 testLabel.Text = pastText;
289 local xPos = testLabel.TextBounds.X;
290 testLabel:Destroy();
291 local highlightLabel = highlightLabel:Clone();
292 highlightLabel.Name = "highlightLabel";
293 highlightLabel.TextColor3 = Color3.fromRGB(243, 221, 99);
294 highlightLabel.Text = char;
295 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
296 highlightLabel.Parent = scriptsBox;
297 elseif inComment then
298 local pastText = text:sub(newLinePos, pos);
299 local testLabel = testLabel:Clone();
300 testLabel.Parent = coregui;
301 testLabel.Text = pastText;
302 local xPos = testLabel.TextBounds.X;
303 testLabel:Destroy();
304 local highlightLabel = highlightLabel:Clone();
305 highlightLabel.Name = "highlightLabel";
306 highlightLabel.TextColor3 = Color3.fromRGB(105, 103, 108);
307 highlightLabel.Text = char;
308 highlightLabel.Position = UDim2.new(0, xPos, 0, newLine * textYSize);
309 highlightLabel.Parent = scriptsBox;
310 end;
311 end;
312 pos = pos + 1;
313 end);
314 end;
315
316 local buttons = {
317 ["copyBtn"] = function() if currentButton then setclipboard(logs[currentButton]["Loading Script"]) end end,
318 ["clearBtn"] = function() logs = {}; for i, v in pairs(remotesScrollingFrame:GetChildren()) do if not v:IsA("UIListLayout") then v:Destroy(); end; end; remotesScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0); currentButton = nil; end,
319 ["exitBtn"] = function() currentRemote = nil; mainFrame:TweenSize(UDim2.new(0, 565, 0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25); wait(0.25); mainFrame:TweenSize(UDim2.new(0, 0, 0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25); wait(0.25); dexSpy.Enabled = false; mainFrame.Size = UDim2.new(0, 565, 0, 348); end,
320 ["miniBtn"] = function()
321 if mainFrame.Size ~= UDim2.new(0, 565, 0, 28) then
322 mainFrame:TweenSize(UDim2.new(0, 565, 0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true);
323 else
324 mainFrame:TweenSize(UDim2.new(0, 565, 0, 348), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true);
325 end;
326 end,
327 ["copyRemBtn"] = function() if currentButton then setclipboard(transformPath(logs[currentButton]["Remote"]:GetFullName())); end; end,
328 ["copyScrBtn"] = function() if currentButton then setclipboard(transformPath(logs[currentButton]["Calling Script"]:GetFullName())); end; end
329 };
330
331 for i, v in pairs(mainFrame:GetDescendants()) do
332 if buttons[v.Name] then
333 v.InputBegan:Connect(function(input)
334 if input.UserInputType == Enum.UserInputType.MouseMovement then
335 tweenService:Create(v, TweenInfo.new(0.1), {ImageTransparency = 0}):Play();
336 end;
337 end);
338 v.InputEnded:Connect(function(input)
339 if input.UserInputType == Enum.UserInputType.MouseMovement then
340 tweenService:Create(v, TweenInfo.new(0.1 ), {ImageTransparency = 1}):Play();
341 end;
342 end);
343 v.MouseButton1Click:Connect(buttons[v.Name]);
344 end;
345 end;
346
347 remotesScrollingFrame.ChildAdded:Connect(function(child)
348 local xBounds = child.remoteLabel.TextBounds.X;
349 local canSize = remotesScrollingFrame.CanvasSize
350 if xBounds > canSize.X.Offset then
351 remotesScrollingFrame.CanvasSize = UDim2.new(0, xBounds+40, 0, (#remotesScrollingFrame:GetChildren() - 1) * 24);
352 return
353 end;
354 remotesScrollingFrame.CanvasSize = UDim2.new(0, canSize.X.Offset, 0, (#remotesScrollingFrame:GetChildren() - 1) * 24);
355 end);
356end;
357
358do --// Extra Functions (From Hydroxide)
359 transformPath = function(path) [nonamecall]
360 local split = path:split('.');
361 local result = "";
362 local name = localPlayer.Name;
363
364 if #split == 1 and not game:FindFirstChild(split[1]) then
365 return split[1] .. " --[[ Parent is \"nil\" or object is destroyed ]]";
366 end;
367
368 if pcall(game.GetService, game, split[1]) then
369 split[1] = "GetService(\"" .. split[1] .. "\")";
370 end;
371
372 for i,v in pairs(split) do
373 if (v:sub(1, 1):match("%A") or v:find("%W")) and not v:find("GetService") then
374 result = result:sub(1, result:len());
375 v = "[\"" .. v .. "\"]";
376 elseif v:find("GetService") then
377 v = ':' .. v;
378 else
379 v = '.' .. v;
380 end;
381
382 result = result .. v;
383 end;
384
385 result = result:gsub("GetService(\"Players\")." .. name, "GetService(\"Players\").LocalPlayer");
386 result = result:gsub("GetService(\"Players\")[\"" .. name .. "\"]", "GetService(\"Players\").LocalPlayer");
387
388 return "game" .. result;
389 end;
390
391 dumpTable = function(t) [nonamecall]
392 local result = "{";
393
394 for i, v in pairs(t) do
395 local class = typeof(index)
396
397 if class == "table" then
398 result = result .. '[' .. dumpTable(index) .. ']'
399 elseif class == "string" then
400 if index:find("%A") then
401 result = result .. "[\"" .. index .. "\"]"
402 else
403 result = result .. index
404 end
405 elseif class == "number" then
406 elseif class == "Instance" then
407 result = result .. '[' .. transformPath(index:GetFullName()) .. ']';
408 elseif class ~= "nil" then
409 result = result .. tostring(index);
410 end;
411
412 if class ~= "number" and class ~= "nil" then
413 result = result .. " = ";
414 end;
415
416 result = result .. ValueToReadable(v) .. ', ';
417 end;
418
419 if result:sub(result:len() - 1, result:len()) == ", " then
420 result = result:sub(1, result:len() - 2);
421 end;
422
423 return result .. "}";
424 end;
425
426 ValueToReadable = function(value) [nonamecall]
427 local result = "";
428 local ttype = typeof(value);
429
430 if ttype == "table" then
431 result = result .. dumpTable(value);
432 elseif ttype == "string" then
433 result = result .. '"' .. value .. '"';
434 elseif ttype == "Instance" then
435 result = result .. transformPath(value:GetFullName());
436 elseif ttype == "Vector3" then
437 result = result .. "Vector3.new(" .. tostring(value) .. ")";
438 elseif ttype == "CFrame" then
439 result = result .. "CFrame.new(" .. tostring(value) .. ")";
440 elseif ttype == "Color3" then
441 result = result .. "Color3.new(" .. tostring(value) .. ")";
442 elseif ttype == "Ray" then
443 local split = tostring(value):split('}, ')
444 local origin = split[1]:gsub('{', "Vector3.new("):gsub('}', ')');
445 local direction = split[2]:gsub('{', "Vector3.new("):gsub('}', ')');
446 result = result .. "Ray.new(" .. origin .. "), " .. direction .. ')';
447 elseif ttype == "ColorSequence" then
448 result = result .. "ColorSequence.new(" .. dumpTable(v.Keypoints) .. ')';
449 elseif ttype == "ColorSequenceKeypoint" then
450 result = result .. "ColorSequenceKeypoint.new(" .. value.Time .. ", Color3.new(" .. tostring(value.Value) .. "))";
451 else
452 if type(value) == "userdata" then
453
454 end;
455
456 result = result .. tostring(value);
457 end;
458
459 return result;
460 end;
461end;
462
463local function saveData(button, remote, callingScript, ...) [nonamecall]
464 local args = {...};
465 local callerScript = "";
466 local localArgs = {};
467
468 for i,v in pairs(args) do
469 table.insert(localArgs, "StarSmasher" .. i);
470 callerScript = callerScript .. "local StarSmasher" .. i .. " = " .. ValueToReadable(v) .. "\n";
471 end;
472
473 callerScript = callerScript .. transformPath(remote:GetFullName()) .. ":" .. (remote:IsA("RemoteEvent") and "FireServer" or "InvokeServer") .. "(" .. table.concat(localArgs, ",") .. ")";
474
475 local data = {
476 ["Remote"] = remote,
477 ["Calling Script"] = callingScript,
478 ["Loading Script"] = callerScript
479 };
480
481 logs[button] = data;
482end;
483
484local function log(remote, ...) [nonamecall]
485 setthreadcontext(6);
486 local remoteButton;
487 if remote:IsA("RemoteEvent") then
488 remoteButton = remoteEvent:Clone();
489 elseif remote:IsA("RemoteFunction") then
490 remoteButton = remoteFunction:Clone();
491 end
492 remoteButton.remoteLabel.Text = remote.Name;
493 remoteButton.Parent = remotesScrollingFrame;
494 saveData(remoteButton, remote, getfenv(3).script, ...);
495 remoteButton.MouseEnter:Connect(function()
496 setthreadcontext(6);
497 if remoteButton ~= currentButton then
498 tweenService:Create(remoteButton, TweenInfo.new(0.1), {BackgroundTransparency = 0}):Play();
499 end;
500 end);
501 remoteButton.MouseLeave:Connect(function()
502 setthreadcontext(6);
503 if remoteButton ~= currentButton then
504 tweenService:Create(remoteButton, TweenInfo.new(0.1), {BackgroundTransparency = 1}):Play();
505 end;
506 end);
507 remoteButton.MouseButton1Click:Connect(function()
508 setthreadcontext(6);
509 if currentButton then currentButton.BackgroundTransparency = 1; end
510 currentButton = remoteButton;
511 currentButton.BackgroundColor3 = Color3.fromRGB(140, 30, 49);
512 scriptsBox.Text = logs[remoteButton]["Loading Script"];
513 syntaxHighlight();
514 local XTBounds = scriptsBox.TextBounds.X;
515 local YTBounds = scriptsBox.TextBounds.Y;
516 scriptsBox.Size = UDim2.new(0, XTBounds + 2, 0, YTBounds + 2);
517 local newXCanvas = XTBounds > scriptsScrollingFrame.Size.X.Offset and (XTBounds + 2.5) or 0;
518 local newYCanvas = YTBounds > scriptsScrollingFrame.Size.Y.Offset and (YTBounds + 2.5) or 0;
519 scriptsScrollingFrame.CanvasSize = UDim2.new(0, newXCanvas, 0, newYCanvas);
520 end);
521 setthreadcontext(2);
522end;
523
524local mt = getrawmetatable(game);
525local oldNamecall = mt.__namecall;
526local currentRemote;
527setreadonly(mt, false);
528
529mt.__namecall = newcclosure(function(obj, ...) [nonamecall]
530 local method = getnamecallmethod();
531 if not checkcaller() and tostring(method) == "FireServer" or tostring(method) == "InvokeServer" then
532 if obj == currentRemote then
533 log(obj, ...);
534 end;
535 end;
536
537 return oldNamecall(obj, ...);
538end);
539
540setreadonly(mt, true);
541
542local oldFireServer;
543local oldInvokeServer;
544
545oldFireServer = hookfunction(Instance.new("RemoteEvent").FireServer, function(remote, ...)
546 if not checkcaller() and remote == currentRemote then
547 log(remote, ...);
548 end;
549
550 return oldFireServer(remote, ...);
551end);
552
553oldInvokeServer = hookfunction(Instance.new("RemoteFunction").InvokeServer, function(remote, ...)
554 if not checkcaller() and remote == currentRemote then
555 log(remote, ...);
556 end;
557
558 return oldInvokeServer(remote, ...);
559end);
560
561local scriptDumper = game:GetObjects("rbxassetid://4544004447")[1];
562local localScript = game:GetObjects("rbxassetid://4544003591")[1];
563local moduleScript = game:GetObjects("rbxassetid://4544002916")[1];
564localScript.BackgroundColor3 = Color3.fromRGB(140, 30, 49);
565localScript.AutoButtonColor = false
566moduleScript.BackgroundColor3 = Color3.fromRGB(140, 30, 49);
567moduleScript.AutoButtonColor = false
568local mainFrame = scriptDumper.mainFrame;
569local topbarFrame = mainFrame.topbarFrame;
570local exitBtn = topbarFrame.exitBtn;
571local miniBtn = topbarFrame.miniBtn;
572local scriptsFrame = mainFrame.scriptsFrame;
573local scriptsScrollingFrame = scriptsFrame.scriptsScrollingFrame;
574local dumpsFrame = mainFrame.dumpsFrame;
575local dumpsScrollingFrame = dumpsFrame.dumpsScrollingFrame;
576local dumpsBox = dumpsScrollingFrame.dumpsBox;
577local clearBtn = mainFrame.clearBtn;
578local copyBtn = mainFrame.copyBtn;
579local currentButton;
580scriptDumper.Enabled = false;
581scriptDumper.Parent = coregui;
582
583do --// UI Setup
584 draggable(mainFrame);
585
586 local buttons = {
587 ["copyBtn"] = function() if currentButton then setclipboard(dlogs[currentButton]["Loading Dump"]) end end,
588 ["clearBtn"] = function() dlogs = {}; for i, v in pairs(scriptsScrollingFrame:GetChildren()) do if not v:IsA("UIListLayout") then v:Destroy(); end; end; remotesScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0); currentButton = nil; end,
589 ["exitBtn"] = function() mainFrame:TweenSize(UDim2.new(0, 565, 0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25); wait(0.25); mainFrame:TweenSize(UDim2.new(0, 0, 0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25); wait(0.25); scriptDumper.Enabled = false; mainFrame.Size = UDim2.new(0, 565, 0, 348); end,
590 ["miniBtn"] = function()
591 if mainFrame.Size ~= UDim2.new(0, 565, 0, 28) then
592 mainFrame:TweenSize(UDim2.new(0, 565, 0, 28), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true);
593 else
594 mainFrame:TweenSize(UDim2.new(0, 565, 0, 348), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.25, true);
595 end;
596 end
597 };
598
599 for i, v in pairs(mainFrame:GetDescendants()) do
600 if buttons[v.Name] then
601 v.InputBegan:Connect(function(input)
602 if input.UserInputType == Enum.UserInputType.MouseMovement then
603 tweenService:Create(v, TweenInfo.new(0.1), {ImageTransparency = 0}):Play();
604 end;
605 end);
606 v.InputEnded:Connect(function(input)
607 if input.UserInputType == Enum.UserInputType.MouseMovement then
608 tweenService:Create(v, TweenInfo.new(0.1), {ImageTransparency = 1}):Play();
609 end;
610 end);
611 v.MouseButton1Click:Connect(buttons[v.Name]);
612 end;
613 end;
614
615 scriptsScrollingFrame.ChildAdded:Connect(function(child)
616 if scriptsScrollingFrame.CanvasSize.X.Offset ~= 150 then
617 scriptsScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, (#scriptsScrollingFrame:GetChildren() - 1) * 24);
618 else
619 scriptsScrollingFrame.CanvasSize = UDim2.new(0, 150, 0, (#scriptsScrollingFrame:GetChildren() - 1) * 24);
620 end;
621 if child.scriptLabel.TextBounds.X > (scriptsScrollingFrame.Size.X.Offset - 20) then
622 scriptsScrollingFrame.CanvasSize = UDim2.new(0, 150, 0, (#scriptsScrollingFrame:GetChildren() - 1) * 24);
623 end;
624 end);
625end;
626
627local function saveDData(button, script) [nonamecall]
628 local function dumpScript(script)
629 local str = "";
630
631 for i, func in pairs(getgc()) do
632 if type(func) == "function" and getfenv(func).script == script then
633 str = str..("-"):rep(#tostring(func)).."\n\n"..tostring(func).." :\n";
634 str = str.."Constants :\n";
635 for idx, constant in pairs(debug.getconstants(func)) do
636 str = str.."\t["..idx.."] : "..ValueToReadable(constant).."\n";
637 end
638 str = str.."Upvalues :\n";
639 for idx, upval in pairs(debug.getupvalues(func)) do
640 str = str.."\t["..idx.."] : "..ValueToReadable(upval).."\n";
641 end
642 str = str.."\n"..("-"):rep(#tostring(func)).."\n"
643 end
644 end
645
646 return str;
647 end;
648
649 local data = {
650 ["Script"] = script,
651 ["Loading Dump"] = dumpScript(script)
652 };
653
654 dlogs[button] = data;
655end;
656
657local function log(script) [nonamecall]
658 local scriptButton;
659 if script:IsA("LocalScript") then
660 scriptButton = localScript:Clone();
661 elseif script:IsA("ModuleScript") then
662 scriptButton = moduleScript:Clone();
663 end;
664 scriptButton.scriptLabel.Text = script.Name;
665 scriptButton.Parent = scriptsScrollingFrame;
666 saveDData(scriptButton, script);
667 scriptButton.MouseEnter:Connect(function()
668 if scriptButton ~= currentButton then
669 tweenService:Create(scriptButton, TweenInfo.new(0.1), {BackgroundTransparency = 0}):Play();
670 end;
671 end);
672 scriptButton.MouseLeave:Connect(function()
673 if scriptButton ~= currentButton then
674 tweenService:Create(scriptButton, TweenInfo.new(0.1), {BackgroundTransparency = 1}):Play();
675 end;
676 end);
677 scriptButton.MouseButton1Click:Connect(function()
678 currentButton = scriptButton;
679 dumpsBox.Text = dlogs[scriptButton]["Loading Dump"];
680 local XTBounds = dumpsBox.TextBounds.X;
681 local YTBounds = dumpsBox.TextBounds.Y;
682 dumpsBox.Size = UDim2.new(0, XTBounds + 2, 0, YTBounds + 2);
683 local newXCanvas = XTBounds > dumpsScrollingFrame.Size.X.Offset and (XTBounds + 2.5) or 0;
684 local newYCanvas = YTBounds > dumpsScrollingFrame.Size.Y.Offset and (YTBounds + 2.5) or 0;
685 dumpsScrollingFrame.CanvasSize = UDim2.new(0, newXCanvas, 0, newYCanvas);
686 end);
687end;
688
689CreateGui = function()
690local ROBLOX = Instance.new("ScreenGui")
691local PropertiesFrame = Instance.new("Frame")
692local Header = Instance.new("Frame")
693local TextLabel = Instance.new("TextLabel")
694local TextBox = Instance.new("TextBox")
695local ExplorerPanel = Instance.new("Frame")
696local SideMenu = Instance.new("Frame")
697local Toggle = Instance.new("TextButton")
698local Title = Instance.new("TextLabel")
699local Version = Instance.new("TextLabel")
700local Slant = Instance.new("ImageLabel")
701local Main = Instance.new("Frame")
702local SlideOut = Instance.new("Frame")
703local SlideFrame = Instance.new("Frame")
704local Explorer = Instance.new("TextButton")
705local Icon = Instance.new("ImageLabel")
706local SaveMap = Instance.new("TextButton")
707local Icon_2 = Instance.new("ImageLabel")
708local Settings = Instance.new("TextButton")
709local Icon_3 = Instance.new("ImageLabel")
710local Icon_4 = Instance.new("ImageLabel")
711local About = Instance.new("TextButton")
712local Icon_5 = Instance.new("ImageLabel")
713local OpenScriptEditor = Instance.new("TextButton")
714local Icon_6 = Instance.new("ImageLabel")
715local Toggle_2 = Instance.new("TextButton")
716local SettingsPanel = Instance.new("Frame")
717local Header_2 = Instance.new("Frame")
718local TextLabel_2 = Instance.new("TextLabel")
719local SettingTemplate = Instance.new("Frame")
720local SName = Instance.new("TextLabel")
721local Status = Instance.new("TextLabel")
722local Change = Instance.new("TextButton")
723local OnBar = Instance.new("TextLabel")
724local Bar = Instance.new("TextLabel")
725local SettingList = Instance.new("Frame")
726local SaveInstance = Instance.new("Frame")
727local Title_2 = Instance.new("TextLabel")
728local MainWindow = Instance.new("Frame")
729local Save = Instance.new("TextButton")
730local Desc = Instance.new("TextLabel")
731local Cancel = Instance.new("TextButton")
732local FileName = Instance.new("TextBox")
733local SaveObjects = Instance.new("TextButton")
734local enabled = Instance.new("TextLabel")
735local Desc2 = Instance.new("TextLabel")
736local Confirmation = Instance.new("Frame")
737local Title_3 = Instance.new("TextLabel")
738local MainWindow_2 = Instance.new("Frame")
739local Yes = Instance.new("TextButton")
740local Desc_2 = Instance.new("TextLabel")
741local No = Instance.new("TextButton")
742local Caution = Instance.new("Frame")
743local Title_4 = Instance.new("TextLabel")
744local MainWindow_3 = Instance.new("Frame")
745local Desc_3 = Instance.new("TextLabel")
746local Ok = Instance.new("TextButton")
747local CallRemote = Instance.new("Frame")
748local Title_5 = Instance.new("TextLabel")
749local MainWindow_4 = Instance.new("Frame")
750local Desc_4 = Instance.new("TextLabel")
751local Arguments = Instance.new("ScrollingFrame")
752local DisplayReturned = Instance.new("TextButton")
753local enabled_2 = Instance.new("TextLabel")
754local Desc2_2 = Instance.new("TextLabel")
755local Add = Instance.new("TextButton")
756local Subtract = Instance.new("TextButton")
757local ArgumentTemplate = Instance.new("Frame")
758local Type = Instance.new("TextButton")
759local Value = Instance.new("TextBox")
760local Cancel_2 = Instance.new("TextButton")
761local Ok_2 = Instance.new("TextButton")
762local TableCaution = Instance.new("Frame")
763local MainWindow_5 = Instance.new("Frame")
764local Ok_3 = Instance.new("TextButton")
765local TableResults = Instance.new("ScrollingFrame")
766local TableTemplate = Instance.new("Frame")
767local Type_2 = Instance.new("TextLabel")
768local Value_2 = Instance.new("TextLabel")
769local Title_6 = Instance.new("TextLabel")
770local ScriptEditor = Instance.new("Frame")
771local Title_7 = Instance.new("TextLabel")
772local Cover = Instance.new("Frame")
773local EditorGrid = Instance.new("Frame")
774local TopBar = Instance.new("Frame")
775local ScriptBarLeft = Instance.new("ImageButton")
776local ArrowGraphic = Instance.new("Frame")
777local Graphic = Instance.new("Frame")
778local Graphic_2 = Instance.new("Frame")
779local Graphic_3 = Instance.new("Frame")
780local Graphic_4 = Instance.new("Frame")
781local ScriptBarRight = Instance.new("ImageButton")
782local ArrowGraphic_2 = Instance.new("Frame")
783local Graphic_5 = Instance.new("Frame")
784local Graphic_6 = Instance.new("Frame")
785local Graphic_7 = Instance.new("Frame")
786local Graphic_8 = Instance.new("Frame")
787local Clipboard = Instance.new("TextButton")
788local SaveScript = Instance.new("TextButton")
789local ScriptBar = Instance.new("Frame")
790local Entry = Instance.new("Frame")
791local Button = Instance.new("TextButton")
792local Close = Instance.new("TextButton")
793local Close_2 = Instance.new("TextButton")
794local IntroFrame = Instance.new("Frame")
795local Main_2 = Instance.new("Frame")
796local ImageLabel = Instance.new("ImageLabel")
797local Title_8 = Instance.new("ImageLabel")
798local Title_9 = Instance.new("ImageLabel")
799local Version_2 = Instance.new("TextLabel")
800local Creator = Instance.new("TextLabel")
801local BG = Instance.new("ImageLabel")
802local Slant_2 = Instance.new("Frame")
803local ImageLabel_2 = Instance.new("ImageLabel")
804local SaveMapWindow = Instance.new("Frame")
805local Header_3 = Instance.new("Frame")
806local TextLabel_3 = Instance.new("TextLabel")
807local MapSettings = Instance.new("Frame")
808local Terrain = Instance.new("Frame")
809local SName_2 = Instance.new("TextLabel")
810local Status_2 = Instance.new("TextLabel")
811local Change_2 = Instance.new("TextButton")
812local OnBar_2 = Instance.new("TextLabel")
813local Bar_2 = Instance.new("TextLabel")
814local Lighting = Instance.new("Frame")
815local SName_3 = Instance.new("TextLabel")
816local Status_3 = Instance.new("TextLabel")
817local Change_3 = Instance.new("TextButton")
818local OnBar_3 = Instance.new("TextLabel")
819local Bar_3 = Instance.new("TextLabel")
820local CameraInstances = Instance.new("Frame")
821local SName_4 = Instance.new("TextLabel")
822local Status_4 = Instance.new("TextLabel")
823local Change_4 = Instance.new("TextButton")
824local OnBar_4 = Instance.new("TextLabel")
825local Bar_4 = Instance.new("TextLabel")
826local Scripts = Instance.new("Frame")
827local SName_5 = Instance.new("TextLabel")
828local Status_5 = Instance.new("TextLabel")
829local Change_5 = Instance.new("TextButton")
830local OnBar_5 = Instance.new("TextLabel")
831local Bar_5 = Instance.new("TextLabel")
832local ToSave = Instance.new("TextLabel")
833local CopyList = Instance.new("Frame")
834local Bottom = Instance.new("Frame")
835local TextLabel_4 = Instance.new("TextLabel")
836local Save_2 = Instance.new("TextButton")
837local FileName_2 = Instance.new("TextBox")
838local Entry_2 = Instance.new("Frame")
839local Change_6 = Instance.new("TextButton")
840local enabled_3 = Instance.new("TextLabel")
841local Info = Instance.new("TextLabel")
842local RemoteDebugWindow = Instance.new("Frame")
843local Header_4 = Instance.new("Frame")
844local TextLabel_5 = Instance.new("TextLabel")
845local AboutWindow = Instance.new("Frame")
846local Header_5 = Instance.new("Frame")
847local TextLabel_6 = Instance.new("TextLabel")
848local Desc_6 = Instance.new("TextLabel")
849
850ROBLOX.Name = RandomCharacters(16, 64)
851
852PropertiesFrame.Name = "PropertiesFrame"
853PropertiesFrame.Parent = ROBLOX
854PropertiesFrame.Active = true
855PropertiesFrame.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
856PropertiesFrame.Transparency = 0.2
857PropertiesFrame.BorderColor3 = Color3.fromRGB(191, 191, 191)
858PropertiesFrame.BorderSizePixel = 0
859PropertiesFrame.Position = UDim2.new(1, 0, 0.5, 36)
860PropertiesFrame.Size = UDim2.new(0, 300, 0.5, -36)
861
862Header.Name = "Header"
863Header.Parent = PropertiesFrame
864Header.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
865Header.BorderColor3 = Color3.fromRGB(149, 149, 149)
866Header.BorderSizePixel = 0
867Header.Position = UDim2.new(0, 0, 0, -35)
868Header.Size = UDim2.new(1, 0, 0, 35)
869
870TextLabel.Parent = Header
871TextLabel.BackgroundTransparency = 1
872TextLabel.Position = UDim2.new(0, 4, 0, 0)
873TextLabel.Size = UDim2.new(1, -4, 0.5, 0)
874TextLabel.Font = Enum.Font.SourceSans
875TextLabel.Text = "Properties"
876TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
877TextLabel.TextSize = 14
878TextLabel.TextXAlignment = Enum.TextXAlignment.Left
879
880TextBox.Parent = Header
881TextBox.BackgroundTransparency = 0.8
882TextBox.Position = UDim2.new(0, 4, 0.5, 0)
883TextBox.Size = UDim2.new(1, -8, 0.5, -3)
884TextBox.Font = Enum.Font.SourceSans
885TextBox.PlaceholderText = "Search Properties"
886TextBox.Text = ""
887TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
888TextBox.TextSize = 14
889TextBox.TextXAlignment = Enum.TextXAlignment.Left
890
891ExplorerPanel.Name = "ExplorerPanel"
892ExplorerPanel.Parent = ROBLOX
893ExplorerPanel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
894ExplorerPanel.BorderColor3 = Color3.fromRGB(191, 191, 191)
895ExplorerPanel.BorderSizePixel = 0
896ExplorerPanel.Position = UDim2.new(1, 0, 0, 1)
897ExplorerPanel.Size = UDim2.new(0, 300, 0.5, 0)
898ExplorerPanel.Transparency = 0.2
899
900SideMenu.Name = "SideMenu"
901SideMenu.Parent = ROBLOX
902SideMenu.BackgroundColor3 = Color3.fromRGB(233, 233, 233)
903SideMenu.BackgroundTransparency = 1
904SideMenu.BorderColor3 = Color3.fromRGB(149, 149, 149)
905SideMenu.BorderSizePixel = 0
906SideMenu.Position = UDim2.new(1, -330, 0, 0)
907SideMenu.Size = UDim2.new(0, 30, 0, 180)
908SideMenu.Visible = false
909SideMenu.ZIndex = 2
910
911Toggle.Name = "Toggle"
912Toggle.Parent = SideMenu
913Toggle.Active = false
914Toggle.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
915Toggle.BorderSizePixel = 0
916Toggle.Position = UDim2.new(0, 0, 0, 60)
917Toggle.Size = UDim2.new(0, 30, 0, 30)
918Toggle.AutoButtonColor = false
919Toggle.Font = Enum.Font.SourceSans
920Toggle.Text = ">"
921Toggle.TextColor3 = Color3.fromRGB(0, 170, 255)
922Toggle.TextSize = 24
923Toggle.TextTransparency = 1
924Toggle.TextWrapped = true
925
926
927
928Title.Name = "Title"
929Title.Parent = SideMenu
930Title.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
931Title.BackgroundTransparency = 1
932Title.Size = UDim2.new(0, 30, 0, 20)
933Title.ZIndex = 2
934Title.Font = Enum.Font.SourceSansBold
935Title.Text = "DEX"
936Title.TextColor3 = Color3.fromRGB(0, 170, 255)
937Title.TextSize = 14
938Title.TextWrapped = true
939
940Version.Name = "Version"
941Version.Parent = SideMenu
942Version.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
943Version.BackgroundTransparency = 1
944Version.Position = UDim2.new(0, 0, 0, 15)
945Version.Size = UDim2.new(0, 30, 0, 20)
946Version.ZIndex = 2
947Version.Font = Enum.Font.SourceSansBold
948Version.Text = "V2.0.1"
949Version.TextColor3 = Color3.fromRGB(0, 170, 255)
950Version.TextSize = 12
951Version.TextWrapped = true
952
953Slant.Name = "Slant"
954Slant.Parent = SideMenu
955Slant.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
956Slant.BackgroundTransparency = 1
957Slant.Position = UDim2.new(0, 0, 0, 90)
958Slant.Rotation = 180
959Slant.Size = UDim2.new(0, 30, 0, 30)
960Slant.ImageColor3 = Color3.fromRGB(43, 43, 43)
961Slant.Image = "rbxassetid://474172996"
962
963Main.Name = "Main"
964Main.Parent = SideMenu
965Main.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
966Main.BorderSizePixel = 0
967Main.Size = UDim2.new(0, 30, 0, 30)
968
969SlideOut.Name = "SlideOut"
970SlideOut.Parent = SideMenu
971SlideOut.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
972SlideOut.BackgroundTransparency = 1
973SlideOut.BorderSizePixel = 0
974SlideOut.ClipsDescendants = true
975SlideOut.Position = UDim2.new(0, 0, 0, 30)
976SlideOut.Size = UDim2.new(0, 30, 0, 150)
977
978SlideFrame.Name = "SlideFrame"
979SlideFrame.Parent = SlideOut
980SlideFrame.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
981SlideFrame.BorderSizePixel = 0
982SlideFrame.Position = UDim2.new(0, 0, 0, -150)
983SlideFrame.Size = UDim2.new(0, 30, 0, 150)
984
985Explorer.Name = "Explorer"
986Explorer.Parent = SlideFrame
987Explorer.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
988Explorer.BackgroundTransparency = 1
989Explorer.BorderSizePixel = 0
990Explorer.Position = UDim2.new(0, 0, 0, 90)
991Explorer.Size = UDim2.new(0, 30, 0, 30)
992Explorer.ZIndex = 2
993Explorer.AutoButtonColor = false
994Explorer.Font = Enum.Font.SourceSans
995Explorer.Text = ""
996Explorer.TextSize = 24
997
998Icon.Name = "Icon"
999Icon.Parent = Explorer
1000Icon.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
1001Icon.BackgroundTransparency = 1
1002Icon.Position = UDim2.new(0, 5, 0, 5)
1003Icon.Size = UDim2.new(0, 20, 0, 20)
1004Icon.ZIndex = 2
1005Icon.Image = "rbxassetid://472635937"
1006
1007SaveMap.Name = "SaveMap"
1008SaveMap.Parent = SlideFrame
1009SaveMap.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1010SaveMap.BackgroundTransparency = 1
1011SaveMap.BorderSizePixel = 0
1012SaveMap.Position = UDim2.new(0, 0, 0, 60)
1013SaveMap.Size = UDim2.new(0, 30, 0, 30)
1014SaveMap.ZIndex = 2
1015SaveMap.AutoButtonColor = false
1016SaveMap.Font = Enum.Font.SourceSans
1017SaveMap.Text = ""
1018SaveMap.TextSize = 24
1019
1020Icon_2.Name = "Icon"
1021Icon_2.Parent = SaveMap
1022Icon_2.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
1023Icon_2.BackgroundTransparency = 1
1024Icon_2.Position = UDim2.new(0, 5, 0, 5)
1025Icon_2.Size = UDim2.new(0, 20, 0, 20)
1026Icon_2.ZIndex = 2
1027Icon_2.Image = "rbxassetid://472636337"
1028
1029Settings.Name = "Settings"
1030Settings.Parent = SlideFrame
1031Settings.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1032Settings.BackgroundTransparency = 1
1033Settings.BorderSizePixel = 0
1034Settings.Position = UDim2.new(0, 0, 0, 30)
1035Settings.Size = UDim2.new(0, 30, 0, 30)
1036Settings.ZIndex = 2
1037Settings.AutoButtonColor = false
1038Settings.Font = Enum.Font.SourceSans
1039Settings.Text = ""
1040Settings.TextSize = 24
1041
1042Icon_3.Name = "Icon"
1043Icon_3.Parent = Settings
1044Icon_3.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
1045Icon_3.ImageColor3 = Color3.fromRGB(0, 170, 255)
1046Icon_3.BackgroundTransparency = 1
1047Icon_3.Position = UDim2.new(0, 5, 0, 5)
1048Icon_3.Size = UDim2.new(0, 20, 0, 20)
1049Icon_3.ZIndex = 2
1050Icon_3.Image = "rbxassetid://472635774"
1051
1052About.Name = "About"
1053About.Parent = SlideFrame
1054About.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1055About.BackgroundTransparency = 1
1056About.BorderSizePixel = 0
1057About.Size = UDim2.new(0, 30, 0, 30)
1058About.ZIndex = 2
1059About.AutoButtonColor = false
1060About.Font = Enum.Font.SourceSans
1061About.Text = ""
1062About.TextSize = 24
1063
1064Icon_5.Archivable = false
1065Icon_5.Name = "Icon"
1066Icon_5.Parent = About
1067Icon_5.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
1068Icon_5.ImageColor3 = Color3.fromRGB(0, 170, 255)
1069Icon_5.BackgroundTransparency = 1
1070Icon_5.Position = UDim2.new(0, 5, 0, 5)
1071Icon_5.Size = UDim2.new(0, 20, 0, 20)
1072Icon_5.ZIndex = 2
1073Icon_5.Image = "rbxassetid://476354004"
1074
1075OpenScriptEditor.Name = "OpenScriptEditor"
1076OpenScriptEditor.Parent = SideMenu
1077OpenScriptEditor.Active = false
1078OpenScriptEditor.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1079OpenScriptEditor.BorderSizePixel = 0
1080OpenScriptEditor.Position = UDim2.new(0, 0, 0, 30)
1081OpenScriptEditor.Size = UDim2.new(0, 30, 0, 30)
1082OpenScriptEditor.ZIndex = 2
1083OpenScriptEditor.AutoButtonColor = false
1084OpenScriptEditor.Font = Enum.Font.SourceSans
1085OpenScriptEditor.Text = ""
1086OpenScriptEditor.TextSize = 24
1087
1088Icon_6.Name = "Icon"
1089Icon_6.Parent = OpenScriptEditor
1090Icon_6.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
1091Icon_6.ImageColor3 = Color3.fromRGB(0, 170, 255)
1092Icon_6.BackgroundTransparency = 1
1093Icon_6.Position = UDim2.new(0, 5, 0, 5)
1094Icon_6.Size = UDim2.new(0, 20, 0, 20)
1095Icon_6.ZIndex = 2
1096Icon_6.Image = "rbxassetid://475456048"
1097Icon_6.ImageTransparency = 1
1098
1099Toggle_2.Name = "Toggle"
1100Toggle_2.Parent = ROBLOX
1101Toggle_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1102Toggle_2.BorderColor3 = Color3.fromRGB(53, 53, 53)
1103Toggle_2.TextColor3 = Color3.fromRGB(0, 170, 255)
1104Toggle_2.Position = UDim2.new(1, 0, 0, 0)
1105Toggle_2.Size = UDim2.new(0, 30, 0, 30)
1106Toggle_2.Font = Enum.Font.SourceSans
1107Toggle_2.Text = "<"
1108Toggle_2.TextSize = 24
1109
1110SettingsPanel.Name = "SettingsPanel"
1111SettingsPanel.Parent = ROBLOX
1112SettingsPanel.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1113SettingsPanel.BorderColor3 = Color3.fromRGB(191, 191, 191)
1114SettingsPanel.BorderSizePixel = 0
1115SettingsPanel.Position = UDim2.new(1, 0, 0, 1)
1116SettingsPanel.Size = UDim2.new(0, 300, 1, 0)
1117
1118Header_2.Name = "Header"
1119Header_2.Parent = SettingsPanel
1120Header_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1121Header_2.BorderColor3 = Color3.fromRGB(30, 30, 30)
1122Header_2.Size = UDim2.new(1, 0, 0, 17)
1123
1124TextLabel_2.Parent = Header_2
1125TextLabel_2.BackgroundTransparency = 1
1126TextLabel_2.Position = UDim2.new(0, 4, 0, 0)
1127TextLabel_2.Size = UDim2.new(1, -4, 1, 0)
1128TextLabel_2.Font = Enum.Font.SourceSans
1129TextLabel_2.Text = "Settings"
1130TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1131TextLabel_2.TextSize = 14
1132TextLabel_2.TextXAlignment = Enum.TextXAlignment.Left
1133
1134SettingTemplate.Name = "SettingTemplate"
1135SettingTemplate.Parent = SettingsPanel
1136SettingTemplate.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1137SettingTemplate.BackgroundTransparency = 1
1138SettingTemplate.Position = UDim2.new(0, 0, 0, 18)
1139SettingTemplate.Size = UDim2.new(1, 0, 0, 60)
1140SettingTemplate.Visible = false
1141
1142SName.Name = "SName"
1143SName.Parent = SettingTemplate
1144SName.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1145SName.BackgroundTransparency = 1
1146SName.Position = UDim2.new(0, 10, 0, 0)
1147SName.Size = UDim2.new(1, -20, 0, 30)
1148SName.Font = Enum.Font.SourceSans
1149SName.Text = "SettingName"
1150SName.TextColor3 = Color3.fromRGB(255, 255, 255)
1151SName.TextSize = 18
1152SName.TextXAlignment = Enum.TextXAlignment.Left
1153
1154Status.Name = "Status"
1155Status.Parent = SettingTemplate
1156Status.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1157Status.BackgroundTransparency = 1
1158Status.Position = UDim2.new(0, 60, 0, 30)
1159Status.Size = UDim2.new(0, 50, 0, 15)
1160Status.Font = Enum.Font.SourceSans
1161Status.Text = "Off"
1162Status.TextColor3 = Color3.fromRGB(255, 255, 255)
1163Status.TextSize = 18
1164Status.TextXAlignment = Enum.TextXAlignment.Left
1165
1166Change.Name = "Change"
1167Change.Parent = SettingTemplate
1168Change.BackgroundColor3 = Color3.fromRGB(81, 81, 81)
1169Change.BorderSizePixel = 0
1170Change.Position = UDim2.new(0, 10, 0, 30)
1171Change.Size = UDim2.new(0, 40, 0, 15)
1172Change.Font = Enum.Font.SourceSans
1173Change.Text = ""
1174Change.TextColor3 = Color3.fromRGB(255, 255, 255)
1175Change.TextSize = 14
1176
1177OnBar.Name = "OnBar"
1178OnBar.Parent = Change
1179OnBar.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
1180OnBar.BorderSizePixel = 0
1181OnBar.Size = UDim2.new(0, 0, 0, 15)
1182OnBar.Font = Enum.Font.SourceSans
1183OnBar.Text = ""
1184OnBar.TextColor3 = Color3.fromRGB(255, 255, 255)
1185OnBar.TextSize = 14
1186
1187Bar.Name = "Bar"
1188Bar.Parent = Change
1189Bar.BackgroundColor3 = Color3.fromRGB(219, 47, 84)
1190Bar.BorderSizePixel = 0
1191Bar.ClipsDescendants = true
1192Bar.Position = UDim2.new(0, -2, 0, -2)
1193Bar.Size = UDim2.new(0, 10, 0, 19)
1194Bar.Font = Enum.Font.SourceSans
1195Bar.Text = ""
1196Bar.TextColor3 = Color3.fromRGB(255, 255, 255)
1197Bar.TextSize = 14
1198
1199SettingList.Name = "SettingList"
1200SettingList.Parent = SettingsPanel
1201SettingList.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1202SettingList.BackgroundTransparency = 1
1203SettingList.Position = UDim2.new(0, 0, 0, 17)
1204SettingList.Size = UDim2.new(1, 0, 1, -17)
1205
1206SaveInstance.Name = "SaveInstance"
1207SaveInstance.Parent = ROBLOX
1208SaveInstance.Active = true
1209SaveInstance.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1210SaveInstance.BorderColor3 = Color3.fromRGB(30, 30, 30)
1211dragger.new(SaveInstance)
1212SaveInstance.Position = UDim2.new(0.3, 0, 0.3, 0)
1213SaveInstance.Size = UDim2.new(0, 350, 0, 20)
1214SaveInstance.Visible = false
1215SaveInstance.ZIndex = 2
1216
1217Title_2.Name = "Title"
1218Title_2.Parent = SaveInstance
1219Title_2.BackgroundTransparency = 1
1220Title_2.Size = UDim2.new(1, 0, 1, 0)
1221Title_2.ZIndex = 2
1222Title_2.Font = Enum.Font.SourceSans
1223Title_2.Text = "Save Instance"
1224Title_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1225Title_2.TextSize = 14
1226Title_2.TextXAlignment = Enum.TextXAlignment.Left
1227
1228MainWindow.Name = "MainWindow"
1229MainWindow.Parent = SaveInstance
1230MainWindow.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1231MainWindow.BackgroundTransparency = 0.1
1232MainWindow.BorderColor3 = Color3.fromRGB(30, 30, 30)
1233MainWindow.Size = UDim2.new(1, 0, 0, 200)
1234
1235Save.Name = "Save"
1236Save.Parent = MainWindow
1237Save.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1238Save.BackgroundTransparency = 0.5
1239Save.BorderColor3 = Color3.fromRGB(40, 40, 40)
1240Save.Position = UDim2.new(0.075, 0, 1, -40)
1241Save.Size = UDim2.new(0.4, 0, 0, 30)
1242Save.Font = Enum.Font.SourceSans
1243Save.Text = "Save"
1244Save.TextColor3 = Color3.fromRGB(255, 255, 255)
1245Save.TextSize = 18
1246
1247Desc.Name = "Desc"
1248Desc.Parent = MainWindow
1249Desc.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1250Desc.BackgroundTransparency = 1
1251Desc.Position = UDim2.new(0, 0, 0, 20)
1252Desc.Size = UDim2.new(1, 0, 0, 40)
1253Desc.Font = Enum.Font.SourceSans
1254Desc.Text = "This will save an instance to your PC. Type in the name for your instance. (.rbxmx will be added automatically.)"
1255Desc.TextColor3 = Color3.fromRGB(255, 255, 255)
1256Desc.TextSize = 14
1257Desc.TextWrapped = true
1258
1259Cancel.Name = "Cancel"
1260Cancel.Parent = MainWindow
1261Cancel.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1262Cancel.BackgroundTransparency = 0.5
1263Cancel.BorderColor3 = Color3.fromRGB(40, 40, 40)
1264Cancel.Position = UDim2.new(0.524, 0, 1, -40)
1265Cancel.Size = UDim2.new(0.4, 0, 0, 30)
1266Cancel.Font = Enum.Font.SourceSans
1267Cancel.Text = "Cancel"
1268Cancel.TextColor3 = Color3.fromRGB(255, 255, 255)
1269Cancel.TextSize = 18
1270
1271FileName.Name = "FileName"
1272FileName.Parent = MainWindow
1273FileName.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1274FileName.BackgroundTransparency = 0.2
1275FileName.BorderColor3 = Color3.fromRGB(40, 40, 40)
1276FileName.Position = UDim2.new(0.075, 0, 0.4, 0)
1277FileName.Size = UDim2.new(0.85, 0, 0, 30)
1278FileName.Font = Enum.Font.SourceSans
1279FileName.Text = ""
1280FileName.TextColor3 = Color3.fromRGB(255, 255, 255)
1281FileName.TextSize = 18
1282FileName.TextXAlignment = Enum.TextXAlignment.Left
1283
1284SaveObjects.Name = "SaveObjects"
1285SaveObjects.Parent = MainWindow
1286SaveObjects.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1287SaveObjects.BackgroundTransparency = 0.6
1288SaveObjects.BorderColor3 = Color3.fromRGB(40, 40, 40)
1289SaveObjects.Position = UDim2.new(0.075, 0, 0.625, 0)
1290SaveObjects.Size = UDim2.new(0, 20, 0, 20)
1291SaveObjects.ZIndex = 2
1292SaveObjects.Font = Enum.Font.SourceSans
1293SaveObjects.Text = ""
1294SaveObjects.TextColor3 = Color3.fromRGB(255, 255, 255)
1295SaveObjects.TextSize = 18
1296
1297enabled.Name = "enabled"
1298enabled.Parent = SaveObjects
1299enabled.BackgroundColor3 = Color3.fromRGB(96, 96, 96)
1300enabled.BackgroundTransparency = 0.4
1301enabled.BorderSizePixel = 0
1302enabled.Position = UDim2.new(0, 3, 0, 3)
1303enabled.Size = UDim2.new(0, 14, 0, 14)
1304enabled.Font = Enum.Font.SourceSans
1305enabled.Text = ""
1306enabled.TextSize = 14
1307
1308Desc2.Name = "Desc2"
1309Desc2.Parent = MainWindow
1310Desc2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1311Desc2.BackgroundTransparency = 1
1312Desc2.Position = UDim2.new(0.075, 30, 0.625, 0)
1313Desc2.Size = UDim2.new(0.925, -30, 0, 20)
1314Desc2.Font = Enum.Font.SourceSans
1315Desc2.Text = "Save \"Object\" type values"
1316Desc2.TextColor3 = Color3.fromRGB(255, 255, 255)
1317Desc2.TextSize = 14
1318Desc2.TextXAlignment = Enum.TextXAlignment.Left
1319
1320Confirmation.Name = "Confirmation"
1321Confirmation.Parent = ROBLOX
1322Confirmation.Active = true
1323Confirmation.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1324Confirmation.BorderColor3 = Color3.fromRGB(30, 30, 30)
1325dragger.new(Confirmation)
1326Confirmation.Position = UDim2.new(0.3, 0, 0.349, 0)
1327Confirmation.Size = UDim2.new(0, 350, 0, 20)
1328Confirmation.Visible = false
1329Confirmation.ZIndex = 3
1330
1331Title_3.Name = "Title"
1332Title_3.Parent = Confirmation
1333Title_3.BackgroundTransparency = 1
1334Title_3.Size = UDim2.new(1, 0, 1, 0)
1335Title_3.ZIndex = 3
1336Title_3.Font = Enum.Font.SourceSans
1337Title_3.Text = " Confirm"
1338Title_3.TextColor3 = Color3.fromRGB(255, 255, 255)
1339Title_3.TextSize = 14
1340Title_3.TextXAlignment = Enum.TextXAlignment.Left
1341
1342MainWindow_2.Name = "MainWindow"
1343MainWindow_2.Parent = Confirmation
1344MainWindow_2.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
1345MainWindow_2.BackgroundTransparency = 0.1
1346MainWindow_2.BorderColor3 = Color3.fromRGB(40, 40, 40)
1347MainWindow_2.Size = UDim2.new(1, 0, 0, 150)
1348MainWindow_2.ZIndex = 2
1349
1350Yes.Name = "Yes"
1351Yes.Parent = MainWindow_2
1352Yes.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
1353Yes.BackgroundTransparency = 0.5
1354Yes.BorderColor3 = Color3.fromRGB(0, 0, 0)
1355Yes.Position = UDim2.new(0.075, 0, 1, -40)
1356Yes.Size = UDim2.new(0.4, 0, 0, 30)
1357Yes.ZIndex = 2
1358Yes.Font = Enum.Font.SourceSans
1359Yes.Text = "Yes"
1360Yes.TextColor3 = Color3.fromRGB(255, 255, 255)
1361Yes.TextSize = 18
1362
1363Desc_2.Name = "Desc"
1364Desc_2.Parent = MainWindow_2
1365Desc_2.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
1366Desc_2.BackgroundTransparency = 1
1367Desc_2.Position = UDim2.new(0, 0, 0, 20)
1368Desc_2.Size = UDim2.new(1, 0, 0, 40)
1369Desc_2.ZIndex = 2
1370Desc_2.Font = Enum.Font.SourceSans
1371Desc_2.Text = "The file, FILENAME, already exists. Overwrite?"
1372Desc_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1373Desc_2.TextSize = 14
1374Desc_2.TextWrapped = true
1375
1376No.Name = "No"
1377No.Parent = MainWindow_2
1378No.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
1379No.BackgroundTransparency = 0.5
1380No.BorderColor3 = Color3.fromRGB(0, 0, 0)
1381No.Position = UDim2.new(0.524, 0, 1, -40)
1382No.Size = UDim2.new(0.4, 0, 0, 30)
1383No.ZIndex = 2
1384No.Font = Enum.Font.SourceSans
1385No.Text = "No"
1386No.TextColor3 = Color3.fromRGB(255, 255, 255)
1387No.TextSize = 18
1388
1389Caution.Name = "Caution"
1390Caution.Parent = ROBLOX
1391Caution.Active = true
1392Caution.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1393Caution.BorderColor3 = Color3.fromRGB(30, 30, 30)
1394dragger.new(Caution)
1395Caution.Position = UDim2.new(0.3, 0, 0.3, 0)
1396Caution.Size = UDim2.new(0, 350, 0, 20)
1397Caution.Visible = false
1398Caution.ZIndex = 5
1399
1400Title_4.Name = "Title"
1401Title_4.Parent = Caution
1402Title_4.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
1403Title_4.BackgroundTransparency = 1
1404Title_4.Size = UDim2.new(1, 0, 1, 0)
1405Title_4.ZIndex = 5
1406Title_4.Font = Enum.Font.SourceSans
1407Title_4.Text = " Caution"
1408Title_4.TextColor3 = Color3.fromRGB(255, 255, 255)
1409Title_4.TextSize = 14
1410Title_4.TextStrokeColor3 = Color3.fromRGB(30, 30, 30)
1411Title_4.TextXAlignment = Enum.TextXAlignment.Left
1412
1413MainWindow_3.Name = "MainWindow"
1414MainWindow_3.Parent = Caution
1415MainWindow_3.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
1416MainWindow_3.BackgroundTransparency = 0.1
1417MainWindow_3.BorderColor3 = Color3.fromRGB(40, 40, 40)
1418MainWindow_3.Size = UDim2.new(1, 0, 0, 150)
1419MainWindow_3.ZIndex = 4
1420
1421Desc_3.Name = "Desc"
1422Desc_3.Parent = MainWindow_3
1423Desc_3.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
1424Desc_3.BackgroundTransparency = 1
1425Desc_3.Position = UDim2.new(0, 0, 0, 20)
1426Desc_3.Size = UDim2.new(1, 0, 0, 42)
1427Desc_3.ZIndex = 4
1428Desc_3.Font = Enum.Font.SourceSans
1429Desc_3.Text = "The file, FILENAME, already exists. Overwrite?"
1430Desc_3.TextColor3 = Color3.fromRGB(255, 255, 255)
1431Desc_3.TextSize = 14
1432Desc_3.TextStrokeColor3 = Color3.fromRGB(30, 30, 30)
1433Desc_3.TextWrapped = true
1434
1435Ok.Name = "Ok"
1436Ok.Parent = MainWindow_3
1437Ok.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
1438Ok.BackgroundTransparency = 0.5
1439Ok.BorderColor3 = Color3.fromRGB(0, 0, 0)
1440Ok.Position = UDim2.new(0.3, 0, 1, -40)
1441Ok.Size = UDim2.new(0.4, 0, 0, 30)
1442Ok.ZIndex = 4
1443Ok.Font = Enum.Font.SourceSans
1444Ok.Text = "Ok"
1445Ok.TextColor3 = Color3.fromRGB(255, 255, 255)
1446Ok.TextSize = 18
1447Ok.TextStrokeColor3 = Color3.fromRGB(30, 30, 30)
1448
1449CallRemote.Name = "CallRemote"
1450CallRemote.Parent = ROBLOX
1451CallRemote.Active = true
1452CallRemote.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1453CallRemote.BorderColor3 = Color3.fromRGB(40, 40, 40)
1454dragger.new(CallRemote)
1455CallRemote.Position = UDim2.new(0.3, 0, 0.3, 0)
1456CallRemote.Size = UDim2.new(0, 350, 0, 20)
1457CallRemote.Visible = false
1458CallRemote.ZIndex = 2
1459
1460Title_5.Name = "Title"
1461Title_5.Parent = CallRemote
1462Title_5.BackgroundTransparency = 1
1463Title_5.Size = UDim2.new(1, 0, 1, 0)
1464Title_5.ZIndex = 2
1465Title_5.Font = Enum.Font.SourceSans
1466Title_5.Text = "Call Remote"
1467Title_5.TextColor3 = Color3.fromRGB(255, 255, 255)
1468Title_5.TextSize = 14
1469Title_5.TextXAlignment = Enum.TextXAlignment.Left
1470
1471MainWindow_4.Name = "MainWindow"
1472MainWindow_4.Parent = CallRemote
1473MainWindow_4.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1474MainWindow_4.BackgroundTransparency = 0.1
1475MainWindow_4.BorderColor3 = Color3.fromRGB(40, 40, 40)
1476MainWindow_4.Size = UDim2.new(1, 0, 0, 200)
1477
1478Desc_4.Name = "Desc"
1479Desc_4.Parent = MainWindow_4
1480Desc_4.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1481Desc_4.BackgroundTransparency = 1
1482Desc_4.BorderColor3 = Color3.fromRGB(30, 30, 30)
1483Desc_4.Position = UDim2.new(0, 0, 0, 20)
1484Desc_4.Size = UDim2.new(1, 0, 0, 20)
1485Desc_4.Font = Enum.Font.SourceSans
1486Desc_4.Text = "Arguments"
1487Desc_4.TextColor3 = Color3.fromRGB(255, 255, 255)
1488Desc_4.TextSize = 14
1489Desc_4.TextWrapped = true
1490
1491Arguments.Name = "Arguments"
1492Arguments.Parent = MainWindow_4
1493Arguments.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1494Arguments.BackgroundTransparency = 1
1495Arguments.BorderColor3 = Color3.fromRGB(30, 30, 30)
1496Arguments.Position = UDim2.new(0, 0, 0, 40)
1497Arguments.Size = UDim2.new(1, 0, 0, 80)
1498Arguments.BottomImage = "rbxasset://textures/blackBkg_square.png"
1499Arguments.CanvasSize = UDim2.new(0, 0, 0, 0)
1500Arguments.MidImage = "rbxasset://textures/blackBkg_square.png"
1501Arguments.TopImage = "rbxasset://textures/blackBkg_square.png"
1502
1503DisplayReturned.Name = "DisplayReturned"
1504DisplayReturned.Parent = MainWindow_4
1505DisplayReturned.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1506DisplayReturned.BackgroundTransparency = 0.6
1507DisplayReturned.BorderColor3 = Color3.fromRGB(30, 30, 30)
1508DisplayReturned.Position = UDim2.new(0.075, 0, 0.625, 0)
1509DisplayReturned.Size = UDim2.new(0, 20, 0, 20)
1510DisplayReturned.ZIndex = 2
1511DisplayReturned.Font = Enum.Font.SourceSans
1512DisplayReturned.Text = ""
1513DisplayReturned.TextColor3 = Color3.fromRGB(255, 255, 255)
1514DisplayReturned.TextSize = 18
1515
1516enabled_2.Name = "enabled"
1517enabled_2.Parent = DisplayReturned
1518enabled_2.BackgroundColor3 = Color3.fromRGB(96, 96, 96)
1519enabled_2.BackgroundTransparency = 0.4
1520enabled_2.BorderSizePixel = 0
1521enabled_2.Position = UDim2.new(0, 3, 0, 3)
1522enabled_2.Size = UDim2.new(0, 14, 0, 14)
1523enabled_2.Visible = false
1524enabled_2.Font = Enum.Font.SourceSans
1525enabled_2.Text = ""
1526enabled_2.TextSize = 14
1527
1528Desc2_2.Name = "Desc2"
1529Desc2_2.Parent = MainWindow_4
1530Desc2_2.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1531Desc2_2.BackgroundTransparency = 1
1532Desc2_2.BorderColor3 = Color3.fromRGB(30, 30, 30)
1533Desc2_2.Position = UDim2.new(0.075, 30, 0.625, 0)
1534Desc2_2.Size = UDim2.new(0.925, -30, 0, 20)
1535Desc2_2.Font = Enum.Font.SourceSans
1536Desc2_2.Text = "Display values returned"
1537Desc2_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1538Desc2_2.TextSize = 14
1539Desc2_2.TextXAlignment = Enum.TextXAlignment.Left
1540
1541Add.Name = "Add"
1542Add.Parent = MainWindow_4
1543Add.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1544Add.BackgroundTransparency = 0.5
1545Add.BorderColor3 = Color3.fromRGB(30, 30, 30)
1546Add.Position = UDim2.new(0.8, 0, 0.625, 0)
1547Add.Size = UDim2.new(0, 20, 0, 20)
1548Add.Font = Enum.Font.SourceSansBold
1549Add.Text = "+"
1550Add.TextColor3 = Color3.fromRGB(255, 255, 255)
1551Add.TextSize = 24
1552
1553Subtract.Name = "Subtract"
1554Subtract.Parent = MainWindow_4
1555Subtract.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1556Subtract.BackgroundTransparency = 0.5
1557Subtract.BorderColor3 = Color3.fromRGB(30, 30, 30)
1558Subtract.Position = UDim2.new(0.899, 0, 0.625, 0)
1559Subtract.Size = UDim2.new(0, 20, 0, 20)
1560Subtract.Font = Enum.Font.SourceSansBold
1561Subtract.Text = "-"
1562Subtract.TextColor3 = Color3.fromRGB(255, 255, 255)
1563Subtract.TextSize = 24
1564
1565ArgumentTemplate.Name = "ArgumentTemplate"
1566ArgumentTemplate.Parent = MainWindow_4
1567ArgumentTemplate.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1568ArgumentTemplate.BackgroundTransparency = 0.5
1569ArgumentTemplate.BorderColor3 = Color3.fromRGB(40, 40, 40)
1570ArgumentTemplate.Size = UDim2.new(1, 0, 0, 20)
1571ArgumentTemplate.Visible = false
1572
1573Type.Name = "Type"
1574Type.Parent = ArgumentTemplate
1575Type.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1576Type.BackgroundTransparency = 0.899
1577Type.BorderColor3 = Color3.fromRGB(30, 30, 30)
1578Type.Size = UDim2.new(0.4, 0, 0, 20)
1579Type.Font = Enum.Font.SourceSans
1580Type.Text = "Script"
1581Type.TextSize = 18
1582
1583Value.Name = "Value"
1584Value.Parent = ArgumentTemplate
1585Value.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1586Value.BackgroundTransparency = 0.899
1587Value.BorderColor3 = Color3.fromRGB(30, 30, 30)
1588Value.Position = UDim2.new(0.4, 0, 0, 0)
1589Value.Size = UDim2.new(0.6, -12, 0, 20)
1590Value.Font = Enum.Font.SourceSans
1591Value.Text = ""
1592Value.TextSize = 14
1593Value.TextXAlignment = Enum.TextXAlignment.Left
1594
1595Cancel_2.Name = "Cancel"
1596Cancel_2.Parent = MainWindow_4
1597Cancel_2.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1598Cancel_2.BackgroundTransparency = 0.5
1599Cancel_2.BorderColor3 = Color3.fromRGB(30, 30, 30)
1600Cancel_2.Size = UDim2.new(0.4, 0, 0, 30)
1601Cancel_2.Font = Enum.Font.SourceSans
1602Cancel_2.Text = "Cancel"
1603Cancel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1604Cancel_2.TextSize = 18
1605
1606Ok_2.Name = "Ok"
1607Ok_2.Parent = MainWindow_4
1608Ok_2.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1609Ok_2.BackgroundTransparency = 0.5
1610Ok_2.BorderColor3 = Color3.fromRGB(30, 30, 30)
1611Ok_2.Position = UDim2.new(0.075, 0, 1, -40)
1612Ok_2.Size = UDim2.new(0.4, 0, 0, 30)
1613Ok_2.Font = Enum.Font.SourceSans
1614Ok_2.Text = "Call"
1615Ok_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1616Ok_2.TextSize = 18
1617
1618TableCaution.Name = "TableCaution"
1619TableCaution.Parent = ROBLOX
1620TableCaution.Active = true
1621TableCaution.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1622TableCaution.BorderColor3 = Color3.fromRGB(43, 43, 43)
1623dragger.new(TableCaution)
1624TableCaution.Position = UDim2.new(0.3, 0, 0.3, 0)
1625TableCaution.Size = UDim2.new(0, 350, 0, 20)
1626TableCaution.Visible = false
1627TableCaution.ZIndex = 2
1628
1629MainWindow_5.Name = "MainWindow"
1630MainWindow_5.Parent = TableCaution
1631MainWindow_5.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1632MainWindow_5.BackgroundTransparency = 0.1
1633MainWindow_5.BorderColor3 = Color3.fromRGB(43, 43, 43)
1634MainWindow_5.Size = UDim2.new(1, 0, 0, 150)
1635
1636Ok_3.Name = "Ok"
1637Ok_3.Parent = MainWindow_5
1638Ok_3.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1639Ok_3.BackgroundTransparency = 0.5
1640Ok_3.BorderColor3 = Color3.fromRGB(30, 30, 30)
1641Ok_3.Position = UDim2.new(0.3, 0, 1, -40)
1642Ok_3.Size = UDim2.new(0.4, 0, 0, 30)
1643Ok_3.Font = Enum.Font.SourceSans
1644Ok_3.Text = "Ok"
1645Ok_3.TextColor3 = Color3.fromRGB(255, 255, 255)
1646Ok_3.TextSize = 18
1647
1648TableResults.Name = "TableResults"
1649TableResults.Parent = MainWindow_5
1650TableResults.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1651TableResults.BackgroundTransparency = 1
1652TableResults.Position = UDim2.new(0, 0, 0, 20)
1653TableResults.Size = UDim2.new(1, 0, 0, 80)
1654TableResults.BottomImage = "rbxasset://textures/blackBkg_square.png"
1655TableResults.CanvasSize = UDim2.new(0, 0, 0, 0)
1656TableResults.MidImage = "rbxasset://textures/blackBkg_square.png"
1657TableResults.TopImage = "rbxasset://textures/blackBkg_square.png"
1658
1659TableTemplate.Name = "TableTemplate"
1660TableTemplate.Parent = MainWindow_5
1661TableTemplate.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1662TableTemplate.BackgroundTransparency = 0.5
1663TableTemplate.BorderColor3 = Color3.fromRGB(191, 191, 191)
1664TableTemplate.Size = UDim2.new(1, 0, 0, 20)
1665TableTemplate.Visible = false
1666
1667Type_2.Name = "Type"
1668Type_2.Parent = TableTemplate
1669Type_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1670Type_2.BackgroundTransparency = 0.899
1671Type_2.BorderColor3 = Color3.fromRGB(30, 30, 30)
1672Type_2.Size = UDim2.new(0.4, 0, 0, 20)
1673Type_2.Font = Enum.Font.SourceSans
1674Type_2.Text = "Script"
1675Type_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1676Type_2.TextSize = 18
1677
1678Value_2.Name = "Value"
1679Value_2.Parent = TableTemplate
1680Value_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1681Value_2.BackgroundTransparency = 0.899
1682Value_2.BorderColor3 = Color3.fromRGB(30, 30, 30)
1683Value_2.Position = UDim2.new(0.4, 0, 0, 0)
1684Value_2.Size = UDim2.new(0.6, -12, 0, 20)
1685Value_2.Font = Enum.Font.SourceSans
1686Value_2.Text = "Script"
1687Value_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1688Value_2.TextSize = 14
1689
1690Title_6.Name = "Title"
1691Title_6.Parent = TableCaution
1692Title_6.BackgroundTransparency = 1
1693Title_6.Size = UDim2.new(1, 0, 1, 0)
1694Title_6.ZIndex = 2
1695Title_6.Font = Enum.Font.SourceSans
1696Title_6.Text = "Caution"
1697Title_6.TextColor3 = Color3.fromRGB(255, 255, 255)
1698Title_6.TextSize = 14
1699Title_6.TextXAlignment = Enum.TextXAlignment.Left
1700
1701ScriptEditor.Name = "ScriptEditor"
1702ScriptEditor.Parent = ROBLOX
1703ScriptEditor.Active = true
1704ScriptEditor.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1705ScriptEditor.BorderColor3 = Color3.fromRGB(30, 30, 30)
1706dragger.new(ScriptEditor)
1707ScriptEditor.Position = UDim2.new(0.3, 0, 0.3, 0)
1708ScriptEditor.Size = UDim2.new(0, 916, 0, 20)
1709ScriptEditor.Visible = false
1710ScriptEditor.ZIndex = 5
1711
1712Title_7.Name = "Title"
1713Title_7.Parent = ScriptEditor
1714Title_7.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1715Title_7.BackgroundTransparency = 1
1716Title_7.Size = UDim2.new(1, 0, 1, 0)
1717Title_7.ZIndex = 5
1718Title_7.Font = Enum.Font.SourceSans
1719Title_7.Text = "Script Viewer"
1720Title_7.TextColor3 = Color3.fromRGB(255, 255, 255)
1721Title_7.TextSize = 14
1722Title_7.TextXAlignment = Enum.TextXAlignment.Left
1723
1724Cover.Name = "Cover"
1725Cover.Parent = ScriptEditor
1726Cover.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
1727Cover.BorderColor3 = Color3.fromRGB(30, 30, 30)
1728Cover.Position = UDim2.new(0, 0, 3, 0)
1729Cover.Size = UDim2.new(0, 916, 0, 416)
1730
1731EditorGrid.Name = "EditorGrid"
1732EditorGrid.Parent = ScriptEditor
1733EditorGrid.Active = true
1734EditorGrid.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1735EditorGrid.BorderColor3 = Color3.fromRGB(30, 30, 30)
1736EditorGrid.Position = UDim2.new(0, 0, 3, 0)
1737EditorGrid.Size = UDim2.new(1, -16, 0, 400)
1738
1739TopBar.Name = "TopBar"
1740TopBar.Parent = ScriptEditor
1741TopBar.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
1742TopBar.BorderColor3 = Color3.fromRGB(30, 30, 30)
1743TopBar.Size = UDim2.new(1, 0, 3, 0)
1744
1745ScriptBarLeft.Name = "ScriptBarLeft"
1746ScriptBarLeft.Parent = TopBar
1747ScriptBarLeft.Active = false
1748ScriptBarLeft.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1749ScriptBarLeft.BorderColor3 = Color3.fromRGB(30, 30, 30)
1750ScriptBarLeft.Position = UDim2.new(1, -32, 0, 40)
1751ScriptBarLeft.Size = UDim2.new(0, 16, 0, 20)
1752ScriptBarLeft.AutoButtonColor = false
1753
1754ArrowGraphic.Name = "Arrow Graphic"
1755ArrowGraphic.Parent = ScriptBarLeft
1756ArrowGraphic.BackgroundTransparency = 1
1757ArrowGraphic.BorderSizePixel = 0
1758ArrowGraphic.Position = UDim2.new(0.5, -4, 0.5, -4)
1759ArrowGraphic.Size = UDim2.new(0, 8, 0, 8)
1760
1761Graphic.Name = "Graphic"
1762Graphic.Parent = ArrowGraphic
1763Graphic.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1764Graphic.BackgroundTransparency = 0.699
1765Graphic.BorderSizePixel = 0
1766Graphic.Position = UDim2.new(0.25, 0, 0.375, 0)
1767Graphic.Size = UDim2.new(0.125, 0, 0.25, 0)
1768
1769Graphic_2.Name = "Graphic"
1770Graphic_2.Parent = ArrowGraphic
1771Graphic_2.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1772Graphic_2.BackgroundTransparency = 0.699
1773Graphic_2.BorderSizePixel = 0
1774Graphic_2.Position = UDim2.new(0.375, 0, 0.25, 0)
1775Graphic_2.Size = UDim2.new(0.125, 0, 0.5, 0)
1776
1777Graphic_3.Name = "Graphic"
1778Graphic_3.Parent = ArrowGraphic
1779Graphic_3.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1780Graphic_3.BackgroundTransparency = 0.699
1781Graphic_3.BorderSizePixel = 0
1782Graphic_3.Position = UDim2.new(0.5, 0, 0.125, 0)
1783Graphic_3.Size = UDim2.new(0.125, 0, 0.75, 0)
1784
1785Graphic_4.Name = "Graphic"
1786Graphic_4.Parent = ArrowGraphic
1787Graphic_4.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1788Graphic_4.BackgroundTransparency = 0.699
1789Graphic_4.BorderSizePixel = 0
1790Graphic_4.Position = UDim2.new(0.625, 0, 0, 0)
1791Graphic_4.Size = UDim2.new(0.125, 0, 1, 0)
1792
1793ScriptBarRight.Name = "ScriptBarRight"
1794ScriptBarRight.Parent = TopBar
1795ScriptBarRight.Active = false
1796ScriptBarRight.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1797ScriptBarRight.BorderColor3 = Color3.fromRGB(30, 30, 30)
1798ScriptBarRight.Position = UDim2.new(1, -16, 0, 40)
1799ScriptBarRight.Size = UDim2.new(0, 16, 0, 20)
1800ScriptBarRight.AutoButtonColor = false
1801
1802ArrowGraphic_2.Name = "Arrow Graphic"
1803ArrowGraphic_2.Parent = ScriptBarRight
1804ArrowGraphic_2.BackgroundTransparency = 1
1805ArrowGraphic_2.BorderSizePixel = 0
1806ArrowGraphic_2.Position = UDim2.new(0.5, -4, 0.5, -4)
1807ArrowGraphic_2.Size = UDim2.new(0, 8, 0, 8)
1808
1809Graphic_5.Name = "Graphic"
1810Graphic_5.Parent = ArrowGraphic_2
1811Graphic_5.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1812Graphic_5.BackgroundTransparency = 0.699
1813Graphic_5.BorderSizePixel = 0
1814Graphic_5.Position = UDim2.new(0.625, 0, 0.375, 0)
1815Graphic_5.Size = UDim2.new(0.125, 0, 0.25, 0)
1816
1817Graphic_6.Name = "Graphic"
1818Graphic_6.Parent = ArrowGraphic_2
1819Graphic_6.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1820Graphic_6.BackgroundTransparency = 0.699
1821Graphic_6.BorderSizePixel = 0
1822Graphic_6.Position = UDim2.new(0.5, 0, 0.25, 0)
1823Graphic_6.Size = UDim2.new(0.125, 0, 0.5, 0)
1824
1825Graphic_7.Name = "Graphic"
1826Graphic_7.Parent = ArrowGraphic_2
1827Graphic_7.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1828Graphic_7.BackgroundTransparency = 0.699
1829Graphic_7.BorderSizePixel = 0
1830Graphic_7.Position = UDim2.new(0.375, 0, 0.125, 0)
1831Graphic_7.Size = UDim2.new(0.125, 0, 0.75, 0)
1832
1833Graphic_8.Name = "Graphic"
1834Graphic_8.Parent = ArrowGraphic_2
1835Graphic_8.BackgroundColor3 = Color3.fromRGB(149, 149, 149)
1836Graphic_8.BackgroundTransparency = 0.699
1837Graphic_8.BorderSizePixel = 0
1838Graphic_8.Position = UDim2.new(0.25, 0, 0, 0)
1839Graphic_8.Size = UDim2.new(0.125, 0, 1, 0)
1840
1841Clipboard.Name = "Clipboard"
1842Clipboard.Parent = TopBar
1843Clipboard.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1844Clipboard.BackgroundTransparency = 0.5
1845Clipboard.BorderColor3 = Color3.fromRGB(0, 0, 0)
1846Clipboard.Position = UDim2.new(0, 0, 0, 20)
1847Clipboard.Size = UDim2.new(0, 80, 0, 20)
1848Clipboard.AutoButtonColor = false
1849Clipboard.Font = Enum.Font.SourceSans
1850Clipboard.Text = "To Clipboard"
1851Clipboard.TextColor3 = Color3.fromRGB(255, 255, 255)
1852Clipboard.TextSize = 14
1853
1854SaveScript.Name = "SaveScript"
1855SaveScript.Parent = TopBar
1856SaveScript.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1857SaveScript.BackgroundTransparency = 0.5
1858SaveScript.BorderColor3 = Color3.fromRGB(0, 0, 0)
1859SaveScript.Position = UDim2.new(0, 80, 0, 20)
1860SaveScript.Size = UDim2.new(0, 80, 0, 20)
1861SaveScript.AutoButtonColor = false
1862SaveScript.Font = Enum.Font.SourceSans
1863SaveScript.Text = "Save Script"
1864SaveScript.TextColor3 = Color3.fromRGB(255, 255, 255)
1865SaveScript.TextSize = 14
1866
1867ScriptBar.Name = "ScriptBar"
1868ScriptBar.Parent = TopBar
1869ScriptBar.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
1870ScriptBar.BorderColor3 = Color3.fromRGB(30, 30, 30)
1871ScriptBar.ClipsDescendants = true
1872ScriptBar.Position = UDim2.new(0, 0, 0, 40)
1873ScriptBar.Size = UDim2.new(1, -32, 0, 20)
1874
1875Entry.Name = "Entry"
1876Entry.Parent = TopBar
1877Entry.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1878Entry.BackgroundTransparency = 1
1879Entry.Size = UDim2.new(0, 100, 1, 0)
1880Entry.Visible = false
1881
1882Button.Name = "Button"
1883Button.Parent = Entry
1884Button.BackgroundColor3 = Color3.fromRGB(90, 90, 90)
1885Button.BackgroundTransparency = .6
1886Button.BorderColor3 = Color3.fromRGB(0, 0, 0)
1887Button.ClipsDescendants = true
1888Button.Size = UDim2.new(1, 0, 1, 0)
1889Button.ZIndex = 4
1890Button.Font = Enum.Font.SourceSans
1891Button.Text = ""
1892Button.TextSize = 12
1893Button.TextColor3 = Color3.fromRGB(255, 255, 255);
1894Button.TextXAlignment = Enum.TextXAlignment.Left
1895
1896Close.Name = "Close"
1897Close.Parent = Entry
1898Close.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1899Close.BackgroundTransparency = 1
1900Close.BorderColor3 = Color3.fromRGB(0, 0, 0)
1901Close.Position = UDim2.new(1, -20, 0, 0)
1902Close.Size = UDim2.new(0, 20, 0, 20)
1903Close.ZIndex = 4
1904Close.Font = Enum.Font.SourceSans
1905Close.Text = "X"
1906Close.TextSize = 14
1907Close.TextColor3 = Color3.fromRGB(255, 255, 255)
1908
1909Close_2.Name = "Close"
1910Close_2.Parent = ScriptEditor
1911Close_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1912Close_2.BackgroundTransparency = 1
1913Close_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
1914Close_2.Position = UDim2.new(1, -20, 0, 0)
1915Close_2.Size = UDim2.new(0, 20, 0, 20)
1916Close_2.ZIndex = 5
1917Close_2.Font = Enum.Font.SourceSans
1918Close_2.Text = "X"
1919Close_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1920Close_2.TextSize = 14
1921
1922IntroFrame.Name = "IntroFrame"
1923IntroFrame.Parent = ROBLOX
1924IntroFrame.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1925IntroFrame.BorderSizePixel = 0
1926IntroFrame.Position = UDim2.new(1, 30, 0, 0)
1927IntroFrame.Size = UDim2.new(0, 300, 1, 0)
1928IntroFrame.ZIndex = 2
1929
1930Main_2.Name = "Main"
1931Main_2.Parent = IntroFrame
1932Main_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1933Main_2.BorderSizePixel = 0
1934Main_2.Position = UDim2.new(0, -30, 0, 0)
1935Main_2.Size = UDim2.new(0, 30, 0, 90)
1936Main_2.ZIndex = 4
1937
1938ImageLabel.Parent = Main_2
1939ImageLabel.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1940ImageLabel.BackgroundTransparency = 1
1941ImageLabel.BorderSizePixel = 0
1942ImageLabel.Size = UDim2.new(1, 0, 1, 0)
1943ImageLabel.ZIndex = 5
1944ImageLabel.ScaleType = Enum.ScaleType.Tile
1945ImageLabel.TileSize = UDim2.new(25, 0, 6, 0)
1946
1947Title_8.Name = "Title"
1948Title_8.Parent = IntroFrame
1949Title_8.BackgroundTransparency = 1
1950Title_8.Position = UDim2.new(0, 100, 0, 110)
1951Title_8.Size = UDim2.new(0, 100, 0, 100)
1952Title_8.ZIndex = 4
1953Title_8.Image = "http://www.roblox.com/library/?id=4706382936"
1954Title_8.ScaleType = Enum.ScaleType.Fit
1955
1956Version_2.Name = "Version"
1957Version_2.Parent = IntroFrame
1958Version_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1959Version_2.BackgroundTransparency = 1
1960Version_2.Position = UDim2.new(0, 100, 0, 225)
1961Version_2.Size = UDim2.new(0, 100, 0, 30)
1962Version_2.ZIndex = 4
1963Version_2.Font = Enum.Font.SourceSansBold
1964Version_2.Text = "V2.0.1\nEdited by FutureHacks & XaonIsBest"
1965Version_2.TextColor3 = Color3.fromRGB(255, 255, 255)
1966Version_2.TextSize = 19
1967
1968Creator.Name = "Creator"
1969Creator.Parent = IntroFrame
1970Creator.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1971Creator.BackgroundTransparency = 1
1972Creator.Position = UDim2.new(0, 80, 0, 300)
1973Creator.Size = UDim2.new(0, 140, 0, 30)
1974Creator.ZIndex = 4
1975Creator.Font = Enum.Font.SourceSansBold
1976Creator.Text = ""
1977Creator.TextColor3 = Color3.fromRGB(255, 255, 255)
1978Creator.TextSize = 28
1979Creator.TextWrapped = true
1980
1981BG.Name = "BG"
1982BG.Parent = IntroFrame
1983BG.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
1984BG.BackgroundTransparency = 1
1985BG.BorderSizePixel = 0
1986BG.Size = UDim2.new(1, 0, 1, 0)
1987BG.ZIndex = 3
1988BG.ScaleType = Enum.ScaleType.Tile
1989BG.TileSize = UDim2.new(4, 0, 1, 0)
1990
1991Slant_2.Name = "Slant"
1992Slant_2.Parent = IntroFrame
1993Slant_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
1994Slant_2.BackgroundTransparency = 1
1995Slant_2.BorderSizePixel = 0
1996Slant_2.ClipsDescendants = true
1997Slant_2.Position = UDim2.new(0, -27, 0, 86)
1998Slant_2.Rotation = 45
1999Slant_2.Size = UDim2.new(0, 60, 0, 30)
2000Slant_2.ZIndex = 3
2001
2002ImageLabel_2.Parent = Slant_2
2003ImageLabel_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2004ImageLabel_2.BackgroundTransparency = 1
2005ImageLabel_2.BorderSizePixel = 0
2006ImageLabel_2.Size = UDim2.new(1, 0, 1, 0)
2007ImageLabel_2.ZIndex = 2
2008ImageLabel_2.Image = "rbxassetid://474172996"
2009ImageLabel_2.ScaleType = Enum.ScaleType.Tile
2010ImageLabel_2.TileSize = UDim2.new(25, 0, 6, 0)
2011ImageLabel_2.ImageColor3 = Color3.fromRGB(43, 43, 43)
2012
2013SaveMapWindow.Name = "SaveMapWindow"
2014SaveMapWindow.Parent = ROBLOX
2015SaveMapWindow.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2016SaveMapWindow.BorderColor3 = Color3.fromRGB(191, 191, 191)
2017SaveMapWindow.BorderSizePixel = 0
2018SaveMapWindow.Position = UDim2.new(1, 0, 0, 1)
2019SaveMapWindow.Size = UDim2.new(0, 300, 1, 0)
2020
2021Header_3.Name = "Header"
2022Header_3.Parent = SaveMapWindow
2023Header_3.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2024Header_3.BorderColor3 = Color3.fromRGB(30, 30, 30)
2025Header_3.Size = UDim2.new(1, 0, 0, 17)
2026
2027TextLabel_3.Parent = Header_3
2028TextLabel_3.BackgroundTransparency = 1
2029TextLabel_3.Position = UDim2.new(0, 4, 0, 0)
2030TextLabel_3.Size = UDim2.new(1, -4, 1, 0)
2031TextLabel_3.Font = Enum.Font.SourceSans
2032TextLabel_3.Text = "Map Downloader"
2033TextLabel_3.TextColor3 = Color3.fromRGB(255, 255, 255)
2034TextLabel_3.TextSize = 14
2035TextLabel_3.TextXAlignment = Enum.TextXAlignment.Left
2036
2037MapSettings.Name = "MapSettings"
2038MapSettings.Parent = SaveMapWindow
2039MapSettings.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2040MapSettings.BackgroundTransparency = 1
2041MapSettings.BorderSizePixel = 0
2042MapSettings.Position = UDim2.new(0, 0, 0, 200)
2043MapSettings.Size = UDim2.new(1, 0, 0, 240)
2044
2045Terrain.Name = "Terrain"
2046Terrain.Parent = MapSettings
2047Terrain.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2048Terrain.BackgroundTransparency = 1
2049Terrain.BorderSizePixel = 0
2050Terrain.Position = UDim2.new(0, 0, 0, 60)
2051Terrain.Size = UDim2.new(1, 0, 0, 60)
2052
2053SName_2.Name = "SName"
2054SName_2.Parent = Terrain
2055SName_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2056SName_2.BackgroundTransparency = 1
2057SName_2.BorderColor3 = Color3.fromRGB(40, 40, 40)
2058SName_2.Position = UDim2.new(0, 10, 0, 0)
2059SName_2.Size = UDim2.new(1, -20, 0, 30)
2060SName_2.Font = Enum.Font.SourceSans
2061SName_2.Text = "Save Terrain"
2062SName_2.TextColor3 = Color3.fromRGB(255, 255, 255)
2063SName_2.TextSize = 18
2064SName_2.TextXAlignment = Enum.TextXAlignment.Left
2065
2066Status_2.Name = "Status"
2067Status_2.Parent = Terrain
2068Status_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2069Status_2.BackgroundTransparency = 1
2070Status_2.BorderColor3 = Color3.fromRGB(40, 40, 40)
2071Status_2.Position = UDim2.new(0, 60, 0, 30)
2072Status_2.Size = UDim2.new(0, 50, 0, 15)
2073Status_2.Font = Enum.Font.SourceSans
2074Status_2.Text = "Off"
2075Status_2.TextColor3 = Color3.fromRGB(255, 255, 255)
2076Status_2.TextSize = 18
2077Status_2.TextXAlignment = Enum.TextXAlignment.Left
2078
2079Change_2.Name = "Change"
2080Change_2.Parent = Terrain
2081Change_2.BackgroundColor3 = Color3.fromRGB(81, 81, 81)
2082Change_2.BorderColor3 = Color3.fromRGB(40, 40, 40)
2083Change_2.BorderSizePixel = 0
2084Change_2.Position = UDim2.new(0, 10, 0, 30)
2085Change_2.Size = UDim2.new(0, 40, 0, 15)
2086Change_2.Font = Enum.Font.SourceSans
2087Change_2.Text = ""
2088Change_2.TextColor3 = Color3.fromRGB(255, 255, 255)
2089Change_2.TextSize = 14
2090
2091OnBar_2.Name = "OnBar"
2092OnBar_2.Parent = Change_2
2093OnBar_2.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
2094OnBar_2.BorderSizePixel = 0
2095OnBar_2.Size = UDim2.new(0, 0, 0, 15)
2096OnBar_2.Font = Enum.Font.SourceSans
2097OnBar_2.Text = ""
2098OnBar_2.TextSize = 14
2099
2100Bar_2.Name = "Bar"
2101Bar_2.Parent = Change_2
2102Bar_2.BackgroundColor3 = Color3.fromRGB(219, 47, 84)
2103Bar_2.BorderSizePixel = 0
2104Bar_2.ClipsDescendants = true
2105Bar_2.Position = UDim2.new(0, -2, 0, -2)
2106Bar_2.Size = UDim2.new(0, 10, 0, 19)
2107Bar_2.Font = Enum.Font.SourceSans
2108Bar_2.Text = ""
2109Bar_2.TextSize = 14
2110
2111Lighting.Name = "Lighting"
2112Lighting.Parent = MapSettings
2113Lighting.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2114Lighting.BackgroundTransparency = 1
2115Lighting.BorderSizePixel = 0
2116Lighting.Position = UDim2.new(0, 0, 0, 120)
2117Lighting.Size = UDim2.new(1, 0, 0, 60)
2118
2119SName_3.Name = "SName"
2120SName_3.Parent = Lighting
2121SName_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2122SName_3.BackgroundTransparency = 1
2123SName_3.BorderColor3 = Color3.fromRGB(40, 40, 40)
2124SName_3.Position = UDim2.new(0, 10, 0, 0)
2125SName_3.Size = UDim2.new(1, -20, 0, 30)
2126SName_3.Font = Enum.Font.SourceSans
2127SName_3.Text = "Lighting Properties"
2128SName_3.TextColor3 = Color3.fromRGB(255, 255, 255)
2129SName_3.TextSize = 18
2130SName_3.TextXAlignment = Enum.TextXAlignment.Left
2131
2132Status_3.Name = "Status"
2133Status_3.Parent = Lighting
2134Status_3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2135Status_3.BackgroundTransparency = 1
2136Status_3.BorderColor3 = Color3.fromRGB(40, 40, 40)
2137Status_3.Position = UDim2.new(0, 60, 0, 30)
2138Status_3.Size = UDim2.new(0, 50, 0, 15)
2139Status_3.Font = Enum.Font.SourceSans
2140Status_3.Text = "Off"
2141Status_3.TextColor3 = Color3.fromRGB(255, 255, 255)
2142Status_3.TextSize = 18
2143Status_3.TextXAlignment = Enum.TextXAlignment.Left
2144
2145Change_3.Name = "Change"
2146Change_3.Parent = Lighting
2147Change_3.BackgroundColor3 = Color3.fromRGB(81, 81, 81)
2148Change_3.BorderColor3 = Color3.fromRGB(40, 40, 40)
2149Change_3.BorderSizePixel = 0
2150Change_3.Position = UDim2.new(0, 10, 0, 30)
2151Change_3.Size = UDim2.new(0, 40, 0, 15)
2152Change_3.Font = Enum.Font.SourceSans
2153Change_3.Text = ""
2154Change_3.TextColor3 = Color3.fromRGB(255, 255, 255)
2155Change_3.TextSize = 14
2156
2157OnBar_3.Name = "OnBar"
2158OnBar_3.Parent = Change_3
2159OnBar_3.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
2160OnBar_3.BorderSizePixel = 0
2161OnBar_3.Size = UDim2.new(0, 0, 0, 15)
2162OnBar_3.Font = Enum.Font.SourceSans
2163OnBar_3.Text = ""
2164OnBar_3.TextSize = 14
2165
2166Bar_3.Name = "Bar"
2167Bar_3.Parent = Change_3
2168Bar_3.BackgroundColor3 = Color3.fromRGB(219, 47, 84)
2169Bar_3.BorderSizePixel = 0
2170Bar_3.ClipsDescendants = true
2171Bar_3.Position = UDim2.new(0, -2, 0, -2)
2172Bar_3.Size = UDim2.new(0, 10, 0, 19)
2173Bar_3.Font = Enum.Font.SourceSans
2174Bar_3.Text = ""
2175Bar_3.TextSize = 14
2176
2177CameraInstances.Name = "CameraInstances"
2178CameraInstances.Parent = MapSettings
2179CameraInstances.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2180CameraInstances.BackgroundTransparency = 1
2181CameraInstances.BorderSizePixel = 0
2182CameraInstances.Position = UDim2.new(0, 0, 0, 180)
2183CameraInstances.Size = UDim2.new(1, 0, 0, 60)
2184
2185SName_4.Name = "SName"
2186SName_4.Parent = CameraInstances
2187SName_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2188SName_4.BackgroundTransparency = 1
2189SName_4.BorderColor3 = Color3.fromRGB(40, 40, 40)
2190SName_4.Position = UDim2.new(0, 10, 0, 0)
2191SName_4.Size = UDim2.new(1, -20, 0, 30)
2192SName_4.Font = Enum.Font.SourceSans
2193SName_4.Text = "Camera Instances"
2194SName_4.TextColor3 = Color3.fromRGB(255, 255, 255)
2195SName_4.TextSize = 18
2196SName_4.TextXAlignment = Enum.TextXAlignment.Left
2197
2198Status_4.Name = "Status"
2199Status_4.Parent = CameraInstances
2200Status_4.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2201Status_4.BackgroundTransparency = 1
2202Status_4.BorderColor3 = Color3.fromRGB(40, 40, 40)
2203Status_4.Position = UDim2.new(0, 60, 0, 30)
2204Status_4.Size = UDim2.new(0, 50, 0, 15)
2205Status_4.Font = Enum.Font.SourceSans
2206Status_4.Text = "Off"
2207Status_4.TextColor3 = Color3.fromRGB(255, 255, 255)
2208Status_4.TextSize = 18
2209Status_4.TextXAlignment = Enum.TextXAlignment.Left
2210
2211Change_4.Name = "Change"
2212Change_4.Parent = CameraInstances
2213Change_4.BackgroundColor3 = Color3.fromRGB(81, 81, 81)
2214Change_4.BorderColor3 = Color3.fromRGB(40, 40, 40)
2215Change_4.BorderSizePixel = 0
2216Change_4.Position = UDim2.new(0, 10, 0, 30)
2217Change_4.Size = UDim2.new(0, 40, 0, 15)
2218Change_4.Font = Enum.Font.SourceSans
2219Change_4.Text = ""
2220Change_4.TextColor3 = Color3.fromRGB(255, 255, 255)
2221Change_4.TextSize = 14
2222
2223OnBar_4.Name = "OnBar"
2224OnBar_4.Parent = Change_4
2225OnBar_4.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
2226OnBar_4.BorderSizePixel = 0
2227OnBar_4.Size = UDim2.new(0, 0, 0, 15)
2228OnBar_4.Font = Enum.Font.SourceSans
2229OnBar_4.Text = ""
2230OnBar_4.TextSize = 14
2231
2232Bar_4.Name = "Bar"
2233Bar_4.Parent = Change_4
2234Bar_4.BackgroundColor3 = Color3.fromRGB(219, 47, 84)
2235Bar_4.BorderSizePixel = 0
2236Bar_4.ClipsDescendants = true
2237Bar_4.Position = UDim2.new(0, -2, 0, -2)
2238Bar_4.Size = UDim2.new(0, 10, 0, 19)
2239Bar_4.Font = Enum.Font.SourceSans
2240Bar_4.Text = ""
2241Bar_4.TextSize = 14
2242
2243Scripts.Name = "Scripts"
2244Scripts.Parent = MapSettings
2245Scripts.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2246Scripts.BackgroundTransparency = 1
2247Scripts.BorderSizePixel = 0
2248Scripts.Size = UDim2.new(1, 0, 0, 60)
2249
2250SName_5.Name = "SName"
2251SName_5.Parent = Scripts
2252SName_5.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2253SName_5.BackgroundTransparency = 1
2254SName_5.BorderColor3 = Color3.fromRGB(40, 40, 40)
2255SName_5.Position = UDim2.new(0, 10, 0, 0)
2256SName_5.Size = UDim2.new(1, -20, 0, 30)
2257SName_5.Font = Enum.Font.SourceSans
2258SName_5.Text = "Save Scripts"
2259SName_5.TextColor3 = Color3.fromRGB(255, 255, 255)
2260SName_5.TextSize = 18
2261SName_5.TextXAlignment = Enum.TextXAlignment.Left
2262
2263Status_5.Name = "Status"
2264Status_5.Parent = Scripts
2265Status_5.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2266Status_5.BackgroundTransparency = 1
2267Status_5.BorderColor3 = Color3.fromRGB(40, 40, 40)
2268Status_5.Position = UDim2.new(0, 60, 0, 30)
2269Status_5.Size = UDim2.new(0, 50, 0, 15)
2270Status_5.Font = Enum.Font.SourceSans
2271Status_5.Text = "Off"
2272Status_5.TextColor3 = Color3.fromRGB(255, 255, 255)
2273Status_5.TextSize = 18
2274Status_5.TextXAlignment = Enum.TextXAlignment.Left
2275
2276Change_5.Name = "Change"
2277Change_5.Parent = Scripts
2278Change_5.BackgroundColor3 = Color3.fromRGB(81, 81, 81)
2279Change_5.BorderColor3 = Color3.fromRGB(40, 40, 40)
2280Change_5.BorderSizePixel = 0
2281Change_5.Position = UDim2.new(0, 10, 0, 30)
2282Change_5.Size = UDim2.new(0, 40, 0, 15)
2283Change_5.Font = Enum.Font.SourceSans
2284Change_5.Text = ""
2285Change_5.TextColor3 = Color3.fromRGB(255, 255, 255)
2286Change_5.TextSize = 14
2287
2288OnBar_5.Name = "OnBar"
2289OnBar_5.Parent = Change_5
2290OnBar_5.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
2291OnBar_5.BorderSizePixel = 0
2292OnBar_5.Size = UDim2.new(0, 0, 0, 15)
2293OnBar_5.Font = Enum.Font.SourceSans
2294OnBar_5.Text = ""
2295OnBar_5.TextSize = 14
2296
2297Bar_5.Name = "Bar"
2298Bar_5.Parent = Change_5
2299Bar_5.BackgroundColor3 = Color3.fromRGB(219, 47, 84)
2300Bar_5.BorderSizePixel = 0
2301Bar_5.ClipsDescendants = true
2302Bar_5.Position = UDim2.new(0, -2, 0, -2)
2303Bar_5.Size = UDim2.new(0, 10, 0, 19)
2304Bar_5.Font = Enum.Font.SourceSans
2305Bar_5.Text = ""
2306Bar_5.TextSize = 14
2307
2308ToSave.Name = "ToSave"
2309ToSave.Parent = SaveMapWindow
2310ToSave.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2311ToSave.BackgroundTransparency = 1
2312ToSave.Position = UDim2.new(0, 0, 0, 17)
2313ToSave.Size = UDim2.new(1, 0, 0, 20)
2314ToSave.Font = Enum.Font.SourceSans
2315ToSave.Text = "To Save"
2316ToSave.TextColor3 = Color3.fromRGB(255, 255, 255)
2317ToSave.TextSize = 18
2318
2319CopyList.Name = "CopyList"
2320CopyList.Parent = SaveMapWindow
2321CopyList.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2322CopyList.BackgroundTransparency = 0.4
2323CopyList.BorderSizePixel = 0
2324CopyList.Position = UDim2.new(0, 0, 0, 37)
2325CopyList.Size = UDim2.new(1, 0, 0, 163)
2326
2327Bottom.Name = "Bottom"
2328Bottom.Parent = SaveMapWindow
2329Bottom.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
2330Bottom.BorderColor3 = Color3.fromRGB(30, 30, 30)
2331Bottom.BorderSizePixel = 0
2332Bottom.Position = UDim2.new(0, 0, 1, -50)
2333Bottom.Size = UDim2.new(1, 0, 0, 50)
2334
2335TextLabel_4.Parent = Bottom
2336TextLabel_4.BackgroundTransparency = 1
2337TextLabel_4.Position = UDim2.new(0, 4, 0, 0)
2338TextLabel_4.Size = UDim2.new(1, -4, 1, 0)
2339TextLabel_4.Font = Enum.Font.SourceSans
2340TextLabel_4.Text = "After the map saves, open a new place on studio, then right click Lighting and \"Insert from file...\", then select your file and run the unpacker script inside the folder."
2341TextLabel_4.TextColor3 = Color3.fromRGB(255, 255, 255)
2342TextLabel_4.TextSize = 14
2343TextLabel_4.TextWrapped = true
2344TextLabel_4.TextXAlignment = Enum.TextXAlignment.Left
2345TextLabel_4.TextYAlignment = Enum.TextYAlignment.Top
2346
2347Save_2.Name = "Save"
2348Save_2.Parent = SaveMapWindow
2349Save_2.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
2350Save_2.BackgroundTransparency = 0.4
2351Save_2.BorderColor3 = Color3.fromRGB(0, 0, 0)
2352Save_2.BorderSizePixel = 0
2353Save_2.Position = UDim2.new(0, 0, 1, -80)
2354Save_2.Size = UDim2.new(1, 0, 0, 30)
2355Save_2.Font = Enum.Font.SourceSans
2356Save_2.Text = "Save"
2357Save_2.TextColor3 = Color3.fromRGB(255, 255, 255)
2358Save_2.TextSize = 18
2359
2360FileName_2.Name = "FileName"
2361FileName_2.Parent = SaveMapWindow
2362FileName_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2363FileName_2.BackgroundTransparency = 0.4
2364FileName_2.BorderSizePixel = 0
2365FileName_2.Position = UDim2.new(0, 0, 1, -105)
2366FileName_2.Size = UDim2.new(1, 0, 0, 25)
2367FileName_2.Font = Enum.Font.SourceSans
2368FileName_2.Text = " PlaceName"
2369FileName_2.TextColor3 = Color3.fromRGB(255, 255, 255)
2370FileName_2.TextSize = 18
2371FileName_2.TextXAlignment = Enum.TextXAlignment.Left
2372
2373Entry_2.Name = "Entry"
2374Entry_2.Parent = SaveMapWindow
2375Entry_2.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2376Entry_2.BackgroundTransparency = 1
2377Entry_2.BorderSizePixel = 0
2378Entry_2.Size = UDim2.new(1, 0, 0, 22)
2379Entry_2.Visible = false
2380
2381Change_6.Name = "Change"
2382Change_6.Parent = Entry_2
2383Change_6.BackgroundColor3 = Color3.fromRGB(219, 47, 84)
2384Change_6.BackgroundTransparency = 0.6
2385Change_6.Position = UDim2.new(0, 10, 0, 1)
2386Change_6.Size = UDim2.new(0, 20, 0, 20)
2387Change_6.ZIndex = 2
2388Change_6.Font = Enum.Font.SourceSans
2389Change_6.Text = ""
2390Change_6.TextColor3 = Color3.fromRGB(255, 255, 255)
2391Change_6.TextSize = 18
2392
2393enabled_3.Name = "enabled"
2394enabled_3.Parent = Change_6
2395enabled_3.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
2396enabled_3.BackgroundTransparency = 0.4
2397enabled_3.BorderSizePixel = 0
2398enabled_3.Position = UDim2.new(0, 3, 0, 3)
2399enabled_3.Size = UDim2.new(0, 14, 0, 14)
2400enabled_3.Font = Enum.Font.SourceSans
2401enabled_3.Text = ""
2402enabled_3.TextColor3 = Color3.fromRGB(255, 255, 255)
2403enabled_3.TextSize = 14
2404
2405Info.Name = "Info"
2406Info.Parent = Entry_2
2407Info.BackgroundTransparency = 1
2408Info.Position = UDim2.new(0, 40, 0, 0)
2409Info.Size = UDim2.new(1, -40, 0, 22)
2410Info.Font = Enum.Font.SourceSans
2411Info.Text = "Workspace"
2412Info.TextColor3 = Color3.fromRGB(255, 255, 255)
2413Info.TextSize = 18
2414Info.TextXAlignment = Enum.TextXAlignment.Left
2415
2416RemoteDebugWindow.Name = "RemoteDebugWindow"
2417RemoteDebugWindow.Parent = ROBLOX
2418RemoteDebugWindow.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2419RemoteDebugWindow.BorderColor3 = Color3.fromRGB(191, 191, 191)
2420RemoteDebugWindow.BorderSizePixel = 0
2421RemoteDebugWindow.Position = UDim2.new(1, 0, 0, 1)
2422RemoteDebugWindow.Size = UDim2.new(0, 300, 1, 0)
2423
2424Header_4.Name = "Header"
2425Header_4.Parent = RemoteDebugWindow
2426Header_4.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2427Header_4.BorderColor3 = Color3.fromRGB(30, 30, 30)
2428Header_4.Size = UDim2.new(1, 0, 0, 17)
2429
2430TextLabel_5.Parent = Header_4
2431TextLabel_5.BackgroundTransparency = 1
2432TextLabel_5.Position = UDim2.new(0, 4, 0, 0)
2433TextLabel_5.Size = UDim2.new(1, -4, 1, 0)
2434TextLabel_5.Font = Enum.Font.SourceSans
2435TextLabel_5.Text = "Remote Debugger"
2436TextLabel_5.TextColor3 = Color3.fromRGB(255, 255, 255)
2437TextLabel_5.TextSize = 14
2438TextLabel_5.TextXAlignment = Enum.TextXAlignment.Left
2439
2440AboutWindow.Name = "AboutWindow"
2441AboutWindow.Parent = ROBLOX
2442AboutWindow.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2443AboutWindow.BorderColor3 = Color3.fromRGB(191, 191, 191)
2444AboutWindow.BorderSizePixel = 0
2445AboutWindow.Position = UDim2.new(1, 0, 0, 1)
2446AboutWindow.Size = UDim2.new(0, 300, 1, 0)
2447
2448Header_5.Name = "Header"
2449Header_5.Parent = AboutWindow
2450Header_5.BackgroundColor3 = Color3.fromRGB(43, 43, 43)
2451Header_5.BorderColor3 = Color3.fromRGB(30, 30, 30)
2452Header_5.Size = UDim2.new(1, 0, 0, 17)
2453
2454TextLabel_6.Parent = Header_5
2455TextLabel_6.BackgroundTransparency = 1
2456TextLabel_6.Position = UDim2.new(0, 4, 0, 0)
2457TextLabel_6.Size = UDim2.new(1, -4, 1, 0)
2458TextLabel_6.Font = Enum.Font.SourceSans
2459TextLabel_6.Text = "About"
2460TextLabel_6.TextColor3 = Color3.fromRGB(255, 255, 255)
2461TextLabel_6.TextSize = 14
2462TextLabel_6.TextXAlignment = Enum.TextXAlignment.Left
2463
2464Title_9.Name = "Logo"
2465Title_9.Parent = AboutWindow
2466Title_9.BackgroundTransparency = 1
2467Title_9.Position = UDim2.new(0, 100, 0, 70)
2468Title_9.Size = UDim2.new(0, 100, 0, 90)
2469Title_9.ZIndex = 4
2470Title_9.Image = "http://www.roblox.com/asset/?id=4706382927"
2471Title_9.ScaleType = Enum.ScaleType.Fit
2472
2473Desc_6.Name = "Desc"
2474Desc_6.Parent = AboutWindow
2475Desc_6.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
2476Desc_6.BackgroundTransparency = 1
2477Desc_6.Position = UDim2.new(0.1, 0, 0.1, 0)
2478Desc_6.Size = UDim2.new(0.8, 0, 0, 200)
2479Desc_6.Font = Enum.Font.SourceSans
2480Desc_6.Text = "Dex v2.0.1\nEdited by FutureHacks & Xaon"
2481Desc_6.TextColor3 = Color3.fromRGB(0, 170, 255)
2482Desc_6.TextSize = 24
2483Desc_6.TextWrapped = true
2484
2485local NewGuiPart153 = Instance.new("BindableFunction")
2486local NewGuiPart154 = Instance.new("BindableFunction")
2487local NewGuiPart155 = Instance.new("BindableFunction")
2488local NewGuiPart156 = Instance.new("BindableFunction")
2489local NewGuiPart157 = Instance.new("BindableEvent")
2490local NewGuiPart158 = Instance.new("BindableFunction")
2491local NewGuiPart159 = Instance.new("BindableFunction")
2492local NewGuiPart160 = Instance.new("BindableEvent")
2493local NewGuiPart161 = Instance.new("BindableFunction")
2494local NewGuiPart162 = Instance.new("BindableFunction")
2495local NewGuiPart163 = Instance.new("BindableEvent")
2496
2497NewGuiPart158.Name = "GetApi"
2498NewGuiPart158.Parent = PropertiesFrame
2499NewGuiPart158.Archivable = true
2500
2501NewGuiPart159.Name = "GetAwaiting"
2502NewGuiPart159.Parent = PropertiesFrame
2503NewGuiPart159.Archivable = true
2504
2505NewGuiPart160.Name = "SetAwaiting"
2506NewGuiPart160.Parent = PropertiesFrame
2507NewGuiPart160.Archivable = true
2508
2509NewGuiPart153.Name = "GetOption"
2510NewGuiPart153.Parent = ExplorerPanel
2511NewGuiPart153.Archivable = true
2512
2513NewGuiPart154.Name = "GetSelection"
2514NewGuiPart154.Parent = ExplorerPanel
2515NewGuiPart154.Archivable = true
2516
2517NewGuiPart155.Name = "SetOption"
2518NewGuiPart155.Parent = ExplorerPanel
2519NewGuiPart155.Archivable = true
2520
2521NewGuiPart156.Name = "SetSelection"
2522NewGuiPart156.Parent = ExplorerPanel
2523NewGuiPart156.Archivable = true
2524
2525NewGuiPart157.Name = "SelectionChanged"
2526NewGuiPart157.Parent = ExplorerPanel
2527NewGuiPart157.Archivable = true
2528
2529NewGuiPart161.Name = "GetSetting"
2530NewGuiPart161.Parent = RemoteDebugWindow
2531NewGuiPart161.Archivable = true
2532
2533NewGuiPart162.Name = "GetSetting"
2534NewGuiPart162.Parent = SettingsPanel
2535NewGuiPart162.Archivable = true
2536
2537NewGuiPart163.Name = "OpenScript"
2538NewGuiPart163.Parent = ScriptEditor
2539NewGuiPart163.Archivable = true
2540
2541return ROBLOX
2542end
2543
2544local D_E_X = CreateGui()
2545D_E_X.Parent = coregui.RobloxGui;
2546
2547spawn(function()
2548
2549local Gui = D_E_X
2550
2551local IntroFrame = Gui:WaitForChild("IntroFrame")
2552
2553local SideMenu = Gui:WaitForChild("SideMenu")
2554local OpenToggleButton = Gui:WaitForChild("Toggle")
2555local CloseToggleButton = SideMenu:WaitForChild("Toggle")
2556local OpenScriptEditorButton = SideMenu:WaitForChild("OpenScriptEditor")
2557
2558local ScriptEditor = Gui:WaitForChild("ScriptEditor")
2559
2560local SlideOut = SideMenu:WaitForChild("SlideOut")
2561local SlideFrame = SlideOut:WaitForChild("SlideFrame")
2562local Slant = SideMenu:WaitForChild("Slant")
2563
2564local ExplorerButton = SlideFrame:WaitForChild("Explorer")
2565local SettingsButton = SlideFrame:WaitForChild("Settings")
2566
2567local SelectionBox = Instance.new("SelectionBox")
2568SelectionBox.Parent = Gui
2569
2570local ExplorerPanel = Gui:WaitForChild("ExplorerPanel")
2571local PropertiesFrame = Gui:WaitForChild("PropertiesFrame")
2572local SaveMapWindow = Gui:WaitForChild("SaveMapWindow")
2573local RemoteDebugWindow = Gui:WaitForChild("RemoteDebugWindow")
2574local AboutWindow = Gui:WaitForChild("AboutWindow")
2575
2576local SettingsPanel = Gui:WaitForChild("SettingsPanel")
2577local SettingsListener = SettingsPanel:WaitForChild("GetSetting")
2578local SettingTemplate = SettingsPanel:WaitForChild("SettingTemplate")
2579local SettingList = SettingsPanel:WaitForChild("SettingList")
2580
2581local SaveMapCopyList = SaveMapWindow:WaitForChild("CopyList")
2582local SaveMapSettingFrame = SaveMapWindow:WaitForChild("MapSettings")
2583local SaveMapName = SaveMapWindow:WaitForChild("FileName")
2584local SaveMapButton = SaveMapWindow:WaitForChild("Save")
2585local SaveMapCopyTemplate = SaveMapWindow:WaitForChild("Entry")
2586local SaveMapSettings = {
2587 CopyWhat = {
2588 Workspace = true,
2589 Lighting = true,
2590 ReplicatedStorage = true,
2591 ReplicatedFirst = true,
2592 StarterPack = true,
2593 StarterGui = true,
2594 StarterPlayer = true
2595 },
2596 SaveScripts = true,
2597 SaveTerrain = true,
2598 LightingProperties = true,
2599 CameraInstances = true
2600}
2601
2602local SelectionChanged = ExplorerPanel:WaitForChild("SelectionChanged")
2603local GetSelection = ExplorerPanel:WaitForChild("GetSelection")
2604local SetSelection = ExplorerPanel:WaitForChild("SetSelection")
2605
2606local Player = game:GetService("Players").LocalPlayer
2607local Mouse = Player:GetMouse()
2608
2609local CurrentWindow = "Nothing c:"
2610local Windows = {
2611 Explorer = {
2612 ExplorerPanel,
2613 PropertiesFrame
2614 },
2615 Settings = {SettingsPanel},
2616 SaveMap = {SaveMapWindow},
2617 About = {AboutWindow}
2618}
2619
2620function switchWindows(wName,over)
2621 if CurrentWindow == wName and not over then return end
2622
2623 local count = 0
2624
2625 for i,v in pairs(Windows) do
2626 count = 0
2627 if i ~= wName then
2628 for _,c in pairs(v) do c:TweenPosition(UDim2.new(1, 30, c.Position.Y.Scale, c.Position.Y.Offset), "Out", "Quad", 0.5, true) count = count + 1 end
2629 -- for _,c in pairs(v) do c:TweenPosition(UDim2.new(1, 30, count * 0.5, count * 36), "Out", "Quad", 0.5, true) count = count + 1 end
2630 end
2631 end
2632
2633 count = 0
2634
2635 if Windows[wName] then
2636 for _,c in pairs(Windows[wName]) do c:TweenPosition(UDim2.new(1, -300, c.Position.Y.Scale, c.Position.Y.Offset), "Out", "Quad", 0.5, true) count = count + 1 end
2637 -- for _,c in pairs(Windows[wName]) do c:TweenPosition(UDim2.new(1, -300, count * 0.5, count * 36), "Out", "Quad", 0.5, true) count = count + 1 end
2638 end
2639
2640 if wName ~= "Nothing c:" then
2641 CurrentWindow = wName
2642 for i,v in pairs(SlideFrame:GetChildren()) do
2643 v.AutoButtonColor = false;
2644 v.BackgroundTransparency = 1
2645 v.Icon.ImageColor3 = Color3.fromRGB(0, 170, 255)
2646 end
2647 if SlideFrame:FindFirstChild(wName) then
2648 -- SlideFrame[wName].BackgroundTransparency = 1
2649 SlideFrame[wName].Icon.ImageColor3 = Color3.fromRGB(0, 170, 255)
2650 end
2651 end
2652end
2653
2654function toggleDex(on)
2655 if on then
2656 SideMenu:TweenPosition(UDim2.new(1, -330, 0, 0), "Out", "Quad", 0.5, true)
2657 OpenToggleButton:TweenPosition(UDim2.new(1,0,0,0), "Out", "Quad", 0.5, true)
2658 switchWindows(CurrentWindow,true)
2659 else
2660 SideMenu:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 0.5, true)
2661 OpenToggleButton:TweenPosition(UDim2.new(1,-30,0,0), "Out", "Quad", 0.5, true)
2662 switchWindows("Nothing c:")
2663 end
2664end
2665
2666local Settings = {
2667 ClickSelect = false;
2668 SelBox = false;
2669 ClearProps = false;
2670 SelectUngrouped = true;
2671 SaveInstanceScripts = true;
2672}
2673
2674function ReturnSetting(set)
2675 if set == "ClearProps" then
2676 return Settings.ClearProps
2677 elseif set == "SelectUngrouped" then
2678 return Settings.SelectUngrouped
2679 end
2680end
2681
2682OpenToggleButton.MouseButton1Up:connect(function()
2683 toggleDex(true)
2684end)
2685
2686OpenScriptEditorButton.MouseButton1Up:connect(function()
2687 if OpenScriptEditorButton.Active then
2688 ScriptEditor.Visible = true
2689 end
2690end)
2691
2692CloseToggleButton.MouseButton1Up:connect(function()
2693 if CloseToggleButton.Active then
2694 toggleDex(false)
2695 end
2696end)
2697
2698for i,v in pairs(SlideFrame:GetChildren()) do
2699 v.MouseButton1Click:connect(function()
2700 switchWindows(v.Name)
2701 end)
2702
2703 -- v.MouseEnter:connect(function()v.BackgroundTransparency = 0.5 end)
2704 -- v.MouseLeave:connect(function()if CurrentWindow~=v.Name then v.BackgroundTransparency = 1 end end)
2705end
2706
2707
2708function createSetting(name, interName, defaultOn, func)
2709 local newSetting = SettingTemplate:Clone()
2710 newSetting.Position = UDim2.new(0,0,0,#SettingList:GetChildren() * 60)
2711 newSetting.SName.Text = name
2712
2713 local function toggle(on)
2714 if on then
2715 newSetting.Change.Bar:TweenPosition(UDim2.new(0,32,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2716 newSetting.Change.OnBar:TweenSize(UDim2.new(0,34,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2717 newSetting.Status.Text = "On"
2718 Settings[interName] = true
2719 else
2720 newSetting.Change.Bar:TweenPosition(UDim2.new(0,-2,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2721 newSetting.Change.OnBar:TweenSize(UDim2.new(0,0,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2722 newSetting.Status.Text = "Off"
2723 Settings[interName] = false
2724 end
2725 end
2726
2727 newSetting.Change.MouseButton1Click:connect(function()
2728 toggle(not Settings[interName])
2729 if func then pcall(func, Settings[interName]) end
2730 end)
2731
2732 newSetting.Visible = true
2733 newSetting.Parent = SettingList
2734
2735 if defaultOn then
2736 toggle(true)
2737 end
2738end
2739
2740createSetting("Click part to select","ClickSelect",false)
2741createSetting("Selection Box","SelBox",false)
2742createSetting("Clear property value on focus","ClearProps",false)
2743createSetting("Select ungrouped models","SelectUngrouped",true)
2744createSetting("SaveInstance decompiles scripts","SaveInstanceScripts",true)
2745
2746local function getSelection()
2747 local t = GetSelection:Invoke()
2748 if t and #t > 0 then
2749 return t[1]
2750 else
2751 return nil
2752 end
2753end
2754
2755Mouse.Button1Down:connect(function()
2756 if CurrentWindow == "Explorer" and Settings.ClickSelect then
2757 local target = Mouse.Target
2758 if target then
2759 SetSelection:Invoke({target})
2760 end
2761 end
2762end)
2763
2764SelectionChanged.Event:connect(function()
2765 if Settings.SelBox then
2766 local success,err = pcall(function()
2767 local selection = getSelection()
2768 SelectionBox.Adornee = selection
2769 end)
2770 if err then
2771 SelectionBox.Adornee = nil
2772 end
2773 end
2774end)
2775
2776SettingsListener.OnInvoke = ReturnSetting
2777
2778-- Map Copier
2779
2780function createMapSetting(obj,interName,defaultOn)
2781 local function toggle(on)
2782 if on then
2783 obj.Change.Bar:TweenPosition(UDim2.new(0,32,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2784 obj.Change.OnBar:TweenSize(UDim2.new(0,34,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2785 obj.Status.Text = "On"
2786 SaveMapSettings[interName] = true
2787 else
2788 obj.Change.Bar:TweenPosition(UDim2.new(0,-2,0,-2),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2789 obj.Change.OnBar:TweenSize(UDim2.new(0,0,0,15),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.25,true)
2790 obj.Status.Text = "Off"
2791 SaveMapSettings[interName] = false
2792 end
2793 end
2794
2795 obj.Change.MouseButton1Click:connect(function()
2796 toggle(not SaveMapSettings[interName])
2797 end)
2798
2799 obj.Visible = true
2800 obj.Parent = SaveMapSettingFrame
2801
2802 if defaultOn then
2803 toggle(true)
2804 end
2805end
2806
2807function createCopyWhatSetting(serv)
2808 if SaveMapSettings.CopyWhat[serv] then
2809 local newSetting = SaveMapCopyTemplate:Clone()
2810 newSetting.Position = UDim2.new(0,0,0,#SaveMapCopyList:GetChildren() * 22 + 5)
2811 newSetting.Info.Text = serv
2812
2813 local function toggle(on)
2814 if on then
2815 newSetting.Change.enabled.Visible = true
2816 SaveMapSettings.CopyWhat[serv] = true
2817 else
2818 newSetting.Change.enabled.Visible = false
2819 SaveMapSettings.CopyWhat[serv] = false
2820 end
2821 end
2822
2823 newSetting.Change.MouseButton1Click:connect(function()
2824 toggle(not SaveMapSettings.CopyWhat[serv])
2825 end)
2826
2827 newSetting.Visible = true
2828 newSetting.Parent = SaveMapCopyList
2829 end
2830end
2831
2832createMapSetting(SaveMapSettingFrame.Scripts,"SaveScripts",true)
2833createMapSetting(SaveMapSettingFrame.Terrain,"SaveTerrain",true)
2834createMapSetting(SaveMapSettingFrame.Lighting,"LightingProperties",true)
2835createMapSetting(SaveMapSettingFrame.CameraInstances,"CameraInstances",true)
2836
2837createCopyWhatSetting("Workspace")
2838createCopyWhatSetting("Lighting")
2839createCopyWhatSetting("ReplicatedStorage")
2840createCopyWhatSetting("ReplicatedFirst")
2841createCopyWhatSetting("StarterPack")
2842createCopyWhatSetting("StarterGui")
2843createCopyWhatSetting("StarterPlayer")
2844
2845SaveMapName.Text = tostring(game.PlaceId).."MapCopy"
2846
2847SaveMapButton.MouseButton1Click:connect(function()
2848 local copyWhat = {}
2849
2850 local copyGroup = Instance.new("Model",game:GetService'ReplicatedStorage')
2851
2852 local copyScripts = SaveMapSettings.SaveScripts
2853
2854 local copyTerrain = SaveMapSettings.SaveTerrain
2855
2856 local lightingProperties = SaveMapSettings.LightingProperties
2857
2858 local cameraInstances = SaveMapSettings.CameraInstances
2859
2860 -----------------------------------------------------------------------------------
2861
2862 for i,v in pairs(SaveMapSettings.CopyWhat) do
2863 if v then
2864 table.insert(copyWhat,i)
2865 end
2866 end
2867
2868 local consoleFunc = printconsole or writeconsole
2869
2870 if consoleFunc then
2871 consoleFunc("Raspberry Pi's place copier loaded.")
2872 consoleFunc("Copying map of game "..tostring(game.PlaceId)..".")
2873 end
2874
2875 function archivable(root)
2876 for i,v in pairs(root:GetChildren()) do
2877 if not game:GetService'Players':GetPlayerFromCharacter(v) then
2878 v.Archivable = true
2879 archivable(v)
2880 end
2881 end
2882 end
2883
2884 function decompileS(root)
2885 for i,v in pairs(root:GetChildren()) do
2886 pcall(function()
2887 if v:IsA("LocalScript") then
2888 local isDisabled = v.Disabled
2889 v.Disabled = true
2890 v.Source = decompile(v)
2891 v.Disabled = isDisabled
2892
2893 if v.Source == "" then
2894 if consoleFunc then consoleFunc("LocalScript "..v.Name.." had a problem decompiling.") end
2895 else
2896 if consoleFunc then consoleFunc("LocalScript "..v.Name.." decompiled.") end
2897 end
2898 elseif v:IsA("ModuleScript") then
2899 v.Source = decompile(v)
2900
2901 if v.Source == "" then
2902 if consoleFunc then consoleFunc("ModuleScript "..v.Name.." had a problem decompiling.") end
2903 else
2904 if consoleFunc then consoleFunc("ModuleScript "..v.Name.." decompiled.") end
2905 end
2906 end
2907 end)
2908 decompileS(v)
2909 end
2910 end
2911
2912 for i,v in pairs(copyWhat) do archivable(game[v]) end
2913
2914 for j,obj in pairs(copyWhat) do
2915 if obj ~= "StarterPlayer" then
2916 local newFolder = Instance.new("Folder",copyGroup)
2917 newFolder.Name = obj
2918 for i,v in pairs(game[obj]:GetChildren()) do
2919 if v ~= copyGroup then
2920 pcall(function()
2921 v:Clone().Parent = newFolder
2922 end)
2923 end
2924 end
2925 else
2926 local newFolder = Instance.new("Model",copyGroup)
2927 newFolder.Name = "StarterPlayer"
2928 for i,v in pairs(game[obj]:GetChildren()) do
2929 local newObj = Instance.new("Folder",newFolder)
2930 newObj.Name = v.Name
2931 for _,c in pairs(v:GetChildren()) do
2932 if c.Name ~= "ControlScript" and c.Name ~= "CameraScript" then
2933 c:Clone().Parent = newObj
2934 end
2935 end
2936 end
2937 end
2938 end
2939
2940 if workspace.CurrentCamera and cameraInstances then
2941 local cameraFolder = Instance.new("Model",copyGroup)
2942 cameraFolder.Name = "CameraItems"
2943 for i,v in pairs(workspace.CurrentCamera:GetChildren()) do v:Clone().Parent = cameraFolder end
2944 end
2945
2946 if copyTerrain then
2947 local myTerrain = workspace.Terrain:CopyRegion(workspace.Terrain.MaxExtents)
2948 myTerrain.Parent = copyGroup
2949 end
2950
2951 function saveProp(obj,prop,par)
2952 local myProp = obj[prop]
2953 if type(myProp) == "boolean" then
2954 local newProp = Instance.new("BoolValue",par)
2955 newProp.Name = prop
2956 newProp.Value = myProp
2957 elseif type(myProp) == "number" then
2958 local newProp = Instance.new("IntValue",par)
2959 newProp.Name = prop
2960 newProp.Value = myProp
2961 elseif type(myProp) == "string" then
2962 local newProp = Instance.new("StringValue",par)
2963 newProp.Name = prop
2964 newProp.Value = myProp
2965 elseif type(myProp) == "userdata" then -- Assume Color3
2966 pcall(function()
2967 local newProp = Instance.new("Color3Value",par)
2968 newProp.Name = prop
2969 newProp.Value = myProp
2970 end)
2971 end
2972 end
2973
2974 if lightingProperties then
2975 local lightingProps = Instance.new("Model",copyGroup)
2976 lightingProps.Name = "LightingProperties"
2977
2978 saveProp(game:GetService'Lighting',"Ambient",lightingProps)
2979 saveProp(game:GetService'Lighting',"Brightness",lightingProps)
2980 saveProp(game:GetService'Lighting',"ColorShift_Bottom",lightingProps)
2981 saveProp(game:GetService'Lighting',"ColorShift_Top",lightingProps)
2982 saveProp(game:GetService'Lighting',"GlobalShadows",lightingProps)
2983 saveProp(game:GetService'Lighting',"OutdoorAmbient",lightingProps)
2984 saveProp(game:GetService'Lighting',"Outlines",lightingProps)
2985 saveProp(game:GetService'Lighting',"GeographicLatitude",lightingProps)
2986 saveProp(game:GetService'Lighting',"TimeOfDay",lightingProps)
2987 saveProp(game:GetService'Lighting',"FogColor",lightingProps)
2988 saveProp(game:GetService'Lighting',"FogEnd",lightingProps)
2989 saveProp(game:GetService'Lighting',"FogStart",lightingProps)
2990 end
2991
2992 if decompile and copyScripts then
2993 decompileS(copyGroup)
2994 end
2995
2996 if SaveInstance then
2997 SaveInstance(copyGroup,SaveMapName.Text..".rbxm")
2998 elseif saveinstance then
2999 saveinstance(SaveMapName.Text..".rbxm", copyGroup)
3000 end
3001 --print("Saved!")
3002 if consoleFunc then
3003 consoleFunc("The map has been copied.")
3004 end
3005 SaveMapButton.Text = "The map has been saved"
3006 wait(5)
3007 SaveMapButton.Text = "Save"
3008end)
3009
3010-- End Copier
3011
3012wait()
3013
3014IntroFrame:TweenPosition(UDim2.new(1,-300,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
3015
3016switchWindows("Explorer")
3017
3018wait(1)
3019
3020SideMenu.Visible = true
3021
3022for i = 0,1,0.1 do
3023 IntroFrame.BackgroundTransparency = i
3024 IntroFrame.Main.BackgroundTransparency = i
3025 IntroFrame.Slant.ImageLabel.ImageTransparency = i
3026 IntroFrame.Title.ImageTransparency = i
3027 IntroFrame.Version.TextTransparency = i
3028 IntroFrame.Creator.TextTransparency = i
3029 wait()
3030end
3031
3032IntroFrame.Visible = false
3033
3034SlideFrame:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
3035OpenScriptEditorButton:TweenPosition(UDim2.new(0,0,0,150),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
3036CloseToggleButton:TweenPosition(UDim2.new(0,0,0,180),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
3037Slant:TweenPosition(UDim2.new(0,0,0,210),Enum.EasingDirection.Out,Enum.EasingStyle.Quart,0.5,true)
3038
3039wait(0.5)
3040
3041for i = 1,0,-0.1 do
3042 OpenScriptEditorButton.Icon.ImageTransparency = i
3043 CloseToggleButton.TextTransparency = i
3044 wait()
3045end
3046
3047CloseToggleButton.Active = true
3048
3049OpenScriptEditorButton.Active = true
3050end)
3051spawn(function()
3052 -- initial states
3053local Option = {
3054 -- can modify object parents in the hierarchy
3055 Modifiable = false;
3056 -- can select objects
3057 Selectable = true;
3058}
3059
3060-- MERELY
3061
3062Option.Modifiable = true
3063
3064-- END MERELY
3065
3066-- general size of GUI objects, in pixels
3067local GUI_SIZE = 16
3068-- padding between items within each entry
3069local ENTRY_PADDING = 1
3070-- padding between each entry
3071local ENTRY_MARGIN = 1
3072
3073local Input = game:GetService("UserInputService")
3074local HoldingCtrl = false
3075local HoldingShift = false
3076
3077--[[
3078
3079# Explorer Panel
3080
3081A GUI panel that displays the game hierarchy.
3082
3083
3084## Selection Bindables
3085
3086- `Function GetSelection ( )`
3087
3088 Returns an array of objects representing the objects currently
3089 selected in the panel.
3090
3091- `Function SetSelection ( Objects selection )`
3092
3093 Sets the objects that are selected in the panel. `selection` is an array
3094 of objects.
3095
3096- `Event SelectionChanged ( )`
3097
3098 Fired after the selection changes.
3099
3100
3101## Option Bindables
3102
3103- `Function GetOption ( string optionName )`
3104
3105 If `optionName` is given, returns the value of that option. Otherwise,
3106 returns a table of options and their current values.
3107
3108- `Function SetOption ( string optionName, bool value )`
3109
3110 Sets `optionName` to `value`.
3111
3112 Options:
3113
3114 - Modifiable
3115
3116 Whether objects can be modified by the panel.
3117
3118 Note that modifying objects depends on being able to select them. If
3119 Selectable is false, then Actions will not be available. Reparenting
3120 is still possible, but only for the dragged object.
3121
3122 - Selectable
3123
3124 Whether objects can be selected.
3125
3126 If Modifiable is false, then left-clicking will perform a drag
3127 selection.
3128
3129## Updates
3130
3131- 2013-09-18
3132 - Fixed explorer icons to match studio explorer.
3133
3134- 2013-09-14
3135 - Added GetOption and SetOption bindables.
3136 - Option: Modifiable; sets whether objects can be modified by the panel.
3137 - Option: Selectable; sets whether objects can be selected.
3138 - Slight modification to left-click selection behavior.
3139 - Improved layout and scaling.
3140
3141- 2013-09-13
3142 - Added drag to reparent objects.
3143 - Left-click to select/deselect object.
3144 - Left-click and drag unselected object to reparent single object.
3145 - Left-click and drag selected object to move reparent entire selection.
3146 - Right-click while dragging to cancel.
3147
3148- 2013-09-11
3149 - Added explorer panel header with actions.
3150 - Added Cut action.
3151 - Added Copy action.
3152 - Added Paste action.
3153 - Added Delete action.
3154 - Added drag selection.
3155 - Left-click: Add to selection on drag.
3156 - Right-click: Add to or remove from selection on drag.
3157 - Ensured SelectionChanged fires only when the selection actually changes.
3158 - Added documentation and change log.
3159 - Fixed thread issue.
3160
3161- 2013-09-09
3162 - Added basic multi-selection.
3163 - Left-click to set selection.
3164 - Right-click to add to or remove from selection.
3165 - Removed "Selection" ObjectValue.
3166 - Added GetSelection BindableFunction.
3167 - Added SetSelection BindableFunction.
3168 - Added SelectionChanged BindableEvent.
3169 - Changed font to SourceSans.
3170
3171- 2013-08-31
3172 - Improved GUI sizing based off of `GUI_SIZE` constant.
3173 - Automatic font size detection.
3174
3175- 2013-08-27
3176 - Initial explorer panel.
3177
3178
3179## Todo
3180
3181- Sorting
3182 - by ExplorerOrder
3183 - by children
3184 - by name
3185- Drag objects to reparent
3186
3187]]
3188
3189local ENTRY_SIZE = GUI_SIZE + ENTRY_PADDING*2
3190local ENTRY_BOUND = ENTRY_SIZE + ENTRY_MARGIN
3191local HEADER_SIZE = ENTRY_SIZE*2
3192
3193local FONT = 'SourceSans'
3194local FONT_SIZE do
3195 local size = {8,9,10,11,12,14,18,24,36,48}
3196 local s
3197 local n = math.huge
3198 for i = 1,#size do
3199 if size[i] <= GUI_SIZE then
3200 FONT_SIZE = i - 1
3201 end
3202 end
3203end
3204
3205local GuiColor = {
3206 Background = Color3.fromRGB( 43, 43, 43);
3207 Border = Color3.fromRGB( 20, 20, 20);
3208 Selected = Color3.fromRGB( 0, 170, 255);
3209 BorderSelected = Color3.fromRGB( 170, 82, 104);
3210 Text = Color3.fromRGB(245, 245, 245);
3211 TextDisabled = Color3.fromRGB(188, 188, 188);
3212 TextSelected = Color3.fromRGB(255, 255, 255);
3213 Button = Color3.fromRGB( 33, 33, 33);
3214 ButtonBorder = Color3.fromRGB(133, 133, 133);
3215 ButtonSelected = Color3.fromRGB( 250, 51, 101);
3216 Field = Color3.fromRGB( 43, 43, 43);
3217 FieldBorder = Color3.fromRGB( 50, 50, 50);
3218 TitleBackground = Color3.fromRGB( 11, 11, 11);
3219}
3220
3221--[[
3222Background = Color3.fromRGB(233, 233, 233);
3223Border = Color3.fromRGB(149, 149, 149);
3224Selected = Color3.fromRGB( 96, 140, 211);
3225BorderSelected = Color3.fromRGB( 86, 125, 188);
3226Text = Color3.fromRGB( 0, 0, 0);
3227TextDisabled = Color3.fromRGB(128, 128, 128);
3228TextSelected = Color3.fromRGB(255, 255, 255);
3229Button = Color3.fromRGB(221, 221, 221);
3230ButtonBorder = Color3.fromRGB(149, 149, 149);
3231ButtonSelected = Color3.fromRGB(255, 0, 0);
3232Field = Color3.fromRGB(255, 255, 255);
3233FieldBorder = Color3.fromRGB(191, 191, 191);
3234TitleBackground = Color3.fromRGB(178, 178, 178);
3235]]
3236
3237----------------------------------------------------------------
3238----------------------------------------------------------------
3239----------------------------------------------------------------
3240----------------------------------------------------------------
3241---- Icon map constants
3242
3243local MAP_ID = 483448923
3244
3245-- Indices based on implementation of Icon function.
3246local ACTION_CUT = 160
3247local ACTION_COPY = 161
3248local ACTION_PASTE = 162
3249local ACTION_DELETE = 163
3250local ACTION_SORT = 164
3251local ACTION_CUT_OVER = 174
3252local ACTION_COPY_OVER = 175
3253local ACTION_PASTE_OVER = 176
3254local ACTION_DELETE_OVER = 177
3255local ACTION_SORT_OVER = 178
3256local ACTION_EDITQUICKACCESS = 190
3257local ACTION_FREEZE = 188
3258local ACTION_STARRED = 189
3259local ACTION_ADDSTAR = 184
3260local ACTION_ADDSTAR_OVER = 187
3261
3262local NODE_COLLAPSED = 165
3263local NODE_EXPANDED = 166
3264local NODE_COLLAPSED_OVER = 179
3265local NODE_EXPANDED_OVER = 180
3266
3267local ExplorerIndex = {
3268 ["Accessory"] = 32;
3269 ["Accoutrement"] = 32;
3270 ["AdService"] = 73;
3271 ["Animation"] = 60;
3272 ["AnimationController"] = 60;
3273 ["AnimationTrack"] = 60;
3274 ["Animator"] = 60;
3275 ["ArcHandles"] = 56;
3276 ["AssetService"] = 72;
3277 ["Attachment"] = 34;
3278 ["Backpack"] = 20;
3279 ["BadgeService"] = 75;
3280 ["BallSocketConstraint"] = 89;
3281 ["BillboardGui"] = 64;
3282 ["BinaryStringValue"] = 4;
3283 ["BindableEvent"] = 67;
3284 ["BindableFunction"] = 66;
3285 ["BlockMesh"] = 8;
3286 ["BloomEffect"] = 90;
3287 ["BlurEffect"] = 90;
3288 ["BodyAngularVelocity"] = 14;
3289 ["BodyForce"] = 14;
3290 ["BodyGyro"] = 14;
3291 ["BodyPosition"] = 14;
3292 ["BodyThrust"] = 14;
3293 ["BodyVelocity"] = 14;
3294 ["BoolValue"] = 4;
3295 ["BoxHandleAdornment"] = 54;
3296 ["BrickColorValue"] = 4;
3297 ["Camera"] = 5;
3298 ["CFrameValue"] = 4;
3299 ["CharacterMesh"] = 60;
3300 ["Chat"] = 33;
3301 ["ClickDetector"] = 41;
3302 ["CollectionService"] = 30;
3303 ["Color3Value"] = 4;
3304 ["ColorCorrectionEffect"] = 90;
3305 ["ConeHandleAdornment"] = 54;
3306 ["Configuration"] = 58;
3307 ["ContentProvider"] = 72;
3308 ["ContextActionService"] = 41;
3309 ["CoreGui"] = 46;
3310 ["CoreScript"] = 18;
3311 ["CornerWedgePart"] = 1;
3312 ["CustomEvent"] = 4;
3313 ["CustomEventReceiver"] = 4;
3314 ["CylinderHandleAdornment"] = 54;
3315 ["CylinderMesh"] = 8;
3316 ["CylindricalConstraint"] = 89;
3317 ["Debris"] = 30;
3318 ["Decal"] = 7;
3319 ["Dialog"] = 62;
3320 ["DialogChoice"] = 63;
3321 ["DoubleConstrainedValue"] = 4;
3322 ["Explosion"] = 36;
3323 ["FileMesh"] = 8;
3324 ["Fire"] = 61;
3325 ["Flag"] = 38;
3326 ["FlagStand"] = 39;
3327 ["FloorWire"] = 4;
3328 ["Folder"] = 70;
3329 ["ForceField"] = 37;
3330 ["Frame"] = 48;
3331 ["GamePassService"] = 19;
3332 ["Glue"] = 34;
3333 ["GuiButton"] = 52;
3334 ["GuiMain"] = 47;
3335 ["GuiService"] = 47;
3336 ["Handles"] = 53;
3337 ["HapticService"] = 84;
3338 ["Hat"] = 45;
3339 ["HingeConstraint"] = 89;
3340 ["Hint"] = 33;
3341 ["HopperBin"] = 22;
3342 ["HttpService"] = 76;
3343 ["Humanoid"] = 9;
3344 ["ImageButton"] = 52;
3345 ["ImageLabel"] = 49;
3346 ["InsertService"] = 72;
3347 ["IntConstrainedValue"] = 4;
3348 ["IntValue"] = 4;
3349 ["JointInstance"] = 34;
3350 ["JointsService"] = 34;
3351 ["Keyframe"] = 60;
3352 ["KeyframeSequence"] = 60;
3353 ["KeyframeSequenceProvider"] = 60;
3354 ["Lighting"] = 13;
3355 ["LineHandleAdornment"] = 54;
3356 ["LocalScript"] = 18;
3357 ["LogService"] = 87;
3358 ["MarketplaceService"] = 46;
3359 ["Message"] = 33;
3360 ["Model"] = 2;
3361 ["ModuleScript"] = 71;
3362 ["Motor"] = 34;
3363 ["Motor6D"] = 34;
3364 ["MoveToConstraint"] = 89;
3365 ["NegateOperation"] = 78;
3366 ["NetworkClient"] = 16;
3367 ["NetworkReplicator"] = 29;
3368 ["NetworkServer"] = 15;
3369 ["NumberValue"] = 4;
3370 ["ObjectValue"] = 4;
3371 ["Pants"] = 44;
3372 ["ParallelRampPart"] = 1;
3373 ["Part"] = 1;
3374 ["ParticleEmitter"] = 69;
3375 ["PartPairLasso"] = 57;
3376 ["PathfindingService"] = 37;
3377 ["Platform"] = 35;
3378 ["Player"] = 12;
3379 ["PlayerGui"] = 46;
3380 ["Players"] = 21;
3381 ["PlayerScripts"] = 82;
3382 ["PointLight"] = 13;
3383 ["PointsService"] = 83;
3384 ["Pose"] = 60;
3385 ["PrismaticConstraint"] = 89;
3386 ["PrismPart"] = 1;
3387 ["PyramidPart"] = 1;
3388 ["RayValue"] = 4;
3389 ["ReflectionMetadata"] = 86;
3390 ["ReflectionMetadataCallbacks"] = 86;
3391 ["ReflectionMetadataClass"] = 86;
3392 ["ReflectionMetadataClasses"] = 86;
3393 ["ReflectionMetadataEnum"] = 86;
3394 ["ReflectionMetadataEnumItem"] = 86;
3395 ["ReflectionMetadataEnums"] = 86;
3396 ["ReflectionMetadataEvents"] = 86;
3397 ["ReflectionMetadataFunctions"] = 86;
3398 ["ReflectionMetadataMember"] = 86;
3399 ["ReflectionMetadataProperties"] = 86;
3400 ["ReflectionMetadataYieldFunctions"] = 86;
3401 ["RemoteEvent"] = 80;
3402 ["RemoteFunction"] = 79;
3403 ["ReplicatedFirst"] = 72;
3404 ["ReplicatedStorage"] = 72;
3405 ["RightAngleRampPart"] = 1;
3406 ["RocketPropulsion"] = 14;
3407 ["RodConstraint"] = 89;
3408 ["RopeConstraint"] = 89;
3409 ["Rotate"] = 34;
3410 ["RotateP"] = 34;
3411 ["RotateV"] = 34;
3412 ["RunService"] = 66;
3413 ["ScreenGui"] = 47;
3414 ["Script"] = 6;
3415 ["ScrollingFrame"] = 48;
3416 ["Seat"] = 35;
3417 ["Selection"] = 55;
3418 ["SelectionBox"] = 54;
3419 ["SelectionPartLasso"] = 57;
3420 ["SelectionPointLasso"] = 57;
3421 ["SelectionSphere"] = 54;
3422 ["ServerScriptService"] = 0;
3423 ["Shirt"] = 43;
3424 ["ShirtGraphic"] = 40;
3425 ["SkateboardPlatform"] = 35;
3426 ["Sky"] = 28;
3427 ["SlidingBallConstraint"] = 89;
3428 ["Smoke"] = 59;
3429 ["Snap"] = 34;
3430 ["Sound"] = 11;
3431 ["SoundService"] = 31;
3432 ["Sparkles"] = 42;
3433 ["SpawnLocation"] = 25;
3434 ["SpecialMesh"] = 8;
3435 ["SphereHandleAdornment"] = 54;
3436 ["SpotLight"] = 13;
3437 ["SpringConstraint"] = 89;
3438 ["StarterCharacterScripts"] = 82;
3439 ["StarterGear"] = 20;
3440 ["StarterGui"] = 46;
3441 ["StarterPack"] = 20;
3442 ["StarterPlayer"] = 88;
3443 ["StarterPlayerScripts"] = 82;
3444 ["Status"] = 2;
3445 ["StringValue"] = 4;
3446 ["SunRaysEffect"] = 90;
3447 ["SurfaceGui"] = 64;
3448 ["SurfaceLight"] = 13;
3449 ["SurfaceSelection"] = 55;
3450 ["Team"] = 24;
3451 ["Teams"] = 23;
3452 ["TeleportService"] = 81;
3453 ["Terrain"] = 65;
3454 ["TerrainRegion"] = 65;
3455 ["TestService"] = 68;
3456 ["TextBox"] = 51;
3457 ["TextButton"] = 51;
3458 ["TextLabel"] = 50;
3459 ["Texture"] = 10;
3460 ["TextureTrail"] = 4;
3461 ["Tool"] = 17;
3462 ["TouchTransmitter"] = 37;
3463 ["TrussPart"] = 1;
3464 ["UnionOperation"] = 77;
3465 ["UserInputService"] = 84;
3466 ["Vector3Value"] = 4;
3467 ["VehicleSeat"] = 35;
3468 ["VelocityMotor"] = 34;
3469 ["WedgePart"] = 1;
3470 ["Weld"] = 34;
3471 ["Workspace"] = 19;
3472}
3473
3474----------------------------------------------------------------
3475----------------------------------------------------------------
3476----------------------------------------------------------------
3477----------------------------------------------------------------
3478----------------------------------------------------------------
3479
3480function Create(ty,data)
3481 local obj
3482 if type(ty) == 'string' then
3483 obj = Instance.new(ty)
3484 else
3485 obj = ty
3486 end
3487 for k, v in pairs(data) do
3488 if type(k) == 'number' then
3489 v.Parent = obj
3490 else
3491 obj[k] = v
3492 end
3493 end
3494 return obj
3495end
3496
3497local barActive = false
3498local activeOptions = {}
3499
3500function createDDown(dBut, callback,...)
3501 if barActive then
3502 for i,v in pairs(activeOptions) do
3503 v:Destroy()
3504 end
3505 activeOptions = {}
3506 barActive = false
3507 return
3508 else
3509 barActive = true
3510 end
3511 local slots = {...}
3512 local base = dBut
3513 for i,v in pairs(slots) do
3514 local newOption = base:Clone()
3515 newOption.ZIndex = 5
3516 newOption.Name = "Option "..tostring(i)
3517 newOption.Parent = base.Parent.Parent.Parent
3518 newOption.BackgroundTransparency = 0
3519 newOption.ZIndex = 2
3520 table.insert(activeOptions,newOption)
3521 newOption.Position = UDim2.new(-0.4, dBut.Position.X.Offset, dBut.Position.Y.Scale, dBut.Position.Y.Offset + (#activeOptions * dBut.Size.Y.Offset))
3522 newOption.Text = slots[i]
3523 newOption.MouseButton1Down:connect(function()
3524 dBut.Text = slots[i]
3525 callback(slots[i])
3526 for i,v in pairs(activeOptions) do
3527 v:Destroy()
3528 end
3529 activeOptions = {}
3530 barActive = false
3531 end)
3532 end
3533end
3534
3535-- Connects a function to an event such that it fires asynchronously
3536function Connect(event,func)
3537 return event:connect(function(...)
3538 local a = {...}
3539 spawn(function() func(unpack(a)) end)
3540 end)
3541end
3542
3543-- returns the ascendant ScreenGui of an object
3544function GetScreen(screen)
3545 if screen == nil then return nil end
3546 while not screen:IsA("ScreenGui") do
3547 screen = screen.Parent
3548 if screen == nil then return nil end
3549 end
3550 return screen
3551end
3552
3553do
3554 local ZIndexLock = {}
3555 -- Sets the ZIndex of an object and its descendants. Objects are locked so
3556 -- that SetZIndexOnChanged doesn't spawn multiple threads that set the
3557 -- ZIndex of the same object.
3558 function SetZIndex(object,z)
3559 if not ZIndexLock[object] then
3560 ZIndexLock[object] = true
3561 if object:IsA'GuiObject' then
3562 object.ZIndex = z
3563 end
3564 local children = object:GetChildren()
3565 for i = 1,#children do
3566 SetZIndex(children[i],z)
3567 end
3568 ZIndexLock[object] = nil
3569 end
3570 end
3571
3572 function SetZIndexOnChanged(object)
3573 return object.Changed:connect(function(p)
3574 if p == "ZIndex" then
3575 SetZIndex(object,object.ZIndex)
3576 end
3577 end)
3578 end
3579end
3580
3581---- IconMap ----
3582-- Image size: 256px x 256px
3583-- Icon size: 16px x 16px
3584-- Padding between each icon: 2px
3585-- Padding around image edge: 1px
3586-- Total icons: 14 x 14 (196)
3587local Icon do
3588 local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
3589 game:GetService('ContentProvider'):Preload(iconMap)
3590 local iconDehash do
3591 -- 14 x 14, 0-based input, 0-based output
3592 local f=math.floor
3593 function iconDehash(h)
3594 return f(h/14%14),f(h%14)
3595 end
3596 end
3597
3598 function Icon(IconFrame,index,abc)
3599 local row,col = iconDehash(index)
3600 local mapSize = Vector2.new(256,256)
3601 local pad,border = 2,1
3602 local iconSize = 16
3603
3604 local class = 'Frame'
3605 if type(IconFrame) == 'string' then
3606 class = IconFrame
3607 IconFrame = nil
3608 end
3609
3610 if not IconFrame then
3611 IconFrame = Create(class,{
3612 Name = "Icon";
3613 BackgroundTransparency = 1;
3614 ClipsDescendants = true;
3615 Create('ImageLabel',{
3616 Name = "IconMap";
3617 Active = false;
3618 BackgroundTransparency = 1;
3619 Image = iconMap;
3620 Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
3621 });
3622 })
3623 end
3624 if IconFrame:IsA'GuiButton' then
3625 IconFrame.AutoButtonColor = not abc;
3626 end
3627 IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
3628 return IconFrame
3629 end
3630end
3631
3632----------------------------------------------------------------
3633----------------------------------------------------------------
3634----------------------------------------------------------------
3635----------------------------------------------------------------
3636---- ScrollBar
3637do
3638 -- AutoButtonColor doesn't always reset properly
3639 local function ResetButtonColor(button)
3640 local active = button.Active
3641 button.Active = not active
3642 button.Active = active
3643 end
3644
3645 local function ArrowGraphic(size,dir,scaled,template)
3646 local Frame = Create('Frame',{
3647 Name = "Arrow Graphic";
3648 BorderSizePixel = 0;
3649 Size = UDim2.new(0,size,0,size);
3650 Transparency = 1;
3651 })
3652 if not template then
3653 template = Instance.new("Frame")
3654 template.BorderSizePixel = 0
3655 end
3656
3657 template.BackgroundColor3 = Color3.new(1, 1, 1);
3658
3659 local transform
3660 if dir == nil or dir == 'Up' then
3661 function transform(p,s) return p,s end
3662 elseif dir == 'Down' then
3663 function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
3664 elseif dir == 'Left' then
3665 function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
3666 elseif dir == 'Right' then
3667 function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
3668 end
3669
3670 local scale
3671 if scaled then
3672 function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
3673 else
3674 function scale(p,s) return p,s end
3675 end
3676
3677 local o = math.floor(size/4)
3678 if size%2 == 0 then
3679 local n = size/2-1
3680 for i = 0,n do
3681 local t = template:Clone()
3682 local p,s = scale(transform(
3683 UDim2.new(0,n-i,0,o+i),
3684 UDim2.new(0,(i+1)*2,0,1)
3685 ))
3686 t.Position = p
3687 t.Size = s
3688 t.Parent = Frame
3689 end
3690 else
3691 local n = (size-1)/2
3692 for i = 0,n do
3693 local t = template:Clone()
3694 local p,s = scale(transform(
3695 UDim2.new(0,n-i,0,o+i),
3696 UDim2.new(0,i*2+1,0,1)
3697 ))
3698 t.Position = p
3699 t.Size = s
3700 t.Parent = Frame
3701 end
3702 end
3703 if size%4 > 1 then
3704 local t = template:Clone()
3705 local p,s = scale(transform(
3706 UDim2.new(0,0,0,size-o-1),
3707 UDim2.new(0,size,0,1)
3708 ))
3709 t.Position = p
3710 t.Size = s
3711 t.Parent = Frame
3712 end
3713
3714 for i,v in pairs(Frame:GetChildren()) do
3715 v.BackgroundColor3 = Color3.new(1, 1, 1);
3716 end
3717
3718 return Frame
3719 end
3720
3721
3722 local function GripGraphic(size,dir,spacing,scaled,template)
3723 local Frame = Create('Frame',{
3724 Name = "Grip Graphic";
3725 BorderSizePixel = 0;
3726 Size = UDim2.new(0,size.x,0,size.y);
3727 Transparency = 1;
3728 })
3729 if not template then
3730 template = Instance.new("Frame")
3731 template.BorderSizePixel = 0
3732 end
3733
3734 spacing = spacing or 2
3735
3736 local scale
3737 if scaled then
3738 function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
3739 else
3740 function scale(p) return p end
3741 end
3742
3743 if dir == 'Vertical' then
3744 for i=0,size.x-1,spacing do
3745 local t = template:Clone()
3746 t.Size = scale(UDim2.new(0,1,0,size.y))
3747 t.Position = scale(UDim2.new(0,i,0,0))
3748 t.Parent = Frame
3749 end
3750 elseif dir == nil or dir == 'Horizontal' then
3751 for i=0,size.y-1,spacing do
3752 local t = template:Clone()
3753 t.Size = scale(UDim2.new(0,size.x,0,1))
3754 t.Position = scale(UDim2.new(0,0,0,i))
3755 t.Parent = Frame
3756 end
3757 end
3758
3759 return Frame
3760 end
3761
3762 local mt = {
3763 __index = {
3764 GetScrollPercent = function(self)
3765 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
3766 end;
3767 CanScrollDown = function(self)
3768 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
3769 end;
3770 CanScrollUp = function(self)
3771 return self.ScrollIndex > 0
3772 end;
3773 ScrollDown = function(self)
3774 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
3775 self:Update()
3776 end;
3777 ScrollUp = function(self)
3778 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
3779 self:Update()
3780 end;
3781 ScrollTo = function(self,index)
3782 self.ScrollIndex = index
3783 self:Update()
3784 end;
3785 SetScrollPercent = function(self,percent)
3786 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
3787 self:Update()
3788 end;
3789 };
3790 }
3791 mt.__index.CanScrollRight = mt.__index.CanScrollDown
3792 mt.__index.CanScrollLeft = mt.__index.CanScrollUp
3793 mt.__index.ScrollLeft = mt.__index.ScrollUp
3794 mt.__index.ScrollRight = mt.__index.ScrollDown
3795
3796 local ScrollStyles = {
3797 Background = Color3.fromRGB(233, 233, 233);
3798 Border = Color3.fromRGB(149, 149, 149);
3799 Selected = Color3.fromRGB( 63, 119, 189);
3800 BorderSelected = Color3.fromRGB( 55, 106, 167);
3801 Text = Color3.fromRGB( 0, 0, 0);
3802 TextDisabled = Color3.fromRGB(128, 128, 128);
3803 TextSelected = Color3.fromRGB(255, 255, 255);
3804 Button = Color3.fromRGB( 35, 35, 35);
3805 ButtonBorder = Color3.fromRGB(149, 149, 149);
3806 ButtonSelected = Color3.fromRGB(255, 0, 0);
3807 Field = Color3.fromRGB(255, 255, 255);
3808 FieldBorder = Color3.fromRGB(191, 191, 191);
3809 TitleBackground = Color3.fromRGB(178, 178, 178);
3810 }
3811
3812 function ScrollBar(horizontal)
3813 -- create row scroll bar
3814 local ScrollBarWidth = GUI_SIZE;
3815 local ScrollFrame = Create('Frame',{
3816 Name = "ScrollFrame";
3817 Position = horizontal and UDim2.new(0,0,1,-ScrollBarWidth) or UDim2.new(1,-ScrollBarWidth,0,0);
3818 Size = horizontal and UDim2.new(1,0,0,ScrollBarWidth) or UDim2.new(0,ScrollBarWidth,1,0);
3819 BackgroundTransparency = 1;
3820 Create('ImageButton',{
3821 Name = "ScrollDown";
3822 Position = horizontal and UDim2.new(1,-ScrollBarWidth,0,0) or UDim2.new(0,0,1,-ScrollBarWidth);
3823 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
3824 BackgroundColor3 = ScrollStyles.Button;
3825 BorderColor3 = ScrollStyles.Border;
3826 BorderSizePixel = 0;
3827 });
3828 Create('ImageButton',{
3829 Name = "ScrollUp";
3830 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
3831 BackgroundColor3 = ScrollStyles.Button;
3832 BorderColor3 = ScrollStyles.Border;
3833 BorderSizePixel = 0;
3834 });
3835 Create('ImageButton',{
3836 Name = "ScrollBar";
3837 Size = horizontal and UDim2.new(1,-ScrollBarWidth*2,1,0) or UDim2.new(1,0,1,-ScrollBarWidth*2);
3838 Position = horizontal and UDim2.new(0,ScrollBarWidth,0,0) or UDim2.new(0,0,0,ScrollBarWidth);
3839 AutoButtonColor = false;
3840 BackgroundColor3 = Color3.fromRGB(20, 20, 20);
3841 BorderColor3 = ScrollStyles.Border;
3842 BorderSizePixel = 0;
3843 Create('ImageButton',{
3844 Name = "ScrollThumb";
3845 AutoButtonColor = false;
3846 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
3847 BackgroundColor3 = ScrollStyles.Button;
3848 BorderColor3 = ScrollStyles.Border;
3849 BorderSizePixel = 0;
3850 });
3851 });
3852 })
3853
3854 local graphicTemplate = Create('Frame',{
3855 Name="Graphic";
3856 BorderSizePixel = 0;
3857 BackgroundColor3 = Color3.new(1, 1, 1);
3858 })
3859 local graphicSize = GUI_SIZE/2
3860
3861 local ScrollDownFrame = ScrollFrame.ScrollDown
3862 local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
3863 ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
3864 ScrollDownGraphic.Parent = ScrollDownFrame
3865 local ScrollUpFrame = ScrollFrame.ScrollUp
3866 local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
3867 ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
3868 ScrollUpGraphic.Parent = ScrollUpFrame
3869 local ScrollBarFrame = ScrollFrame.ScrollBar
3870 local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
3871 do
3872 local size = GUI_SIZE*3/8
3873 local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
3874 Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
3875 Decal.Parent = ScrollThumbFrame
3876 end
3877
3878 local Class = setmetatable({
3879 GUI = ScrollFrame;
3880 ScrollIndex = 0;
3881 VisibleSpace = 0;
3882 TotalSpace = 0;
3883 PageIncrement = 1;
3884 },mt)
3885
3886 local UpdateScrollThumb
3887 if horizontal then
3888 function UpdateScrollThumb()
3889 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,GUI_SIZE)
3890 if ScrollThumbFrame.AbsoluteSize.x < GUI_SIZE then
3891 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
3892 end
3893 local barSize = ScrollBarFrame.AbsoluteSize.x
3894 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
3895 end
3896 else
3897 function UpdateScrollThumb()
3898 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,Class.VisibleSpace/Class.TotalSpace,0)
3899 if ScrollThumbFrame.AbsoluteSize.y < GUI_SIZE then
3900 ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
3901 end
3902 local barSize = ScrollBarFrame.AbsoluteSize.y
3903 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
3904 end
3905 end
3906
3907 local lastDown
3908 local lastUp
3909 local scrollStyle = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0}
3910 local scrollStyle_ds = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0.7}
3911
3912 local function Update()
3913 local t = Class.TotalSpace
3914 local v = Class.VisibleSpace
3915 local s = Class.ScrollIndex
3916 if v <= t then
3917 if s > 0 then
3918 if s + v > t then
3919 Class.ScrollIndex = t - v
3920 end
3921 else
3922 Class.ScrollIndex = 0
3923 end
3924 else
3925 Class.ScrollIndex = 0
3926 end
3927
3928 if Class.UpdateCallback then
3929 if Class.UpdateCallback(Class) == false then
3930 return
3931 end
3932 end
3933
3934 local down = Class:CanScrollDown()
3935 local up = Class:CanScrollUp()
3936 if down ~= lastDown then
3937 lastDown = down
3938 ScrollDownFrame.Active = down
3939 ScrollDownFrame.AutoButtonColor = down
3940 local children = ScrollDownGraphic:GetChildren()
3941 local style = down and scrollStyle or scrollStyle_ds
3942 for i = 1,#children do
3943 Create(children[i],style)
3944 end
3945 end
3946 if up ~= lastUp then
3947 lastUp = up
3948 ScrollUpFrame.Active = up
3949 ScrollUpFrame.AutoButtonColor = up
3950 local children = ScrollUpGraphic:GetChildren()
3951 local style = up and scrollStyle or scrollStyle_ds
3952 for i = 1,#children do
3953 Create(children[i],style)
3954 end
3955 end
3956 ScrollThumbFrame.Visible = down or up
3957 UpdateScrollThumb()
3958 end
3959 Class.Update = Update
3960
3961 SetZIndexOnChanged(ScrollFrame)
3962
3963 local MouseDrag = Create('ImageButton',{
3964 Name = "MouseDrag";
3965 Position = UDim2.new(-0.25,0,-0.25,0);
3966 Size = UDim2.new(1.5,0,1.5,0);
3967 Transparency = 1;
3968 AutoButtonColor = false;
3969 Active = true;
3970 ZIndex = 10;
3971 })
3972
3973 local scrollEventID = 0
3974 ScrollDownFrame.MouseButton1Down:connect(function()
3975 scrollEventID = tick()
3976 local current = scrollEventID
3977 local up_con
3978 up_con = MouseDrag.MouseButton1Up:connect(function()
3979 scrollEventID = tick()
3980 MouseDrag.Parent = nil
3981 ResetButtonColor(ScrollDownFrame)
3982 up_con:disconnect(); drag = nil
3983 end)
3984 MouseDrag.Parent = GetScreen(ScrollFrame)
3985 Class:ScrollDown()
3986 wait(0.2) -- delay before auto scroll
3987 while scrollEventID == current do
3988 Class:ScrollDown()
3989 if not Class:CanScrollDown() then break end
3990 wait()
3991 end
3992 end)
3993
3994 ScrollDownFrame.MouseButton1Up:connect(function()
3995 scrollEventID = tick()
3996 end)
3997
3998 ScrollUpFrame.MouseButton1Down:connect(function()
3999 scrollEventID = tick()
4000 local current = scrollEventID
4001 local up_con
4002 up_con = MouseDrag.MouseButton1Up:connect(function()
4003 scrollEventID = tick()
4004 MouseDrag.Parent = nil
4005 ResetButtonColor(ScrollUpFrame)
4006 up_con:disconnect(); drag = nil
4007 end)
4008 MouseDrag.Parent = GetScreen(ScrollFrame)
4009 Class:ScrollUp()
4010 wait(0.2)
4011 while scrollEventID == current do
4012 Class:ScrollUp()
4013 if not Class:CanScrollUp() then break end
4014 wait()
4015 end
4016 end)
4017
4018 ScrollUpFrame.MouseButton1Up:connect(function()
4019 scrollEventID = tick()
4020 end)
4021
4022 if horizontal then
4023 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
4024 scrollEventID = tick()
4025 local current = scrollEventID
4026 local up_con
4027 up_con = MouseDrag.MouseButton1Up:connect(function()
4028 scrollEventID = tick()
4029 MouseDrag.Parent = nil
4030 ResetButtonColor(ScrollUpFrame)
4031 up_con:disconnect(); drag = nil
4032 end)
4033 MouseDrag.Parent = GetScreen(ScrollFrame)
4034 if x > ScrollThumbFrame.AbsolutePosition.x then
4035 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
4036 wait(0.2)
4037 while scrollEventID == current do
4038 if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
4039 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
4040 wait()
4041 end
4042 else
4043 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
4044 wait(0.2)
4045 while scrollEventID == current do
4046 if x > ScrollThumbFrame.AbsolutePosition.x then break end
4047 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
4048 wait()
4049 end
4050 end
4051 end)
4052 else
4053 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
4054 scrollEventID = tick()
4055 local current = scrollEventID
4056 local up_con
4057 up_con = MouseDrag.MouseButton1Up:connect(function()
4058 scrollEventID = tick()
4059 MouseDrag.Parent = nil
4060 ResetButtonColor(ScrollUpFrame)
4061 up_con:disconnect(); drag = nil
4062 end)
4063 MouseDrag.Parent = GetScreen(ScrollFrame)
4064 if y > ScrollThumbFrame.AbsolutePosition.y then
4065 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
4066 wait(0.2)
4067 while scrollEventID == current do
4068 if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
4069 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
4070 wait()
4071 end
4072 else
4073 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
4074 wait(0.2)
4075 while scrollEventID == current do
4076 if y > ScrollThumbFrame.AbsolutePosition.y then break end
4077 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
4078 wait()
4079 end
4080 end
4081 end)
4082 end
4083
4084 if horizontal then
4085 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
4086 scrollEventID = tick()
4087 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
4088 local drag_con
4089 local up_con
4090 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
4091 if not UserInputService:IsMouseButtonPressed'MouseButton1' then
4092 scrollEventID = tick()
4093 MouseDrag.Parent = nil
4094 ResetButtonColor(ScrollThumbFrame)
4095 drag_con:disconnect(); drag_con = nil
4096 up_con:disconnect(); drag = nil
4097 end
4098 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
4099 local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
4100 local bar_abs_one = bar_abs_pos + bar_drag
4101 x = x - mouse_offset
4102 x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
4103 x = x - bar_abs_pos
4104 Class:SetScrollPercent(x/(bar_drag))
4105 end)
4106 up_con = MouseDrag.MouseButton1Up:connect(function()
4107 scrollEventID = tick()
4108 MouseDrag.Parent = nil
4109 ResetButtonColor(ScrollThumbFrame)
4110 drag_con:disconnect(); drag_con = nil
4111 up_con:disconnect(); drag = nil
4112 end)
4113 MouseDrag.Parent = GetScreen(ScrollFrame)
4114 end)
4115 else
4116 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
4117 scrollEventID = tick()
4118 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
4119 local drag_con
4120 local up_con
4121 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
4122 if not UserInputService:IsMouseButtonPressed'MouseButton1' then
4123 scrollEventID = tick()
4124 MouseDrag.Parent = nil
4125 ResetButtonColor(ScrollThumbFrame)
4126 drag_con:disconnect(); drag_con = nil
4127 up_con:disconnect(); drag = nil
4128 end
4129 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
4130 local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
4131 local bar_abs_one = bar_abs_pos + bar_drag
4132 y = y - mouse_offset
4133 y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
4134 y = y - bar_abs_pos
4135 Class:SetScrollPercent(y/(bar_drag))
4136 end)
4137 up_con = MouseDrag.MouseButton1Up:connect(function()
4138 scrollEventID = tick()
4139 MouseDrag.Parent = nil
4140 ResetButtonColor(ScrollThumbFrame)
4141 drag_con:disconnect(); drag_con = nil
4142 up_con:disconnect(); drag = nil
4143 end)
4144 MouseDrag.Parent = GetScreen(ScrollFrame)
4145 end)
4146 end
4147
4148 function Class:Destroy()
4149 ScrollFrame:Destroy()
4150 MouseDrag:Destroy()
4151 for k in pairs(Class) do
4152 Class[k] = nil
4153 end
4154 setmetatable(Class,nil)
4155 end
4156
4157 Update()
4158
4159 return Class
4160 end
4161end
4162
4163----------------------------------------------------------------
4164----------------------------------------------------------------
4165----------------------------------------------------------------
4166----------------------------------------------------------------
4167---- Explorer panel
4168
4169local explorerPanel = D_E_X.ExplorerPanel
4170Create(explorerPanel,{
4171 BackgroundColor3 = GuiColor.Field;
4172 BorderColor3 = GuiColor.Border;
4173 Active = true;
4174})
4175
4176local SettingsRemote = explorerPanel.Parent:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")
4177local GetApiRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetApi")
4178local GetAwaitRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetAwaiting")
4179local bindSetAwaiting = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("SetAwaiting")
4180
4181local SaveInstanceWindow = explorerPanel.Parent:WaitForChild("SaveInstance")
4182local ConfirmationWindow = explorerPanel.Parent:WaitForChild("Confirmation")
4183local CautionWindow = explorerPanel.Parent:WaitForChild("Caution")
4184local TableCautionWindow = explorerPanel.Parent:WaitForChild("TableCaution")
4185
4186local RemoteWindow = explorerPanel.Parent:WaitForChild("CallRemote")
4187
4188local ScriptEditor = explorerPanel.Parent:WaitForChild("ScriptEditor")
4189local ScriptEditorEvent = ScriptEditor:WaitForChild("OpenScript")
4190
4191local CurrentSaveInstanceWindow
4192local CurrentRemoteWindow
4193
4194local lastSelectedNode
4195
4196local DexStorage
4197local DexStorageMain
4198local DexStorageEnabled
4199
4200if saveinstance then DexStorageEnabled = true end
4201
4202if DexStorageEnabled then
4203 DexStorage = Instance.new("Folder")
4204 DexStorage.Name = "Dex"
4205 DexStorageMain = Instance.new("Folder", DexStorage)
4206 DexStorageMain.Name = "DexStorage"
4207end
4208
4209local RunningScriptsStorage
4210local RunningScriptsStorageMain
4211local RunningScriptsStorageEnabled
4212
4213if getscripts then RunningScriptsStorageEnabled = true end
4214
4215if RunningScriptsStorageEnabled then
4216 RunningScriptsStorage = Instance.new("Folder")
4217 RunningScriptsStorage.Name = "Dex Internal Storage"
4218 RunningScriptsStorageMain = Instance.new("Folder", RunningScriptsStorage)
4219 RunningScriptsStorageMain.Name = "Running Scripts"
4220end
4221
4222local UpvalueStorage
4223local UpvalueStorageVariables
4224local UpvalueStorageFunctions
4225local UpvalueStorageEnabled
4226
4227if vars and funcs then UpvalueStorageEnabled = true end
4228
4229if UpvalueStorageEnabled then
4230 UpvalueStorage = Instance.new('Folder')
4231 UpvalueStorage.Name = 'Upvalue Storage'
4232 UpvalueStorageVariables = Instance.new("Folder", UpvalueStorage)
4233 UpvalueStorageVariables.Name = "Upvalue Variables"
4234 UpvalueStorageFunctions = Instance.new("Folder", UpvalueStorage)
4235 UpvalueStorageFunctions.Name = "Upvalue Functions"
4236 for i, v in pairs(vars) do
4237 pcall(function()
4238 local n = Instance.new('StringValue', UpvalueStorageVariables)
4239 n.Name = tostring(i);
4240 n.Value = tostring(v);
4241 end)
4242 end
4243 for i, v in pairs(funcs) do
4244 pcall(function()
4245 local n = Instance.new('StringValue', UpvalueStorageFunctions)
4246 n.Name = tostring(i);
4247 n.Value = tostring(v);
4248 end)
4249 end
4250end
4251
4252local listFrame = Create('Frame',{
4253 Name = "List";
4254 BackgroundTransparency = 1;
4255 ClipsDescendants = true;
4256 Position = UDim2.new(0,0,0,HEADER_SIZE);
4257 Size = UDim2.new(1,-GUI_SIZE,1,-HEADER_SIZE);
4258 Parent = explorerPanel;
4259})
4260
4261local scrollBar = ScrollBar(false)
4262scrollBar.PageIncrement = 1
4263Create(scrollBar.GUI,{
4264 Position = UDim2.new(1,-GUI_SIZE,0,HEADER_SIZE);
4265 Size = UDim2.new(0,GUI_SIZE,1,-HEADER_SIZE);
4266 Parent = explorerPanel;
4267})
4268
4269local scrollBarH = ScrollBar(true)
4270scrollBarH.PageIncrement = GUI_SIZE
4271Create(scrollBarH.GUI,{
4272 Position = UDim2.new(0,0,1,-GUI_SIZE);
4273 Size = UDim2.new(1,-GUI_SIZE,0,GUI_SIZE);
4274 Visible = false;
4275 Parent = explorerPanel;
4276})
4277
4278local headerFrame = Create('Frame',{
4279 Name = "Header";
4280 BackgroundColor3 = GuiColor.Background;
4281 BorderColor3 = GuiColor.Border;
4282 Position = UDim2.new(0,0,0,0);
4283 Size = UDim2.new(1,0,0,HEADER_SIZE);
4284 Parent = explorerPanel;
4285 Create('TextLabel',{
4286 Text = "Explorer";
4287 BackgroundTransparency = 1;
4288 TextColor3 = GuiColor.Text;
4289 TextXAlignment = 'Left';
4290 Font = FONT;
4291 FontSize = FONT_SIZE;
4292 Position = UDim2.new(0,4,0,0);
4293 Size = UDim2.new(1,-4,0.5,0);
4294 });
4295})
4296
4297local explorerFilter = Create('TextBox',{
4298 Text = "Filter Workspace";
4299 BackgroundTransparency = 0.8;
4300 TextColor3 = GuiColor.Text;
4301 TextXAlignment = 'Left';
4302 Font = FONT;
4303 FontSize = FONT_SIZE;
4304 Position = UDim2.new(0,4,0.5,0);
4305 Size = UDim2.new(1,-8,0.5,-2);
4306});
4307explorerFilter.Parent = headerFrame
4308
4309SetZIndexOnChanged(explorerPanel)
4310
4311local function CreateColor3(r, g, b) return Color3.new(r/255,g/255,b/255) end
4312
4313local Styles = {
4314 Font = Enum.Font.Arial;
4315 Margin = 5;
4316 Black = CreateColor3(0,0,0);
4317 White = CreateColor3(32,32,32);
4318}
4319
4320local Row = {
4321 Font = Styles.Font;
4322 FontSize = Enum.FontSize.Size14;
4323 TextXAlignment = Enum.TextXAlignment.Left;
4324 TextColor = Styles.Black;
4325 TextColorOver = Styles.White;
4326 TextLockedColor = CreateColor3(155,155,155);
4327 Height = 24;
4328 BorderColor = CreateColor3(216/4,216/4,216/4);
4329 BackgroundColor = Styles.White;
4330 BackgroundColorAlternate = CreateColor3(32, 32, 32);
4331 BackgroundColorMouseover = CreateColor3(40, 40, 40);
4332 TitleMarginLeft = 15;
4333}
4334
4335local DropDown = {
4336 Font = Styles.Font;
4337 FontSize = Enum.FontSize.Size14;
4338 TextColor = CreateColor3(255,255,255);
4339 TextColorOver = Color3.new(1, 1, 1);
4340 TextXAlignment = Enum.TextXAlignment.Left;
4341 Height = 16;
4342 BackColor = Styles.White;
4343 BackColorOver = CreateColor3(0, 170, 255);
4344 BorderColor = CreateColor3(45,45,45);
4345 BorderSizePixel = 2;
4346 ArrowColor = CreateColor3(160/2,160/2,160/2);
4347 ArrowColorOver = Styles.Black;
4348}
4349
4350local currentRightClickMenu
4351local CurrentInsertObjectWindow
4352local CurrentFunctionCallerWindow
4353
4354local RbxApi
4355
4356function ClassCanCreate(IName)
4357 local success,err = pcall(function() Instance.new(IName) end)
4358 if err then
4359 return false
4360 else
4361 return true
4362 end
4363end
4364
4365function GetClasses()
4366 if RbxApi == nil then return {} end
4367 local classTable = {}
4368 for i,v in pairs(RbxApi.Classes) do
4369 if ClassCanCreate(v.Name) then
4370 table.insert(classTable,v.Name)
4371 end
4372 end
4373 return classTable
4374end
4375
4376local function sortAlphabetic(t, property)
4377 table.sort(t,
4378 function(x,y) return x[property] < y[property]
4379 end)
4380end
4381
4382local function FunctionIsHidden(functionData)
4383 local tags = functionData["tags"]
4384 for _,name in pairs(tags) do
4385 if name == "deprecated"
4386 or name == "hidden"
4387 or name == "writeonly" then
4388 return true
4389 end
4390 end
4391 return false
4392end
4393
4394local function GetAllFunctions(className)
4395 local class = RbxApi.Classes[className]
4396 local functions = {}
4397
4398 if not class then return functions end
4399
4400 while class do
4401 if class.Name == "Instance" then break end
4402 for _,nextFunction in pairs(class.Functions) do
4403 if not FunctionIsHidden(nextFunction) then
4404 table.insert(functions, nextFunction)
4405 end
4406 end
4407 class = RbxApi.Classes[class.Superclass]
4408 end
4409
4410 sortAlphabetic(functions, "Name")
4411
4412 return functions
4413end
4414
4415function GetFunctions()
4416 if RbxApi == nil then return {} end
4417 local List = SelectionVar():Get()
4418
4419 if #List == 0 then return end
4420
4421 local MyObject = List[1]
4422
4423 local functionTable = {}
4424 for i,v in pairs(GetAllFunctions(MyObject.ClassName)) do
4425 table.insert(functionTable,v)
4426 end
4427 return functionTable
4428end
4429
4430function CreateInsertObjectMenu(choices, currentChoice, readOnly, onClick)
4431 local mouse = game:GetService("Players").LocalPlayer:GetMouse()
4432 local totalSize = explorerPanel.Parent.AbsoluteSize.y
4433 if #choices == 0 then return end
4434
4435 table.sort(choices, function(a,b) return a < b end)
4436
4437 local frame = Instance.new("Frame")
4438 frame.Name = "InsertObject"
4439 frame.Size = UDim2.new(0, 200, 1, 0)
4440 frame.BackgroundTransparency = 1
4441 frame.Active = true
4442 local closeCon;
4443 local menu;
4444 local arrow;
4445 local expanded = false
4446 local margin = DropDown.BorderSizePixel;
4447
4448 --[[
4449 local button = Instance.new("TextButton")
4450 button.Font = Row.Font
4451 button.FontSize = Row.FontSize
4452 button.TextXAlignment = Row.TextXAlignment
4453 button.BackgroundTransparency = 1
4454 button.TextColor3 = Row.TextColor
4455 if readOnly then
4456 button.TextColor3 = Row.TextLockedColor
4457 end
4458 button.Text = currentChoice
4459 button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
4460 button.Position = UDim2.new(0, Styles.Margin, 0, 0)
4461 button.Parent = frame
4462 --]]
4463
4464 local function hideMenu()
4465 expanded = false
4466 --showArrow(DropDown.ArrowColor)
4467 if frame then
4468 --frame:Destroy()
4469 CurrentInsertObjectWindow.Visible = false
4470 end
4471 if closeCon then
4472 closeCon:Disconnect()
4473 closeCon = nil;
4474 end
4475 end
4476
4477 local function showMenu()
4478 expanded = true
4479 menu = Instance.new("ScrollingFrame")
4480 menu.Size = UDim2.new(0,200,1,0)
4481 menu.CanvasSize = UDim2.new(0, 200, 0, #choices * DropDown.Height)
4482 menu.Position = UDim2.new(0, margin, 0, 0)
4483 menu.BackgroundTransparency = 0
4484 menu.BackgroundColor3 = DropDown.BackColor
4485 menu.BorderColor3 = DropDown.BorderColor
4486 menu.BorderSizePixel = DropDown.BorderSizePixel
4487 menu.TopImage = "rbxasset://textures/blackBkg_square.png"
4488 menu.MidImage = "rbxasset://textures/blackBkg_square.png"
4489 menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
4490 menu.Active = true
4491 menu.ZIndex = 5
4492 menu.Parent = frame
4493
4494 --local parentFrameHeight = script.Parent.List.Size.Y.Offset
4495 --local rowHeight = mouse.Y
4496 --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
4497 -- menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
4498 --end
4499
4500 local function choice(name)
4501 onClick(name)
4502 hideMenu()
4503 end
4504
4505 for i,name in pairs(choices) do
4506 local option = CreateRightClickMenuItem(name, function()
4507 choice(name)
4508 end,1)
4509 option.Size = UDim2.new(1, 0, 0, 20)
4510 option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
4511 option.ZIndex = menu.ZIndex
4512 option.Parent = menu
4513 end
4514
4515 local function isInGui(frame)
4516 local mloc = UserInputService:GetMouseLocation();
4517 local mouse = Vector2.new(mloc.X, mloc.Y - 36);
4518
4519 local x1, x2 = frame.AbsolutePosition.X, frame.AbsolutePosition.X + frame.AbsoluteSize.X;
4520 local y1, y2 = frame.AbsolutePosition.Y, frame.AbsolutePosition.Y + frame.AbsoluteSize.Y;
4521
4522 return (mouse.X >= x1 and mouse.X <= x2) and (mouse.Y >= y1 and mouse.Y <= y2)
4523 end
4524
4525 closeCon = UserInputService.InputBegan:connect(function(m)
4526 if m.UserInputType == Enum.UserInputType.MouseButton1 then
4527 if menu and (not isInGui(menu)) then
4528 hideMenu()
4529 end
4530 end
4531 end)
4532 end
4533
4534
4535 showMenu()
4536
4537
4538 return frame
4539end
4540
4541function CreateFunctionCallerMenu(choices, currentChoice, readOnly, onClick)
4542 local mouse = game:GetService'Players'.LocalPlayer:GetMouse()
4543 local totalSize = explorerPanel.Parent.AbsoluteSize.y
4544 if #choices == 0 then return end
4545
4546 table.sort(choices, function(a,b) return a.Name < b.Name end)
4547
4548 local frame = Instance.new("Frame")
4549 frame.Name = "InsertObject"
4550 frame.Size = UDim2.new(0, 200, 1, 0)
4551 frame.BackgroundTransparency = 1
4552 frame.Active = true
4553
4554 local menu = nil
4555 local arrow = nil
4556 local expanded = false
4557 local margin = DropDown.BorderSizePixel;
4558
4559 local function hideMenu()
4560 expanded = false
4561 --showArrow(DropDown.ArrowColor)
4562 if frame then
4563 --frame:Destroy()
4564 CurrentInsertObjectWindow.Visible = false
4565 end
4566 end
4567
4568 local function showMenu()
4569 expanded = true
4570 menu = Instance.new("ScrollingFrame")
4571 menu.Size = UDim2.new(0,300,1,0)
4572 menu.CanvasSize = UDim2.new(0, 300, 0, #choices * DropDown.Height)
4573 menu.Position = UDim2.new(0, margin, 0, 0)
4574 menu.BackgroundTransparency = 0
4575 menu.BackgroundColor3 = DropDown.BackColor
4576 menu.BorderColor3 = DropDown.BorderColor
4577 menu.BorderSizePixel = DropDown.BorderSizePixel
4578 menu.TopImage = "rbxasset://textures/blackBkg_square.png"
4579 menu.MidImage = "rbxasset://textures/blackBkg_square.png"
4580 menu.BottomImage = "rbxasset://textures/blackBkg_square.png"
4581 menu.Active = true
4582 menu.ZIndex = 5
4583 menu.Parent = frame
4584
4585 --local parentFrameHeight = script.Parent.List.Size.Y.Offset
4586 --local rowHeight = mouse.Y
4587 --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
4588 -- menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
4589 --end
4590
4591 local function GetParameters(functionData)
4592 local paraString = ""
4593 paraString = paraString.."("
4594 for i,v in pairs(functionData.Arguments) do
4595 paraString = paraString..v.Type.." "..v.Name
4596 if i < #functionData.Arguments then
4597 paraString = paraString..", "
4598 end
4599 end
4600 paraString = paraString..")"
4601 return paraString
4602 end
4603
4604 local function choice(name)
4605 onClick(name)
4606 hideMenu()
4607 end
4608
4609 for i,name in pairs(choices) do
4610 local option = CreateRightClickMenuItem(name.ReturnType.." "..name.Name..GetParameters(name), function()
4611 choice(name)
4612 end,2)
4613 option.Size = UDim2.new(1, 0, 0, 20)
4614 option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
4615 option.ZIndex = menu.ZIndex
4616 option.Parent = menu
4617 end
4618 end
4619
4620
4621 showMenu()
4622
4623
4624 return frame
4625end
4626
4627function CreateInsertObject()
4628 if not CurrentInsertObjectWindow then return end
4629 CurrentInsertObjectWindow.Visible = true
4630 if currentRightClickMenu and CurrentInsertObjectWindow.Visible then
4631 CurrentInsertObjectWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset-2,0,0)
4632 end
4633 if CurrentInsertObjectWindow.Visible then
4634 CurrentInsertObjectWindow.Parent = explorerPanel.Parent
4635 end
4636end
4637
4638function CreateFunctionCaller()
4639 if CurrentFunctionCallerWindow then
4640 CurrentFunctionCallerWindow:Destroy()
4641 CurrentFunctionCallerWindow = nil
4642 end
4643 CurrentFunctionCallerWindow = CreateFunctionCallerMenu(
4644 GetFunctions(),
4645 "",
4646 false,
4647 function(option)
4648 CurrentFunctionCallerWindow:Destroy()
4649 CurrentFunctionCallerWindow = nil
4650 local list = SelectionVar():Get()
4651 for i = 1,#list do
4652 pcall(function() Instance.new(option,list[i]) end)
4653 end
4654 -- print(option.Name .. " selected to be called. Function caller being added soon, please wait!")
4655 --CallFunction()
4656 DestroyRightClick()
4657 end
4658 )
4659 if currentRightClickMenu and CurrentFunctionCallerWindow then
4660 CurrentFunctionCallerWindow.Position = UDim2.new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset*1.5-2,0,0)
4661 end
4662 if CurrentFunctionCallerWindow then
4663 CurrentFunctionCallerWindow.Parent = explorerPanel.Parent
4664 end
4665end
4666
4667
4668function GetMouseLocation()
4669 return UserInputService:GetMouseLocation() - Vector2.new(0, 36);
4670end
4671
4672function MouseHoveringOver(GuiObject)
4673 local MLocation = GetMouseLocation();
4674
4675 return (MLocation.x >= GuiObject.AbsolutePosition.X and MLocation.x <= (GuiObject.AbsolutePosition.X + GuiObject.AbsoluteSize.X)) and (MLocation.y >= GuiObject.AbsolutePosition.Y and MLocation.y <= (GuiObject.AbsolutePosition.Y + GuiObject.AbsoluteSize.Y));
4676end
4677
4678function CreateRightClickMenuItem(text, onClick, insObj)
4679 local button = Instance.new("TextButton")
4680 button.Font = DropDown.Font
4681 button.FontSize = DropDown.FontSize
4682 button.TextColor3 = DropDown.TextColor
4683 button.TextXAlignment = DropDown.TextXAlignment
4684 button.BackgroundColor3 = DropDown.BackColor
4685 button.AutoButtonColor = false
4686 button.BorderSizePixel = 0
4687 button.Active = true
4688 button.Text = text
4689 button.Transparency = 1
4690 if insObj == 1 then
4691 local newIcon = Icon(nil,ExplorerIndex[text] or 0)
4692 newIcon.Position = UDim2.new(0,0,0,2)
4693 newIcon.Size = UDim2.new(0,16,0,16)
4694 newIcon.IconMap.ZIndex = 5
4695 newIcon.Parent = button
4696 button.Text = "\t\t"..button.Text
4697 elseif insObj == 2 then
4698 button.FontSize = Enum.FontSize.Size11
4699 end
4700
4701 --[[spawn(function()
4702 while button.Parent ~= nil and button.Parent.Parent ~= nil do
4703 game:service'RunService'.Stepped:wait();
4704 if not MouseHoveringOver(button) then
4705 button.TextColor3 = DropDown.TextColor
4706 button.BackgroundColor3 = DropDown.BackColor
4707 end
4708 end
4709 end)]]
4710
4711 button.MouseEnter:connect(function()
4712 TweenService:Create(button, TweenInfo.new(0.1), {TextColor3 = DropDown.TextColorOver, BackgroundColor3 = DropDown.BackColorOver}):Play()
4713 if not insObj and CurrentInsertObjectWindow then
4714 if CurrentInsertObjectWindow.Visible == false and button.Text == "Insert Object" then
4715 CreateInsertObject()
4716 elseif CurrentInsertObjectWindow.Visible and button.Text ~= "Insert Object" then
4717 CurrentInsertObjectWindow.Visible = false
4718 end
4719 end
4720 if not insObj then
4721 if CurrentFunctionCallerWindow and button.Text ~= "Call Function" then
4722 CurrentFunctionCallerWindow:Destroy()
4723 CurrentFunctionCallerWindow = nil
4724 elseif button.Text == "Call Function" then
4725 CreateFunctionCaller()
4726 end
4727 end
4728 end)
4729 button.MouseLeave:connect(function()
4730 TweenService:Create(button, TweenInfo.new(0.1), {TextColor3 = DropDown.TextColor, BackgroundColor3 = DropDown.BackColor}):Play()
4731 end)
4732 button.MouseButton1Click:connect(function()
4733 TweenService:Create(button, TweenInfo.new(0.1), {TextColor3 = DropDown.TextColor, BackgroundColor3 = DropDown.BackColor}):Play()
4734 onClick(text)
4735 end)
4736 return button
4737end
4738
4739function CreateRightClickMenu(choices, currentChoice, readOnly, onClick)
4740 local mouse = game:GetService'Players'.LocalPlayer:GetMouse()
4741
4742 local frame = Instance.new("Frame")
4743 frame.Name = "DropDown"
4744 frame.Size = UDim2.new(0, 200, 1, 0)
4745 frame.BackgroundTransparency = 1
4746 frame.Active = true
4747 local closeCons;
4748 local menu = nil
4749 local arrow = nil
4750 local expanded = false
4751 local margin = DropDown.BorderSizePixel;
4752
4753 --[[
4754 local button = Instance.new("TextButton")
4755 button.Font = Row.Font
4756 button.FontSize = Row.FontSize
4757 button.TextXAlignment = Row.TextXAlignment
4758 button.BackgroundTransparency = 1
4759 button.TextColor3 = Row.TextColor
4760 if readOnly then
4761 button.TextColor3 = Row.TextLockedColor
4762 end
4763 button.Text = currentChoice
4764 button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
4765 button.Position = UDim2.new(0, Styles.Margin, 0, 0)
4766 button.Parent = frame
4767 --]]
4768
4769 local function hideMenu()
4770 expanded = false
4771 --showArrow(DropDown.ArrowColor)
4772 if frame then
4773 frame:Destroy()
4774 DestroyRightClick()
4775 end
4776 if closeCons then
4777 closeCons:Disconnect()
4778 closeCons = nil;
4779 end
4780 end
4781
4782 local function showMenu()
4783 expanded = true
4784 menu = Instance.new("Frame")
4785 menu.Size = UDim2.new(0, 200, 0, #choices * DropDown.Height)
4786 menu.Position = UDim2.new(0, margin, 0, 5)
4787 menu.BackgroundTransparency = 0
4788 menu.BackgroundColor3 = DropDown.BackColor
4789 menu.BorderColor3 = DropDown.BorderColor
4790 menu.BorderSizePixel = DropDown.BorderSizePixel
4791 menu.Active = true
4792 menu.ZIndex = 5
4793 menu.Parent = frame
4794
4795 --local parentFrameHeight = script.Parent.List.Size.Y.Offset
4796 --local rowHeight = mouse.Y
4797 --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then
4798 -- menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
4799 --end
4800
4801 local function choice(name)
4802 onClick(name)
4803 hideMenu()
4804 end
4805
4806 for i,name in pairs(choices) do
4807 local option = CreateRightClickMenuItem(name, function()
4808 choice(name)
4809 end)
4810 option.Size = UDim2.new(1, 0, 0, 16)
4811 option.Position = UDim2.new(0, 0, 0, (i-1) * DropDown.Height)
4812 option.ZIndex = menu.ZIndex
4813 option.Parent = menu
4814 TweenService:Create(option, TweenInfo.new(0.1), {Transparency = 0.2}):Play()
4815 end
4816 local function isInGui(frame)
4817 local mloc = UserInputService:GetMouseLocation();
4818 local mouse = Vector2.new(mloc.X, mloc.Y - 36);
4819
4820 local x1, x2 = frame.AbsolutePosition.X, frame.AbsolutePosition.X + frame.AbsoluteSize.X;
4821 local y1, y2 = frame.AbsolutePosition.Y, frame.AbsolutePosition.Y + frame.AbsoluteSize.Y;
4822
4823 return (mouse.X >= x1 and mouse.X <= x2) and (mouse.Y >= y1 and mouse.Y <= y2)
4824 end
4825
4826 closeCons = UserInputService.InputBegan:connect(function(m)
4827 if m.UserInputType == Enum.UserInputType.MouseButton1 then
4828 if menu and (not isInGui(menu)) then
4829 hideMenu()
4830 end
4831 end
4832 end)
4833 end
4834
4835
4836 showMenu()
4837
4838
4839 return frame
4840end
4841
4842function checkMouseInGui(gui)
4843 if gui == nil then return false end
4844 local plrMouse = game:GetService'Players'.LocalPlayer:GetMouse()
4845 local guiPosition = gui.AbsolutePosition
4846 local guiSize = gui.AbsoluteSize
4847
4848 if plrMouse.X >= guiPosition.x and plrMouse.X <= guiPosition.x + guiSize.x and plrMouse.Y >= guiPosition.y and plrMouse.Y <= guiPosition.y + guiSize.y then
4849 return true
4850 else
4851 return false
4852 end
4853end
4854
4855local clipboard = {}
4856local function delete(o)
4857 o.Parent = nil
4858end
4859
4860local getTextWidth do
4861 local text = Create('TextLabel',{
4862 Name = "TextWidth";
4863 TextXAlignment = 'Left';
4864 TextYAlignment = 'Center';
4865 Font = FONT;
4866 FontSize = FONT_SIZE;
4867 Text = "";
4868 Position = UDim2.new(0,0,0,0);
4869 Size = UDim2.new(1,0,1,0);
4870 Visible = false;
4871 Parent = explorerPanel;
4872 })
4873 function getTextWidth(s)
4874 text.Text = s
4875 return text.TextBounds.x
4876 end
4877end
4878
4879local nameScanned = false
4880-- Holds the game tree converted to a list.
4881local TreeList = {}
4882-- Matches objects to their tree node representation.
4883local NodeLookup = {}
4884
4885local nodeWidth = 0
4886
4887local QuickButtons = {}
4888
4889function filteringWorkspace()
4890 if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then
4891 return true
4892 end
4893 return false
4894end
4895
4896function lookForAName(obj,name)
4897 for i,v in pairs(obj:GetDescendants()) do
4898 if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end
4899 -- lookForAName(v,name)
4900 end
4901end
4902
4903function scanName(obj)
4904 nameScanned = false
4905 if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then
4906 nameScanned = true
4907 else
4908 lookForAName(obj,explorerFilter.Text)
4909 end
4910 return nameScanned
4911end
4912
4913function updateActions()
4914 for i,v in pairs(QuickButtons) do
4915 v.Toggle(v.Cond());
4916 end
4917end
4918
4919local updateList,rawUpdateList,updateScroll,rawUpdateSize do
4920 local function r(t)
4921 for i = 1,#t do
4922 if not filteringWorkspace() or scanName(t[i].Object) then
4923 TreeList[#TreeList+1] = t[i]
4924
4925 local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
4926 if w > nodeWidth then
4927 nodeWidth = w
4928 end
4929 if t[i].Expanded or filteringWorkspace() then
4930 r(t[i])
4931 end
4932 end
4933 end
4934 end
4935
4936 function rawUpdateSize()
4937 scrollBarH.TotalSpace = nodeWidth
4938 scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
4939 scrollBarH:Update()
4940 local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
4941 scrollBarH.GUI.Visible = visible
4942
4943 listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
4944
4945 scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
4946 scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
4947
4948 scrollBar.TotalSpace = #TreeList+1
4949 scrollBar:Update()
4950 end
4951
4952 function rawUpdateList()
4953 -- Clear then repopulate the entire list. It appears to be fast enough.
4954 TreeList = {}
4955 nodeWidth = 0
4956 r(NodeLookup[workspace.Parent])
4957 if DexStorageEnabled then
4958 r(NodeLookup[DexStorage])
4959 end
4960 if RunningScriptsStorageEnabled then
4961 r(NodeLookup[RunningScriptsStorage])
4962 end
4963 if UpvalueStorageEnabled then
4964 r(NodeLookup[UpvalueStorage])
4965 end
4966 rawUpdateSize()
4967 updateActions()
4968 end
4969
4970 -- Adding or removing large models will cause many updates to occur. We
4971 -- can reduce the number of updates by creating a delay, then dropping any
4972 -- updates that occur during the delay.
4973 local updatingList = false
4974 function updateList()
4975 if updatingList then return end
4976 updatingList = true
4977 wait(2.25)
4978 updatingList = false
4979 rawUpdateList()
4980 end
4981
4982 local updatingScroll = false
4983 function updateScroll()
4984 if updatingScroll then return end
4985 updatingScroll = true
4986 wait(2.25)
4987 updatingScroll = false
4988 scrollBar:Update()
4989 end
4990end
4991
4992local Selection do
4993 local bindGetSelection = explorerPanel:FindFirstChild("GetSelection")
4994 if not bindGetSelection then
4995 bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
4996 bindGetSelection.Parent = explorerPanel
4997 end
4998
4999 local bindSetSelection = explorerPanel:FindFirstChild("SetSelection")
5000 if not bindSetSelection then
5001 bindSetSelection = Create('BindableFunction',{Name = "SetSelection"})
5002 bindSetSelection.Parent = explorerPanel
5003 end
5004
5005 local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged")
5006 if not bindSelectionChanged then
5007 bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
5008 bindSelectionChanged.Parent = explorerPanel
5009 end
5010
5011 local SelectionList = {}
5012 local SelectionSet = {}
5013 local Updates = true
5014 Selection = {
5015 Selected = SelectionSet;
5016 List = SelectionList;
5017 }
5018
5019 local function addObject(object)
5020 -- list update
5021 local lupdate = false
5022 -- scroll update
5023 local supdate = false
5024
5025 if not SelectionSet[object] then
5026 local node = NodeLookup[object]
5027 if node then
5028 table.insert(SelectionList,object)
5029 SelectionSet[object] = true
5030 node.Selected = true
5031
5032 -- expand all ancestors so that selected node becomes visible
5033 node = node.Parent
5034 while node do
5035 if not node.Expanded then
5036 node.Expanded = true
5037 lupdate = true
5038 end
5039 node = node.Parent
5040 end
5041 supdate = true
5042 end
5043 end
5044 return lupdate,supdate
5045 end
5046
5047 function Selection:Set(objects)
5048 local lupdate = false
5049 local supdate = false
5050
5051 if #SelectionList > 0 then
5052 for i = 1,#SelectionList do
5053 local object = SelectionList[i]
5054 local node = NodeLookup[object]
5055 if node then
5056 node.Selected = false
5057 SelectionSet[object] = nil
5058 end
5059 end
5060
5061 SelectionList = {}
5062 Selection.List = SelectionList
5063 supdate = true
5064 end
5065
5066 for i = 1,#objects do
5067 local l,s = addObject(objects[i])
5068 lupdate = l or lupdate
5069 supdate = s or supdate
5070 end
5071
5072 if lupdate then
5073 rawUpdateList()
5074 supdate = true
5075 elseif supdate then
5076 scrollBar:Update()
5077 end
5078
5079 if supdate then
5080 bindSelectionChanged:Fire()
5081 updateActions()
5082 end
5083 end
5084
5085 function Selection:Add(object)
5086 local l,s = addObject(object)
5087 if l then
5088 rawUpdateList()
5089 if Updates then
5090 bindSelectionChanged:Fire()
5091 updateActions()
5092 end
5093 elseif s then
5094 scrollBar:Update()
5095 if Updates then
5096 bindSelectionChanged:Fire()
5097 updateActions()
5098 end
5099 end
5100 end
5101
5102 function Selection:StopUpdates()
5103 Updates = false
5104 end
5105
5106 function Selection:ResumeUpdates()
5107 Updates = true
5108 bindSelectionChanged:Fire()
5109 updateActions()
5110 end
5111
5112 function Selection:Remove(object,noupdate)
5113 if SelectionSet[object] then
5114 local node = NodeLookup[object]
5115 if node then
5116 node.Selected = false
5117 SelectionSet[object] = nil
5118 for i = 1,#SelectionList do
5119 if SelectionList[i] == object then
5120 table.remove(SelectionList,i)
5121 break
5122 end
5123 end
5124
5125 if not noupdate then
5126 scrollBar:Update()
5127 end
5128 bindSelectionChanged:Fire()
5129 updateActions()
5130 end
5131 end
5132 end
5133
5134 function Selection:Get()
5135 local list = {}
5136 for i = 1,#SelectionList do
5137 list[i] = SelectionList[i]
5138 end
5139 return list
5140 end
5141
5142 bindSetSelection.OnInvoke = function(...)
5143 Selection:Set(...)
5144 end
5145
5146 bindGetSelection.OnInvoke = function()
5147 return Selection:Get()
5148 end
5149end
5150
5151UserInputService.InputBegan:Connect(function(inp,gpe)
5152 if not gpe and inp.KeyCode == Enum.KeyCode.Delete then
5153 if not Option.Modifiable then return end
5154 local list = Selection:Get()
5155 for i = 1,#list do
5156 pcall(delete,list[i])
5157 end
5158 Selection:Set({})
5159 end
5160end)
5161
5162function CreateCaution(title,msg)
5163 local newCaution = CautionWindow:Clone()
5164 newCaution.Title.Text = title
5165 newCaution.MainWindow.Desc.Text = msg
5166 newCaution.Parent = explorerPanel.Parent
5167 newCaution.Visible = true
5168 newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
5169 newCaution:Destroy()
5170 end)
5171end
5172
5173function CreateTableCaution(title,msg)
5174 if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end
5175 local newCaution = TableCautionWindow:Clone()
5176 newCaution.Title.Text = title
5177
5178 local TableList = newCaution.MainWindow.TableResults
5179 local TableTemplate = newCaution.MainWindow.TableTemplate
5180
5181 for i,v in pairs(msg) do
5182 local newResult = TableTemplate:Clone()
5183 newResult.Type.Text = type(v)
5184 newResult.Value.Text = tostring(v)
5185 newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
5186 newResult.Parent = TableList
5187 TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
5188 newResult.Visible = true
5189 end
5190 newCaution.Parent = explorerPanel.Parent
5191 newCaution.Visible = true
5192 newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
5193 newCaution:Destroy()
5194 end)
5195end
5196
5197local function Split(str, delimiter)
5198 local start = 1
5199 local t = {}
5200 while true do
5201 local pos = string.find (str, delimiter, start, true)
5202 if not pos then
5203 break
5204 end
5205 table.insert (t, string.sub (str, start, pos - 1))
5206 start = pos + string.len (delimiter)
5207 end
5208 table.insert (t, string.sub (str, start))
5209 return t
5210end
5211
5212local function ToValue(value,type)
5213 if type == "Vector2" then
5214 local list = Split(value,",")
5215 if #list < 2 then return nil end
5216 local x = tonumber(list[1]) or 0
5217 local y = tonumber(list[2]) or 0
5218 return Vector2.new(x,y)
5219 elseif type == "Vector3" then
5220 local list = Split(value,",")
5221 if #list < 3 then return nil end
5222 local x = tonumber(list[1]) or 0
5223 local y = tonumber(list[2]) or 0
5224 local z = tonumber(list[3]) or 0
5225 return Vector3.new(x,y,z)
5226 elseif type == "Color3" then
5227 local list = Split(value,",")
5228 if #list < 3 then return nil end
5229 local r = tonumber(list[1]) or 0
5230 local g = tonumber(list[2]) or 0
5231 local b = tonumber(list[3]) or 0
5232 return Color3.new(r/255,g/255, b/255)
5233 elseif type == "UDim2" then
5234 local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
5235 if #list < 4 then return nil end
5236 local xScale = tonumber(list[1]) or 0
5237 local xOffset = tonumber(list[2]) or 0
5238 local yScale = tonumber(list[3]) or 0
5239 local yOffset = tonumber(list[4]) or 0
5240 return UDim2.new(xScale, xOffset, yScale, yOffset)
5241 elseif type == "Number" then
5242 return tonumber(value)
5243 elseif type == "String" then
5244 return value
5245 elseif type == "NumberRange" then
5246 local list = Split(value,",")
5247 if #list == 1 then
5248 if tonumber(list[1]) == nil then return nil end
5249 local newVal = tonumber(list[1]) or 0
5250 return NumberRange.new(newVal)
5251 end
5252 if #list < 2 then return nil end
5253 local x = tonumber(list[1]) or 0
5254 local y = tonumber(list[2]) or 0
5255 return NumberRange.new(x,y)
5256 elseif type == "Script" then
5257 local success,err = ypcall(function()
5258 _G.D_E_X_DONOTUSETHISPLEASE = nil
5259 loadstring(
5260 "_G.D_E_X_DONOTUSETHISPLEASE = "..value
5261 )()
5262 return _G.D_E_X_DONOTUSETHISPLEASE
5263 end)
5264 if err then
5265 return nil
5266 end
5267 else
5268 return nil
5269 end
5270end
5271
5272local function ToPropValue(value,type)
5273 if type == "Vector2" then
5274 local list = Split(value,",")
5275 if #list < 2 then return nil end
5276 local x = tonumber(list[1]) or 0
5277 local y = tonumber(list[2]) or 0
5278 return Vector2.new(x,y)
5279 elseif type == "Vector3" then
5280 local list = Split(value,",")
5281 if #list < 3 then return nil end
5282 local x = tonumber(list[1]) or 0
5283 local y = tonumber(list[2]) or 0
5284 local z = tonumber(list[3]) or 0
5285 return Vector3.new(x,y,z)
5286 elseif type == "Color3" then
5287 local list = Split(value,",")
5288 if #list < 3 then return nil end
5289 local r = tonumber(list[1]) or 0
5290 local g = tonumber(list[2]) or 0
5291 local b = tonumber(list[3]) or 0
5292 return Color3.new(r/255,g/255, b/255)
5293 elseif type == "UDim2" then
5294 local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
5295 if #list < 4 then return nil end
5296 local xScale = tonumber(list[1]) or 0
5297 local xOffset = tonumber(list[2]) or 0
5298 local yScale = tonumber(list[3]) or 0
5299 local yOffset = tonumber(list[4]) or 0
5300 return UDim2.new(xScale, xOffset, yScale, yOffset)
5301 elseif type == "Content" then
5302 return value
5303 elseif type == "float" or type == "int" or type == "double" then
5304 return tonumber(value)
5305 elseif type == "string" then
5306 return value
5307 elseif type == "NumberRange" then
5308 local list = Split(value,",")
5309 if #list == 1 then
5310 if tonumber(list[1]) == nil then return nil end
5311 local newVal = tonumber(list[1]) or 0
5312 return NumberRange.new(newVal)
5313 end
5314 if #list < 2 then return nil end
5315 local x = tonumber(list[1]) or 0
5316 local y = tonumber(list[2]) or 0
5317 return NumberRange.new(x,y)
5318 elseif string.sub(value,1,4) == "Enum" then
5319 local getEnum = value
5320 while true do
5321 local x,y = string.find(getEnum,".")
5322 if y then
5323 getEnum = string.sub(getEnum,y+1)
5324 else
5325 break
5326 end
5327 end
5328 -- print(getEnum)
5329 return getEnum
5330 else
5331 return nil
5332 end
5333end
5334
5335function PromptRemoteCaller(inst)
5336 if CurrentRemoteWindow then
5337 CurrentRemoteWindow:Destroy()
5338 CurrentRemoteWindow = nil
5339 end
5340 CurrentRemoteWindow = RemoteWindow:Clone()
5341 CurrentRemoteWindow.Parent = explorerPanel.Parent
5342 CurrentRemoteWindow.Visible = true
5343
5344 local displayValues = false
5345
5346 local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments
5347 local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate
5348
5349 if inst:IsA("RemoteEvent") then
5350 CurrentRemoteWindow.Title.Text = "Fire Event"
5351 CurrentRemoteWindow.MainWindow.Ok.Text = "Fire"
5352 CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false
5353 CurrentRemoteWindow.MainWindow.Desc2.Visible = false
5354 end
5355
5356 local newArgument = ArgumentTemplate:Clone()
5357 newArgument.Parent = ArgumentList
5358 newArgument.Visible = true
5359 newArgument.Type.MouseButton1Down:connect(function()
5360 createDDown(newArgument.Type,function(choice)
5361 newArgument.Type.Text = choice
5362 end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
5363 end)
5364
5365 CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()
5366 if CurrentRemoteWindow and inst.Parent ~= nil then
5367 local MyArguments = {}
5368 for i,v in pairs(ArgumentList:GetChildren()) do
5369 table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text))
5370 end
5371 if inst:IsA("RemoteFunction") then
5372 if displayValues then
5373 spawn(function()
5374 local myResults = inst:InvokeServer(unpack(MyArguments))
5375 if myResults then
5376 CreateTableCaution("Remote Caller",myResults)
5377 else
5378 CreateCaution("Remote Caller","This remote did not return anything.")
5379 end
5380 end)
5381 else
5382 spawn(function()
5383 inst:InvokeServer(unpack(MyArguments))
5384 end)
5385 end
5386 else
5387 inst:FireServer(unpack(MyArguments))
5388 end
5389 CurrentRemoteWindow:Destroy()
5390 CurrentRemoteWindow = nil
5391 end
5392 end)
5393
5394 CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()
5395 if CurrentRemoteWindow then
5396 local newArgument = ArgumentTemplate:Clone()
5397 newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
5398 newArgument.Parent = ArgumentList
5399 ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
5400 newArgument.Visible = true
5401 newArgument.Type.MouseButton1Down:connect(function()
5402 createDDown(newArgument.Type,function(choice)
5403 newArgument.Type.Text = choice
5404 end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
5405 end)
5406 end
5407 end)
5408
5409 CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()
5410 if CurrentRemoteWindow then
5411 if #ArgumentList:GetChildren() > 1 then
5412 ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy()
5413 ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
5414 end
5415 end
5416 end)
5417
5418 CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
5419 if CurrentRemoteWindow then
5420 CurrentRemoteWindow:Destroy()
5421 CurrentRemoteWindow = nil
5422 end
5423 end)
5424
5425 CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()
5426 if displayValues then
5427 displayValues = false
5428 CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false
5429 else
5430 displayValues = true
5431 CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true
5432 end
5433 end)
5434end
5435
5436function PromptSaveInstance(inst)
5437 if not SaveInstance and not _G.SaveInstance then CreateCaution("SaveInstance Missing","You do not have the SaveInstance function installed. Please go to RaspberryPi's thread to retrieve it.") return end
5438 if CurrentSaveInstanceWindow then
5439 CurrentSaveInstanceWindow:Destroy()
5440 CurrentSaveInstanceWindow = nil
5441 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
5442 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
5443 end
5444 end
5445 CurrentSaveInstanceWindow = SaveInstanceWindow:Clone()
5446 CurrentSaveInstanceWindow.Parent = explorerPanel.Parent
5447 CurrentSaveInstanceWindow.Visible = true
5448
5449 local filename = CurrentSaveInstanceWindow.MainWindow.FileName
5450 local saveObjects = true
5451 local overwriteCaution = false
5452
5453 CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()
5454 if readfile and getelysianpath then
5455 if readfile(getelysianpath()..filename.Text..".rbxmx") then
5456 if not overwriteCaution then
5457 overwriteCaution = true
5458 local newCaution = ConfirmationWindow:Clone()
5459 newCaution.Name = "SaveInstanceOverwriteCaution"
5460 newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?"
5461 newCaution.Parent = explorerPanel.Parent
5462 newCaution.Visible = true
5463 newCaution.MainWindow.Yes.MouseButton1Up:connect(function()
5464 ypcall(function()
5465 SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
5466 end)
5467 overwriteCaution = false
5468 newCaution:Destroy()
5469 if CurrentSaveInstanceWindow then
5470 CurrentSaveInstanceWindow:Destroy()
5471 CurrentSaveInstanceWindow = nil
5472 end
5473 end)
5474 newCaution.MainWindow.No.MouseButton1Up:connect(function()
5475 overwriteCaution = false
5476 newCaution:Destroy()
5477 end)
5478 end
5479 else
5480 ypcall(function()
5481 SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
5482 end)
5483 if CurrentSaveInstanceWindow then
5484 CurrentSaveInstanceWindow:Destroy()
5485 CurrentSaveInstanceWindow = nil
5486 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
5487 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
5488 end
5489 end
5490 end
5491 else
5492 ypcall(function()
5493 if SaveInstance then
5494 SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
5495 else
5496 _G.SaveInstance(inst,filename.Text,not saveObjects)
5497 end
5498 end)
5499 if CurrentSaveInstanceWindow then
5500 CurrentSaveInstanceWindow:Destroy()
5501 CurrentSaveInstanceWindow = nil
5502 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
5503 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
5504 end
5505 end
5506 end
5507 end)
5508 CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
5509 if CurrentSaveInstanceWindow then
5510 CurrentSaveInstanceWindow:Destroy()
5511 CurrentSaveInstanceWindow = nil
5512 if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
5513 explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
5514 end
5515 end
5516 end)
5517 CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()
5518 if saveObjects then
5519 saveObjects = false
5520 CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false
5521 else
5522 saveObjects = true
5523 CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true
5524 end
5525 end)
5526end
5527
5528function DestroyRightClick()
5529 if currentRightClickMenu then
5530 currentRightClickMenu:Destroy()
5531 currentRightClickMenu = nil
5532 end
5533 if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then
5534 CurrentInsertObjectWindow.Visible = false
5535 end
5536end
5537
5538
5539
5540function rightClickMenu(sObj)
5541 local mouse = game:GetService("Players").LocalPlayer:GetMouse()
5542
5543 local options = {
5544 'Cut',
5545 'Copy',
5546 'Copy Path',
5547 'Paste Into',
5548 'Duplicate',
5549 'Delete',
5550 'Select Children'
5551 }
5552 function IsAc(typ)
5553 local list = Selection:Get()
5554 for i = 1,#list do
5555 if list[i]:IsA(typ) then
5556 return true
5557 end
5558 end
5559 return false
5560 end
5561 if IsAc('BasePart') then
5562 table.insert(options, 'Teleport To')
5563 end
5564 if IsAc('LocalScript') or IsAc('ModuleScript') then
5565 table.insert(options, 'View Script')
5566 table.insert(options, 'Save Script')
5567 table.insert(options, 'Dump Script')
5568 end
5569 if IsAc('RemoteEvent') or IsAc('RemoteFunction') then
5570 table.insert(options, 'Call Remote')
5571 table.insert(options, 'Spy Remote')
5572 end
5573 currentRightClickMenu = CreateRightClickMenu(options, "", false,
5574 function(option)
5575 if option == "Cut" then
5576 if not Option.Modifiable then return end
5577 clipboard = {}
5578 local list = Selection.List
5579 local cut = {}
5580 for i = 1,#list do
5581 local obj = list[i]:Clone()
5582 if obj then
5583 table.insert(clipboard,obj)
5584 table.insert(cut,list[i])
5585 end
5586 end
5587 for i = 1,#cut do
5588 pcall(delete,cut[i])
5589 end
5590 updateActions()
5591 elseif option == "Copy" then
5592 if not Option.Modifiable then return end
5593 clipboard = {}
5594 local list = Selection.List
5595 for i = 1,#list do
5596 table.insert(clipboard,list[i]:Clone())
5597 end
5598 updateActions()
5599 elseif option == "Paste Into" then
5600 if not Option.Modifiable then return end
5601 local parent = Selection.List[1] or workspace
5602 for i = 1,#clipboard do
5603 clipboard[i]:Clone().Parent = parent
5604 end
5605 elseif option == "Duplicate" then
5606 if not Option.Modifiable then return end
5607 local list = Selection:Get()
5608 for i = 1,#list do
5609 list[i]:Clone().Parent = Selection.List[1].Parent or workspace
5610 end
5611 elseif option == "Delete" then
5612 if not Option.Modifiable then return end
5613 local list = Selection:Get()
5614 for i = 1,#list do
5615 pcall(delete,list[i])
5616 end
5617 Selection:Set({})
5618 elseif option == "Group" then
5619 if not Option.Modifiable then return end
5620 local newModel = Instance.new("Model")
5621 local list = Selection:Get()
5622 newModel.Parent = Selection.List[1].Parent or workspace
5623 for i = 1,#list do
5624 list[i].Parent = newModel
5625 end
5626 Selection:Set({})
5627 elseif option == "Ungroup" then
5628 if not Option.Modifiable then return end
5629 local ungrouped = {}
5630 local list = Selection:Get()
5631 for i = 1,#list do
5632 if list[i]:IsA("Model") then
5633 for i2,v2 in pairs(list[i]:GetChildren()) do
5634 v2.Parent = list[i].Parent or workspace
5635 table.insert(ungrouped,v2)
5636 end
5637 pcall(delete,list[i])
5638 end
5639 end
5640 Selection:Set({})
5641 if SettingsRemote:Invoke("SelectUngrouped") then
5642 for i,v in pairs(ungrouped) do
5643 Selection:Add(v)
5644 end
5645 end
5646 elseif option == "Select Children" then
5647 if not Option.Modifiable then return end
5648 local list = Selection:Get()
5649 Selection:Set({})
5650 Selection:StopUpdates()
5651 for i = 1,#list do
5652 for i2,v2 in pairs(list[i]:GetChildren()) do
5653 Selection:Add(v2)
5654 end
5655 end
5656 Selection:ResumeUpdates()
5657 elseif option == "Teleport To" then
5658 if not Option.Modifiable then return end
5659 local list = Selection:Get()
5660 for i = 1,#list do
5661 if list[i]:IsA("BasePart") then
5662 pcall(function()
5663 game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame
5664 end)
5665 break
5666 end
5667 end
5668 elseif option == "Dump Script" then
5669 if not Option.Modifiable then return; end;
5670 local list = Selection:Get()
5671 scriptDumper.Enabled = true;
5672 log(list[#list]);
5673 elseif option == "Spy Remote" then
5674 if not Option.Modifiable then return; end;
5675 local list = Selection:Get();
5676 dexSpy.Enabled = true;
5677 currentRemote = list[#list];
5678 elseif option == "Insert Part" then
5679 if not Option.Modifiable then return end
5680 local insertedParts = {}
5681 local list = Selection:Get()
5682 for i = 1,#list do
5683 pcall(function()
5684 local newPart = Instance.new("Part")
5685 newPart.Parent = list[i]
5686 newPart.CFrame = CFrame.new(game:GetService'Players'.LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0)
5687 table.insert(insertedParts,newPart)
5688 end)
5689 end
5690 elseif option == "Copy Path" then
5691 if not Option.Modifiable then return; end;
5692 local function reconstructPath(path)
5693 local matches = {};
5694 for v in path:gmatch("(.-)%.") do
5695 table.insert(matches, v);
5696 end;
5697 if #matches >= 1 then
5698 local startIndex, endIndex = path:find(matches[#matches]);
5699 table.insert(matches, path:sub(endIndex + 2, #path));
5700 end;
5701 local str = "";
5702 for i, v in pairs(matches) do
5703 if (not v:find("%s")) and (not v:find("!")) and (not v:find("?")) then
5704 if i ~= 1 then
5705 str = str .. "." .. v;
5706 else
5707 str = str .. ':GetService("' .. v .. '")';
5708 end;
5709 else
5710 str = str .. '["' .. v .. '"]'
5711 end;
5712 end;
5713 str = "game" .. str;
5714 return str;
5715 end;
5716 local list = Selection:Get();
5717 local copied = "";
5718 for i = 1, #list do
5719 if list[i]:GetFullName():find("%.") then
5720 if i == 1 then
5721 copied = copied .. reconstructPath(list[i]:GetFullName());
5722 else
5723 copied = copied .. "\n" .. reconstructPath(list[i]:GetFullName());
5724 end;
5725 else
5726 if i == 1 then
5727 copied = copied .. 'game:GetService("' .. list[i]:GetFullName() .. '")';
5728 else
5729 copied = copied .. "\n" .. 'game:GetService("' .. list[i]:GetFullName() .. '")';
5730 end;
5731 end;
5732 end;
5733 setclipboard(copied);
5734 elseif option == "Save Instance" then
5735 if not Option.Modifiable then return end
5736 local list = Selection:Get()
5737 if #list == 1 then
5738 list[1].Archivable = true
5739 ypcall(function()PromptSaveInstance(list[1]:Clone())end)
5740 elseif #list > 1 then
5741 local newModel = Instance.new("Model")
5742 newModel.Name = "SavedInstances"
5743 for i = 1,#list do
5744 ypcall(function()
5745 list[i].Archivable = true
5746 list[i]:Clone().Parent = newModel
5747 end)
5748 end
5749 PromptSaveInstance(newModel)
5750 end
5751 elseif option == "Call Remote" then
5752 if not Option.Modifiable then return end
5753 local list = Selection:Get()
5754 for i = 1,#list do
5755 if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then
5756 PromptRemoteCaller(list[i])
5757 break
5758 end
5759 end
5760 elseif option == "Save Script" then
5761 if not Option.Modifiable then return end
5762 local list = Selection:Get()
5763 for i = 1,#list do
5764 if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
5765 if Synapse then
5766 Synapse:WriteFile(game.PlaceId .. '_' .. list[i].Name:gsub('%W', '') .. '_' .. math.random(100000, 999999) .. '.lua', decompile(list[i]))
5767 elseif writefile then
5768 writefile(game.PlaceId .. '_' .. list[i].Name:gsub('%W', '') .. '_' .. math.random(100000, 999999) .. '.lua', decompile(list[i]));
5769 end
5770 end
5771 end
5772 elseif option == "View Script" then
5773 -- if not Option.Modifiable then return end
5774 local list = Selection:Get()
5775 for i = 1,#list do
5776 if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
5777 ScriptEditorEvent:Fire(list[i])
5778 end
5779 end
5780 elseif option == 'Try Get Values' then
5781 for i, sObj in pairs(Selection:Get()) do
5782 if vars[sObj.Name] or funcs[sObj.Name] then
5783 local var = vars[sObj.Name] or funcs[sObj.Name]
5784 if var then
5785 if type(var) == 'table' then
5786 local T = var;
5787 -- table.sort(T, cmp)
5788 for i,v in pairs(T) do
5789 local n = Instance.new('StringValue', sObj);
5790 n.Name = tostring(i);
5791 local a, b = pcall(function()
5792 return tostring(v);
5793 end)
5794 n.Value = a and b or '.undefined';
5795 if (type(v) == 'function') then
5796 funcs[i] = v;
5797 else
5798 vars[i] = v;
5799 end
5800 end
5801 elseif type(var) == 'function' then
5802 local T = debug.getupvalues(var);
5803 -- table.sort(T, cmp)
5804 for i,v in pairs(T) do
5805 local n = Instance.new('StringValue', sObj);
5806 n.Name = tostring(i);
5807 local a, b = pcall(function()
5808 return tostring(v);
5809 end)
5810 n.Value = a and b or '.undefined';
5811 if (type(v) == 'function') then
5812 funcs[i] = v;
5813 else
5814 vars[i] = v;
5815 end
5816 end
5817 end
5818 end
5819 end
5820 if typeof(sObj) == 'Instance' and (sObj:IsA'LocalScript' or sObj:IsA'ModuleScript') then
5821 do -- get script env values
5822 local T = getsenv(sObj);
5823 for i,v in pairs(T) do
5824 if not sObj:FindFirstChild(tostring(i)) then
5825 local n = Instance.new('StringValue', sObj);
5826 n.Name = tostring(i);
5827 local a, b = pcall(function()
5828 return tostring(v);
5829 end)
5830 n.Value = a and b or '.undefined';
5831 if (type(v) == 'function') then
5832 funcs[i] = v;
5833 for fn, p in pairs(debug.getupvalues(v)) do
5834 if not sObj:FindFirstChild(tostring(fn)) then
5835 local n = Instance.new('StringValue', sObj);
5836 n.Name = tostring(fn);
5837 local a, b = pcall(function()
5838 return tostring(p);
5839 end)
5840 n.Value = a and b or '.undefined';
5841 if (type(p) == 'function') then
5842 funcs[fn] = p;
5843 else
5844 vars[fn] = p;
5845 end
5846 end
5847 end
5848 else
5849 vars[i] = v;
5850 end
5851 end
5852 end
5853 end
5854 --[[do -- attempt to get upvalue variables
5855 for i,v in pairs(getreg()) do
5856 if typeof(v) == 'function' then
5857 local T = debug.getupvalues(v);
5858 for i,v in pairs(T) do
5859 if not sObj:FindFirstChild(tostring(i)) then
5860 local n = Instance.new('StringValue', sObj);
5861 n.Name = tostring(i);
5862 local a, b = pcall(function()
5863 return tostring(v);
5864 end)
5865 n.Value = a and b or '.undefined';
5866 if (type(v) == 'function') then
5867 for _, p in pairs(debug.getupvalues(v)) do
5868 if not sObj:FindFirstChild(tostring(_)) then
5869 local n = Instance.new('StringValue', sObj);
5870 n.Name = tostring(_);
5871 local a, b = pcall(function()
5872 return tostring(p);
5873 end)
5874 n.Value = a and b or '.undefined';
5875 end
5876 end
5877 end
5878 end
5879 end
5880 end
5881 end
5882 end]]
5883 end
5884 end
5885 elseif option == 'Dump Function' then
5886 if funcs[sObj.Name] then
5887 local var = funcs[sObj.Name]
5888 if var then
5889 if type(var) == 'function' then
5890 if writefile then
5891 writefile(game.PlaceId .. '_' .. 'DF' .. '_' .. math.random(100000, 999999) .. '.lua', decompile(var));
5892 end
5893 end
5894 end
5895 end
5896 elseif option == 'Refresh Instances' then
5897 for i,v in pairs(getscripts()) do
5898 if v ~= RunningScriptsStorage and v ~= DexStorage and v ~= UpvalueStorage then
5899 if (v:IsA'LocalScript' or v:IsA'ModuleScript' or v:IsA'Script') then
5900 v.Archivable = true;
5901 local ls = v:clone()
5902 if v:IsA'LocalScript' or v:IsA'Script' then ls.Disabled = true; end
5903 ls.Parent = RunningScriptsStorageMain
5904 end
5905 end
5906 end
5907 elseif option == 'Track' then
5908 if not Option.Modifiable then return end
5909 local list = Selection:Get()
5910 for i = 1,#list do
5911 pcall(function()
5912 local name = list[i].Name;
5913 if list[i].Parent:FindFirstChildOfClass'Humanoid' then
5914 name = list[i].Parent.Name;
5915 end
5916 _G.Track(list[i], name, list[i].BrickColor.Color);
5917 end)
5918 end
5919 end
5920 end)
5921 currentRightClickMenu.Parent = explorerPanel.Parent
5922 currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y)
5923 if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then
5924 currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y)
5925 end
5926end
5927
5928local function cancelReparentDrag()end
5929local function cancelSelectDrag()end
5930do
5931 local listEntries = {}
5932 local nameConnLookup = {}
5933
5934 local mouseDrag = Create('ImageButton',{
5935 Name = "MouseDrag";
5936 Position = UDim2.new(-0.25,0,-0.25,0);
5937 Size = UDim2.new(1.5,0,1.5,0);
5938 Transparency = 1;
5939 AutoButtonColor = false;
5940 Active = true;
5941 ZIndex = 10;
5942 })
5943 local function dragSelect(last,add,button)
5944 local connDrag
5945 local conUp
5946
5947 conDrag = mouseDrag.MouseMoved:connect(function(x,y)
5948 local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
5949 local size = listFrame.AbsoluteSize
5950 if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end
5951
5952 local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
5953 -- Mouse may have made a large step, so interpolate between the
5954 -- last index and the current.
5955 for n = i<last and i or last, i>last and i or last do
5956 local node = TreeList[n]
5957 if node then
5958 if add then
5959 Selection:Add(node.Object)
5960 else
5961 Selection:Remove(node.Object)
5962 end
5963 end
5964 end
5965 last = i
5966 end)
5967
5968 function cancelSelectDrag()
5969 mouseDrag.Parent = nil
5970 conDrag:disconnect()
5971 conUp:disconnect()
5972 function cancelSelectDrag()end
5973 end
5974
5975 conUp = mouseDrag[button]:connect(cancelSelectDrag)
5976
5977 mouseDrag.Parent = GetScreen(listFrame)
5978 end
5979
5980 local function dragReparent(object,dragGhost,clickPos,ghostOffset)
5981 local connDrag
5982 local conUp
5983 local conUp2
5984
5985 local parentIndex = nil
5986 local dragged = false
5987
5988 local parentHighlight = Create('Frame',{
5989 Transparency = 1;
5990 Visible = false;
5991 Create('Frame',{
5992 BorderSizePixel = 0;
5993 BackgroundColor3 = Color3.new(0,0,0);
5994 BackgroundTransparency = 0.1;
5995 Position = UDim2.new(0,0,0,0);
5996 Size = UDim2.new(1,0,0,1);
5997 });
5998 Create('Frame',{
5999 BorderSizePixel = 0;
6000 BackgroundColor3 = Color3.new(0,0,0);
6001 BackgroundTransparency = 0.1;
6002 Position = UDim2.new(1,0,0,0);
6003 Size = UDim2.new(0,1,1,0);
6004 });
6005 Create('Frame',{
6006 BorderSizePixel = 0;
6007 BackgroundColor3 = Color3.new(0,0,0);
6008 BackgroundTransparency = 0.1;
6009 Position = UDim2.new(0,0,1,0);
6010 Size = UDim2.new(1,0,0,1);
6011 });
6012 Create('Frame',{
6013 BorderSizePixel = 0;
6014 BackgroundColor3 = Color3.new(0,0,0);
6015 BackgroundTransparency = 0.1;
6016 Position = UDim2.new(0,0,0,0);
6017 Size = UDim2.new(0,1,1,0);
6018 });
6019 })
6020 SetZIndex(parentHighlight,9)
6021
6022 conDrag = mouseDrag.MouseMoved:connect(function(x,y)
6023 local dragPos = Vector2.new(x,y)
6024 if dragged then
6025 local pos = dragPos - listFrame.AbsolutePosition
6026 local size = listFrame.AbsoluteSize
6027
6028 parentIndex = nil
6029 parentHighlight.Visible = false
6030 if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then
6031 local i = math.ceil(pos.y/ENTRY_BOUND-2)
6032 local node = TreeList[i + scrollBar.ScrollIndex]
6033 if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
6034 parentIndex = i
6035 local entry = listEntries[i]
6036 if entry then
6037 parentHighlight.Visible = true
6038 parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
6039 parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
6040 end
6041 end
6042 end
6043
6044 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
6045 elseif (clickPos-dragPos).magnitude > 8 then
6046 dragged = true
6047 SetZIndex(dragGhost,9)
6048 dragGhost.IndentFrame.Transparency = 0.25
6049 dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
6050 dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
6051 dragGhost.Parent = GetScreen(listFrame)
6052 parentHighlight.Parent = listFrame
6053 end
6054 end)
6055
6056 function cancelReparentDrag()
6057 mouseDrag.Parent = nil
6058 conDrag:disconnect()
6059 conUp:disconnect()
6060 conUp2:disconnect()
6061 dragGhost:Destroy()
6062 parentHighlight:Destroy()
6063 function cancelReparentDrag()end
6064 end
6065
6066 local wasSelected = Selection.Selected[object]
6067 if not wasSelected and Option.Selectable then
6068 Selection:Set({object})
6069 end
6070
6071 conUp = mouseDrag.MouseButton1Up:connect(function()
6072 cancelReparentDrag()
6073 if dragged then
6074 if parentIndex then
6075 local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
6076 if parentNode then
6077 parentNode.Expanded = true
6078
6079 local parentObj = parentNode.Object
6080 local function parent(a,b)
6081 a.Parent = b
6082 end
6083 if Option.Selectable then
6084 local list = Selection.List
6085 for i = 1,#list do
6086 pcall(parent,list[i],parentObj)
6087 end
6088 else
6089 pcall(parent,object,parentObj)
6090 end
6091 end
6092 end
6093 else
6094 -- do selection click
6095 if wasSelected and Option.Selectable then
6096 Selection:Set({})
6097 end
6098 end
6099 end)
6100 conUp2 = mouseDrag.MouseButton2Down:connect(function()
6101 cancelReparentDrag()
6102 end)
6103
6104 mouseDrag.Parent = GetScreen(listFrame)
6105 end
6106
6107 local entryTemplate = Create('ImageButton',{
6108 Name = "Entry";
6109 Transparency = 1;
6110 AutoButtonColor = false;
6111 Position = UDim2.new(0,0,0,0);
6112 Size = UDim2.new(1,0,0,ENTRY_SIZE);
6113 Create('Frame',{
6114 Name = "IndentFrame";
6115 BackgroundTransparency = 1;
6116 BackgroundColor3 = GuiColor.Selected;
6117 BorderColor3 = GuiColor.BorderSelected;
6118 Position = UDim2.new(0,0,0,0);
6119 Size = UDim2.new(1,0,1,0);
6120 Create(Icon('ImageButton',0, true),{
6121 Name = "Expand";
6122 AutoButtonColor = false;
6123 Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2);
6124 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
6125 });
6126 Create(Icon(nil,0),{
6127 Name = "ExplorerIcon";
6128 Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2);
6129 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
6130 });
6131 Create('TextLabel',{
6132 Name = "EntryText";
6133 BackgroundTransparency = 1;
6134 TextColor3 = GuiColor.Text;
6135 TextXAlignment = 'Left';
6136 TextYAlignment = 'Center';
6137 Font = FONT;
6138 FontSize = FONT_SIZE;
6139 Text = "";
6140 Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0);
6141 Size = UDim2.new(1,-2,1,0);
6142 });
6143 });
6144 })
6145
6146 function scrollBar.UpdateCallback(self)
6147 for i = 1,self.VisibleSpace do
6148 local node = TreeList[i + self.ScrollIndex]
6149 if node then
6150 local entry = listEntries[i]
6151 if not entry then
6152 entry = Create(entryTemplate:Clone(),{
6153 Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2);
6154 Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE);
6155 ZIndex = listFrame.ZIndex;
6156 })
6157 listEntries[i] = entry
6158
6159 local expand = entry.IndentFrame.Expand
6160 expand.MouseEnter:connect(function()
6161 local node = TreeList[i + self.ScrollIndex]
6162 if #node > 0 then
6163 if node.Expanded then
6164 local earrow = Icon(expand,NODE_EXPANDED)
6165 TweenService:Create(earrow.IconMap, TweenInfo.new(0.1), {ImageColor3 = Color3.fromRGB(0, 170, 255)}):Play()
6166 else
6167 local earrow = Icon(expand,NODE_COLLAPSED)
6168 TweenService:Create(earrow.IconMap, TweenInfo.new(0.1), {ImageColor3 = Color3.fromRGB(0, 170, 255)}):Play()
6169 end
6170 end
6171 end)
6172 expand.MouseLeave:connect(function()
6173 local node = TreeList[i + self.ScrollIndex]
6174 if #node > 0 then
6175 if node.Expanded then
6176 local earrow = Icon(expand,NODE_EXPANDED)
6177 TweenService:Create(earrow.IconMap, TweenInfo.new(0.1), {ImageColor3 = Color3.fromRGB(255,255,255)}):Play()
6178 else
6179 local earrow = Icon(expand,NODE_COLLAPSED)
6180 TweenService:Create(earrow.IconMap, TweenInfo.new(0.1), {ImageColor3 = Color3.fromRGB(255,255,255)}):Play()
6181 end
6182 end
6183 end)
6184 expand.MouseButton1Down:connect(function()
6185 local node = TreeList[i + self.ScrollIndex]
6186 if #node > 0 then
6187 node.Expanded = not node.Expanded
6188 if node.Object == explorerPanel.Parent and node.Expanded then
6189 CreateCaution("Warning","Please be careful when editing instances inside here, this is like the System32 of Dex and modifying objects here can break Dex.")
6190 end
6191 -- use raw update so the list updates instantly
6192 rawUpdateList()
6193 end
6194 end)
6195
6196 entry.MouseButton1Down:connect(function(x,y)
6197 local node = TreeList[i + self.ScrollIndex]
6198 DestroyRightClick()
6199 if GetAwaitRemote:Invoke() then
6200 bindSetAwaiting:Fire(node.Object)
6201 return
6202 end
6203
6204 if not HoldingShift then
6205 lastSelectedNode = i + self.ScrollIndex
6206 end
6207
6208 if HoldingShift and not filteringWorkspace() then
6209 if lastSelectedNode then
6210 if i + self.ScrollIndex - lastSelectedNode > 0 then
6211 Selection:StopUpdates()
6212 for i2 = 1, i + self.ScrollIndex - lastSelectedNode do
6213 local newNode = TreeList[lastSelectedNode + i2]
6214 if newNode then
6215 Selection:Add(newNode.Object)
6216 end
6217 end
6218 Selection:ResumeUpdates()
6219 else
6220 Selection:StopUpdates()
6221 for i2 = i + self.ScrollIndex - lastSelectedNode, 1 do
6222 local newNode = TreeList[lastSelectedNode + i2]
6223 if newNode then
6224 Selection:Add(newNode.Object)
6225 end
6226 end
6227 Selection:ResumeUpdates()
6228 end
6229 end
6230 return
6231 end
6232
6233 if HoldingCtrl then
6234 if Selection.Selected[node.Object] then
6235 Selection:Remove(node.Object)
6236 else
6237 Selection:Add(node.Object)
6238 end
6239 return
6240 end
6241 if Option.Modifiable then
6242 local pos = Vector2.new(x,y)
6243 dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos)
6244 elseif Option.Selectable then
6245 if Selection.Selected[node.Object] then
6246 Selection:Set({})
6247 else
6248 Selection:Set({node.Object})
6249 end
6250 dragSelect(i+self.ScrollIndex,true,'MouseButton1Up')
6251 end
6252 end)
6253
6254 entry.MouseButton2Down:connect(function()
6255 if not Option.Selectable then return end
6256
6257 DestroyRightClick()
6258
6259 curSelect = entry
6260
6261 local node = TreeList[i + self.ScrollIndex]
6262
6263 if GetAwaitRemote:Invoke() then
6264 bindSetAwaiting:Fire(node.Object)
6265 return
6266 end
6267
6268 if not Selection.Selected[node.Object] then
6269 Selection:Set({node.Object})
6270 end
6271 end)
6272
6273
6274 entry.MouseButton2Up:connect(function()
6275 if not Option.Selectable then return end
6276
6277 local node = TreeList[i + self.ScrollIndex]
6278
6279 if checkMouseInGui(curSelect) then
6280 rightClickMenu(node.Object)
6281 end
6282 end)
6283
6284 entry.Parent = listFrame
6285 end
6286
6287 entry.Visible = true
6288
6289 local object = node.Object
6290
6291 -- update expand icon
6292 if #node == 0 then
6293 entry.IndentFrame.Expand.Visible = false
6294 elseif node.Expanded then
6295 Icon(entry.IndentFrame.Expand,NODE_EXPANDED)
6296 entry.IndentFrame.Expand.Visible = true
6297 else
6298 Icon(entry.IndentFrame.Expand,NODE_COLLAPSED)
6299 entry.IndentFrame.Expand.Visible = true
6300 end
6301
6302 -- update explorer icon
6303 Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0)
6304
6305 -- update indentation
6306 local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE)
6307 entry.IndentFrame.Position = UDim2.new(0,w,0,0)
6308 entry.IndentFrame.Size = UDim2.new(1,-w,1,0)
6309
6310 -- update name change detection
6311 if nameConnLookup[entry] then
6312 nameConnLookup[entry]:disconnect()
6313 end
6314 local text = entry.IndentFrame.EntryText
6315 text.Text = object.Name
6316 nameConnLookup[entry] = node.Object.Changed:connect(function(p)
6317 if p == 'Name' then
6318 text.Text = object.Name
6319 end
6320 end)
6321
6322 -- update selection
6323 entry.IndentFrame.Transparency = node.Selected and 0 or 1
6324 text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text']
6325
6326 entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE)
6327 elseif listEntries[i] then
6328 listEntries[i].Visible = false
6329 end
6330 end
6331 for i = self.VisibleSpace+1,self.TotalSpace do
6332 local entry = listEntries[i]
6333 if entry then
6334 listEntries[i] = nil
6335 entry:Destroy()
6336 end
6337 end
6338 end
6339
6340 function scrollBarH.UpdateCallback(self)
6341 for i = 1,scrollBar.VisibleSpace do
6342 local node = TreeList[i + scrollBar.ScrollIndex]
6343 if node then
6344 local entry = listEntries[i]
6345 if entry then
6346 entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2)
6347 end
6348 end
6349 end
6350 end
6351
6352 Connect(listFrame.Changed,function(p)
6353 if p == 'AbsoluteSize' then
6354 rawUpdateSize()
6355 end
6356 end)
6357
6358 local wheelAmount = 6
6359
6360 explorerPanel.MouseWheelForward:connect(function()
6361 if input ~= nil and input.down ~= nil and input.down.leftshift then
6362 if scrollBarH.VisibleSpace - 1 > wheelAmount then
6363 scrollBarH:ScrollTo(scrollBarH.ScrollIndex - wheelAmount)
6364 else
6365 scrollBarH:ScrollTo(scrollBarH.ScrollIndex - scrollBarH.VisibleSpace)
6366 end
6367 else
6368 if scrollBar.VisibleSpace - 1 > wheelAmount then
6369 scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
6370 else
6371 scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
6372 end
6373 end
6374 end)
6375 explorerPanel.MouseWheelBackward:connect(function()
6376 if input ~= nil and input.down ~= nil and input.down.leftshift then
6377 if scrollBarH.VisibleSpace - 1 > wheelAmount then
6378 scrollBarH:ScrollTo(scrollBarH.ScrollIndex + wheelAmount)
6379 else
6380 scrollBarH:ScrollTo(scrollBarH.ScrollIndex + scrollBarH.VisibleSpace)
6381 end
6382 else
6383 if scrollBar.VisibleSpace - 1 > wheelAmount then
6384 scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
6385 else
6386 scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
6387 end
6388 end
6389 end)
6390end
6391
6392----------------------------------------------------------------
6393----------------------------------------------------------------
6394----------------------------------------------------------------
6395----------------------------------------------------------------
6396---- Object detection
6397
6398-- Inserts `v` into `t` at `i`. Also sets `Index` field in `v`.
6399local function insert(t,i,v)
6400 for n = #t,i,-1 do
6401 local v = t[n]
6402 v.Index = n+1
6403 t[n+1] = v
6404 end
6405 v.Index = i
6406 t[i] = v
6407end
6408
6409-- Removes `i` from `t`. Also sets `Index` field in removed value.
6410local function remove(t,i)
6411 local v = t[i]
6412 for n = i+1,#t do
6413 local v = t[n]
6414 v.Index = n-1
6415 t[n-1] = v
6416 end
6417 t[#t] = nil
6418 v.Index = 0
6419 return v
6420end
6421
6422-- Returns how deep `o` is in the tree.
6423local function depth(o)
6424 local d = -1
6425 while o do
6426 o = o.Parent
6427 d = d + 1
6428 end
6429 return d
6430end
6431
6432
6433local connLookup = {}
6434
6435-- Returns whether a node would be present in the tree list
6436local function nodeIsVisible(node)
6437 local visible = true
6438 node = node.Parent
6439 while node and visible do
6440 visible = visible and node.Expanded
6441 node = node.Parent
6442 end
6443 return visible
6444end
6445
6446-- Removes an object's tree node. Called when the object stops existing in the
6447-- game tree.
6448local function removeObject(object)
6449 local objectNode = NodeLookup[object]
6450 if not objectNode then
6451 return
6452 end
6453
6454 local visible = nodeIsVisible(objectNode)
6455
6456 Selection:Remove(object,true)
6457
6458 local parent = objectNode.Parent
6459 remove(parent,objectNode.Index)
6460 NodeLookup[object] = nil
6461 connLookup[object]:disconnect()
6462 connLookup[object] = nil
6463
6464 if visible then
6465 updateList()
6466 elseif nodeIsVisible(parent) then
6467 updateScroll()
6468 end
6469end
6470
6471-- Moves a tree node to a new parent. Called when an existing object's parent
6472-- changes.
6473local function moveObject(object,parent)
6474 local objectNode = NodeLookup[object]
6475 if not objectNode then
6476 return
6477 end
6478
6479 local parentNode = NodeLookup[parent]
6480 if not parentNode then
6481 return
6482 end
6483
6484 local visible = nodeIsVisible(objectNode)
6485
6486 remove(objectNode.Parent,objectNode.Index)
6487 objectNode.Parent = parentNode
6488
6489 objectNode.Depth = depth(object)
6490 local function r(node,d)
6491 for i = 1,#node do
6492 node[i].Depth = d
6493 r(node[i],d+1)
6494 end
6495 end
6496 r(objectNode,objectNode.Depth+1)
6497
6498 insert(parentNode,#parentNode+1,objectNode)
6499
6500 if visible or nodeIsVisible(objectNode) then
6501 updateList()
6502 elseif nodeIsVisible(objectNode.Parent) then
6503 updateScroll()
6504 end
6505end
6506
6507-- ScriptContext['/Libraries/LibraryRegistration/LibraryRegistration']
6508-- This RobloxLocked object lets me index its properties for some reason
6509
6510local function check(object)
6511 return object.AncestryChanged
6512end
6513
6514-- Creates a new tree node from an object. Called when an object starts
6515-- existing in the game tree.
6516local function addObject(object,noupdate)
6517 if script then
6518 -- protect against naughty RobloxLocked objects
6519 local s = pcall(check,object)
6520 if not s then
6521 return
6522 end
6523 end
6524
6525 local parentNode = NodeLookup[object.Parent]
6526 if not parentNode then
6527 return
6528 end
6529
6530 local objectNode = {
6531 Object = object;
6532 Parent = parentNode;
6533 Index = 0;
6534 Expanded = false;
6535 Selected = false;
6536 Depth = depth(object);
6537 }
6538
6539 connLookup[object] = Connect(object.AncestryChanged,function(c,p)
6540 if c == object then
6541 if p == nil then
6542 removeObject(c)
6543 else
6544 moveObject(c,p)
6545 end
6546 end
6547 end)
6548
6549 NodeLookup[object] = objectNode
6550 insert(parentNode,#parentNode+1,objectNode)
6551
6552 if not noupdate then
6553 if nodeIsVisible(objectNode) then
6554 updateList()
6555 elseif nodeIsVisible(objectNode.Parent) then
6556 updateScroll()
6557 end
6558 end
6559end
6560
6561local function makeObject(obj,par)
6562 local newObject = Instance.new(obj.ClassName)
6563 for i,v in pairs(obj.Properties) do
6564 ypcall(function()
6565 local newProp
6566 newProp = ToPropValue(v.Value,v.Type)
6567 newObject[v.Name] = newProp
6568 end)
6569 end
6570 newObject.Parent = par
6571end
6572
6573local function writeObject(obj)
6574 local newObject = {ClassName = obj.ClassName, Properties = {}}
6575 for i,v in pairs(RbxApi.GetProperties(obj.className)) do
6576 if v["Name"] ~= "Parent" then
6577 table.insert(newObject.Properties,{Name = v["Name"], Type = v["ValueType"], Value = tostring(obj[v["Name"]])})
6578 end
6579 end
6580 return newObject
6581end
6582
6583local function buildDexStorage()
6584 --[[local localDexStorage
6585
6586 local success,err = ypcall(function()
6587 localDexStorage = game:GetObjects("rbxasset://DexStorage.rbxm")
6588 end)
6589
6590 if success and localDexStorage then
6591 for i,v in pairs(localDexStorage:GetChildren()) do
6592 ypcall(function()
6593 v.Parent = DexStorageMain
6594 end)
6595 end
6596 end]]
6597
6598 updateDexStorageListeners()
6599 --[[
6600 local localDexStorage = readfile(getelysianpath().."DexStorage.txt")--game:GetService("CookiesService"):GetCookieValue("DexStorage")
6601 --local success,err = pcall(function()
6602 if localDexStorage then
6603 local objTable = game:GetService("HttpService"):JSONDecode(localDexStorage)
6604 for i,v in pairs(objTable) do
6605 makeObject(v,DexStorageMain)
6606 end
6607 end
6608 --end)
6609 --]]
6610end
6611
6612local dexStorageDebounce = false
6613local dexStorageListeners = {}
6614
6615local function updateDexStorage()
6616 if dexStorageDebounce then return end
6617 dexStorageDebounce = true
6618
6619 wait()
6620
6621 pcall(function()
6622 saveinstance("content//DexStorage.rbxm",DexStorageMain)
6623 end)
6624
6625 updateDexStorageListeners()
6626
6627 dexStorageDebounce = false
6628 --[[
6629 local success,err = ypcall(function()
6630 local objs = {}
6631 for i,v in pairs(DexStorageMain:GetChildren()) do
6632 table.insert(objs,writeObject(v))
6633 end
6634 writefile(getelysianpath().."DexStorage.txt",game:GetService("HttpService"):JSONEncode(objs))
6635 --game:GetService("CookiesService"):SetCookieValue("DexStorage",game:GetService("HttpService"):JSONEncode(objs))
6636 end)
6637 if err then
6638 CreateCaution("DexStorage Save Fail!","DexStorage broke! If you see this message, report to Raspberry Pi!")
6639 end
6640 print("hi")
6641 --]]
6642end
6643
6644function updateDexStorageListeners()
6645 for i,v in pairs(dexStorageListeners) do
6646 v:Disconnect()
6647 end
6648 dexStorageListeners = {}
6649 for i,v in pairs(DexStorageMain:GetChildren()) do
6650 pcall(function()
6651 local ev = v.Changed:connect(updateDexStorage)
6652 table.insert(dexStorageListeners,ev)
6653 end)
6654 end
6655end
6656
6657do
6658 NodeLookup[workspace.Parent] = {
6659 Object = workspace.Parent;
6660 Parent = nil;
6661 Index = 0;
6662 Expanded = true;
6663 }
6664
6665 if DexStorageEnabled then
6666 NodeLookup[DexStorage] = {
6667 Object = DexStorage;
6668 Parent = nil;
6669 Index = 0;
6670 Expanded = true;
6671 }
6672 end
6673
6674 if RunningScriptsStorageEnabled then
6675 NodeLookup[RunningScriptsStorage] = {
6676 Object = RunningScriptsStorage;
6677 Parent = nil;
6678 Index = 0;
6679 Expanded = true;
6680 }
6681 end
6682
6683 if UpvalueStorageEnabled then
6684 NodeLookup[UpvalueStorage] = {
6685 Object = UpvalueStorage;
6686 Parent = nil;
6687 Index = 0;
6688 Expanded = true;
6689 }
6690 end
6691
6692 Connect(game.DescendantAdded,addObject)
6693 Connect(game.DescendantRemoving,removeObject)
6694
6695 if DexStorageEnabled then
6696 --[[
6697 if readfile(getelysianpath().."DexStorage.txt") == nil then
6698 writefile(getelysianpath().."DexStorage.txt","")
6699 end
6700 --]]
6701
6702 buildDexStorage()
6703
6704 Connect(DexStorage.DescendantAdded,addObject)
6705 Connect(DexStorage.DescendantRemoving,removeObject)
6706
6707 Connect(DexStorage.DescendantAdded,updateDexStorage)
6708 Connect(DexStorage.DescendantRemoving,updateDexStorage)
6709 end
6710
6711 if UpvalueStorageEnabled then
6712 Connect(UpvalueStorageVariables.DescendantAdded,addObject)
6713 Connect(UpvalueStorageVariables.DescendantRemoving,removeObject)
6714
6715 Connect(UpvalueStorageFunctions.DescendantAdded,addObject)
6716 Connect(UpvalueStorageFunctions.DescendantRemoving,removeObject)
6717 end
6718
6719 if RunningScriptsStorageEnabled then
6720 Connect(RunningScriptsStorage.DescendantAdded,addObject)
6721 Connect(RunningScriptsStorage.DescendantRemoving,removeObject)
6722
6723 --[[ local currentTable = get_nil_instances()
6724
6725 spawn(function()
6726 while true do
6727 if #currentTable ~= #get_nil_instances() then
6728 currentTable = get_nil_instances()
6729 --RunningScriptsStorageMain:ClearAllChildren()
6730 for i,v in pairs(get_nil_instances() do
6731 if v ~= RunningScriptsStorage and v ~= DexStorage and v ~= UpvalueStorage then
6732 pcall(function()
6733 v.Parent = RunningScriptsStorageMain
6734 end)
6735 end
6736 end
6737 end
6738 wait(60)
6739 end
6740 end)]]
6741 end
6742
6743 local function get(o)
6744 return o:GetDescendants()
6745 end
6746
6747 local function r(o)
6748 local s,children = pcall(get,o)
6749 if s then
6750 for i = 1,#children do
6751 addObject(children[i],true)
6752 -- r(children[i])
6753 end
6754 end
6755 end
6756
6757 r(workspace.Parent)
6758
6759 if DexStorageEnabled then
6760 r(DexStorage)
6761 end
6762 if RunningScriptsStorageEnabled then
6763 r(RunningScriptsStorage)
6764 end
6765 if UpvalueStorageEnabled then
6766 r(UpvalueStorage)
6767 end
6768
6769 scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
6770 updateList()
6771end
6772
6773----------------------------------------------------------------
6774----------------------------------------------------------------
6775----------------------------------------------------------------
6776----------------------------------------------------------------
6777---- Actions
6778
6779local actionButtons do
6780 actionButtons = {}
6781
6782 local totalActions = 1
6783 local currentActions = totalActions
6784 local function makeButton(icon,over,name,vis,cond)
6785 local buttonEnabled = false
6786
6787 local button = Create(Icon('ImageButton',icon),{
6788 Name = name .. "Button";
6789 Visible = Option.Modifiable and Option.Selectable;
6790 Position = UDim2.new(1,-(GUI_SIZE+2)*currentActions+2,0.25,-GUI_SIZE/2);
6791 Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
6792 Parent = headerFrame;
6793 })
6794
6795 local tipText = Create('TextLabel',{
6796 Name = name .. "Text";
6797 Text = name;
6798 Visible = false;
6799 BackgroundTransparency = 1;
6800 TextXAlignment = 'Right';
6801 Font = FONT;
6802 FontSize = FONT_SIZE;
6803 Position = UDim2.new(0,0,0,0);
6804 Size = UDim2.new(1,-(GUI_SIZE+2)*totalActions,1,0);
6805 Parent = headerFrame;
6806 })
6807
6808
6809 button.MouseEnter:connect(function()
6810 if buttonEnabled then
6811 button.BackgroundTransparency = 0.9
6812 end
6813 --Icon(button,over)
6814 --tipText.Visible = true
6815 end)
6816 button.MouseLeave:connect(function()
6817 button.BackgroundTransparency = 1
6818 --Icon(button,icon)
6819 --tipText.Visible = false
6820 end)
6821
6822 currentActions = currentActions + 1
6823 actionButtons[#actionButtons+1] = {Obj = button,Cond = cond}
6824 QuickButtons[#actionButtons+1] = {Obj = button,Cond = cond, Toggle = function(on)
6825 if on then
6826 buttonEnabled = true
6827 Icon(button,over)
6828 else
6829 buttonEnabled = false
6830 Icon(button,icon)
6831 end
6832 end}
6833 return button
6834 end
6835
6836 --local clipboard = {}
6837 local function delete(o)
6838 o.Parent = nil
6839 end
6840
6841 makeButton(ACTION_EDITQUICKACCESS,ACTION_EDITQUICKACCESS,"Options",true,function()return true end).MouseButton1Click:connect(function()
6842
6843 end)
6844
6845
6846 -- DELETE
6847 makeButton(ACTION_DELETE,ACTION_DELETE_OVER,"Delete",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
6848 if not Option.Modifiable then return end
6849 local list = Selection:Get()
6850 for i = 1,#list do
6851 pcall(delete,list[i])
6852 end
6853 Selection:Set({})
6854 end)
6855
6856 -- PASTE
6857 makeButton(ACTION_PASTE,ACTION_PASTE_OVER,"Paste",true,function() return #Selection:Get() > 0 and #clipboard > 0 end).MouseButton1Click:connect(function()
6858 if not Option.Modifiable then return end
6859 local parent = Selection.List[1] or workspace
6860 for i = 1,#clipboard do
6861 clipboard[i]:Clone().Parent = parent
6862 end
6863 end)
6864
6865 -- COPY
6866 makeButton(ACTION_COPY,ACTION_COPY_OVER,"Copy",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
6867 if not Option.Modifiable then return end
6868 clipboard = {}
6869 local list = Selection.List
6870 for i = 1,#list do
6871 table.insert(clipboard,list[i]:Clone())
6872 end
6873 updateActions()
6874 end)
6875
6876 -- CUT
6877 makeButton(ACTION_CUT,ACTION_CUT_OVER,"Cut",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
6878 if not Option.Modifiable then return end
6879 clipboard = {}
6880 local list = Selection.List
6881 local cut = {}
6882 for i = 1,#list do
6883 local obj = list[i]:Clone()
6884 if obj then
6885 table.insert(clipboard,obj)
6886 table.insert(cut,list[i])
6887 end
6888 end
6889 for i = 1,#cut do
6890 pcall(delete,cut[i])
6891 end
6892 updateActions()
6893 end)
6894
6895 -- FREEZE
6896 makeButton(ACTION_FREEZE,ACTION_FREEZE,"Freeze",true,function() return true end)
6897
6898 -- ADD/REMOVE STARRED
6899 makeButton(ACTION_ADDSTAR,ACTION_ADDSTAR_OVER,"Star",true,function() return #Selection:Get() > 0 end)
6900
6901 -- STARRED
6902 makeButton(ACTION_STARRED,ACTION_STARRED,"Starred",true,function() return true end)
6903
6904
6905 -- SORT
6906 -- local actionSort = makeButton(ACTION_SORT,ACTION_SORT_OVER,"Sort")
6907end
6908
6909----------------------------------------------------------------
6910----------------------------------------------------------------
6911----------------------------------------------------------------
6912----------------------------------------------------------------
6913---- Option Bindables
6914
6915do
6916 local optionCallback = {
6917 Modifiable = function(value)
6918 for i = 1,#actionButtons do
6919 actionButtons[i].Obj.Visible = value and Option.Selectable
6920 end
6921 cancelReparentDrag()
6922 end;
6923 Selectable = function(value)
6924 for i = 1,#actionButtons do
6925 actionButtons[i].Obj.Visible = value and Option.Modifiable
6926 end
6927 cancelSelectDrag()
6928 Selection:Set({})
6929 end;
6930 }
6931
6932 local bindSetOption = explorerPanel:FindFirstChild("SetOption")
6933 if not bindSetOption then
6934 bindSetOption = Create('BindableFunction',{Name = "SetOption"})
6935 bindSetOption.Parent = explorerPanel
6936 end
6937
6938 bindSetOption.OnInvoke = function(optionName,value)
6939 if optionCallback[optionName] then
6940 Option[optionName] = value
6941 optionCallback[optionName](value)
6942 end
6943 end
6944
6945 local bindGetOption = explorerPanel:FindFirstChild("GetOption")
6946 if not bindGetOption then
6947 bindGetOption = Create('BindableFunction',{Name = "GetOption"})
6948 bindGetOption.Parent = explorerPanel
6949 end
6950
6951 bindGetOption.OnInvoke = function(optionName)
6952 if optionName then
6953 return Option[optionName]
6954 else
6955 local options = {}
6956 for k,v in pairs(Option) do
6957 options[k] = v
6958 end
6959 return options
6960 end
6961 end
6962end
6963
6964function SelectionVar()
6965 return Selection
6966end
6967
6968Input.InputBegan:connect(function(key)
6969 if key.KeyCode == Enum.KeyCode.LeftControl then
6970 HoldingCtrl = true
6971 end
6972 if key.KeyCode == Enum.KeyCode.LeftShift then
6973 HoldingShift = true
6974 end
6975end)
6976
6977Input.InputEnded:connect(function(key)
6978 if key.KeyCode == Enum.KeyCode.LeftControl then
6979 HoldingCtrl = false
6980 end
6981 if key.KeyCode == Enum.KeyCode.LeftShift then
6982 HoldingShift = false
6983 end
6984end)
6985
6986while RbxApi == nil do
6987 RbxApi = GetApiRemote:Invoke()
6988 wait()
6989end
6990
6991explorerFilter.FocusLost:connect(function()
6992 rawUpdateList()
6993end)
6994
6995--[[local lastType = 0
6996
6997explorerFilter.Changed:connect(function(prop)
6998 if prop == "Text" then
6999 if tick() - lastType > 1 then
7000 rawUpdateList()
7001 end
7002 lastType = tick()
7003 end
7004end)]]
7005
7006CurrentInsertObjectWindow = CreateInsertObjectMenu(
7007 GetClasses(),
7008 "",
7009 false,
7010 function(option)
7011 CurrentInsertObjectWindow.Visible = false
7012 local list = SelectionVar():Get()
7013 for i = 1,#list do
7014 pcall(function() Instance.new(option,list[i]) end)
7015 end
7016 DestroyRightClick()
7017 end
7018)
7019end)
7020spawn(function()
7021 --[[
7022
7023Change log:
7024
702509/18
7026 Fixed checkbox mouseover sprite
7027 Encapsulated checkbox creation into separate method
7028 Fixed another checkbox issue
7029
703009/15
7031 Invalid input is ignored instead of setting to default of that data type
7032 Consolidated control methods and simplified them
7033 All input goes through ToValue method
7034 Fixed position of BrickColor palette
7035 Made DropDown appear above row if it would otherwise exceed the page height
7036 Cleaned up stylesheets
7037
703809/14
7039 Made properties window scroll when mouse wheel scrolled
7040 Object/Instance and Color3 data types handled properly
7041 Multiple BrickColor controls interfering with each other fixed
7042 Added support for Content data type
7043
7044--]]
7045
7046wait(0.2)
7047
7048-- Services
7049local Teams = game:GetService("Teams")
7050local Workspace = game:GetService("Workspace")
7051local Debris = game:GetService("Debris")
7052local ContentProvider = game:GetService("ContentProvider")
7053local Players = game:GetService("Players")
7054local ReplicatedStorage = game:GetService("ReplicatedStorage")
7055
7056-- Functions
7057function httpGet(url)
7058 return game:HttpGet(url,true)
7059end
7060
7061-- RbxApi Stuff
7062local maxChunkSize = 100 * 1000
7063local ApiJson
7064if script:FindFirstChild("RawApiJson") then
7065 ApiJson = script.RawApiJson
7066else
7067 ApiJson = ""
7068end
7069
7070
7071
7072function getCurrentApiJson()
7073 return game:HttpGet("https://anaminus.github.io/rbx/json/api/latest.json", true);
7074end
7075
7076function splitStringIntoChunks(jsonStr)
7077 -- Splits up a string into a table with a given size
7078 local t = {}
7079 for i = 1, math.ceil(string.len(jsonStr)/maxChunkSize) do
7080 local str = jsonStr:sub((i-1)*maxChunkSize+1, i*maxChunkSize)
7081 table.insert(t, str)
7082 end
7083 return t
7084end
7085
7086local jsonToParse = getCurrentApiJson()
7087local apiChunks = splitStringIntoChunks(jsonToParse)
7088
7089function getRbxApi()
7090--[[
7091 Api.Classes
7092 Api.Enums
7093 Api.GetProperties(className)
7094 Api.IsEnum(valueType)
7095--]]
7096
7097-- Services
7098local HttpService = game:GetService("HttpService")
7099local ReplicatedStorage = game:GetService("ReplicatedStorage")
7100
7101-- Remotes
7102--local Remotes = ReplicatedStorage:WaitForChild("OnlineStudio"):WaitForChild("Remotes")
7103--local GetApiJsonFunction = Remotes:WaitForChild("GetApiJson")
7104
7105-- Functions
7106local JsonDecode = function(s) return HttpService:JSONDecode(s) end
7107
7108local function GetApiRemoteFunction(index)
7109 if (apiChunks[index]) then
7110 return apiChunks[index], #apiChunks
7111 else
7112 return nil
7113 end
7114end
7115
7116local function getApiJson()
7117 local apiTable = {}
7118 local firstPage, pageCount = GetApiRemoteFunction(1)
7119 table.insert(apiTable, firstPage)
7120 for i = 2, pageCount do
7121 --print("Fetching API page # " .. tostring(i))
7122 local result = GetApiRemoteFunction(i)
7123 table.insert(apiTable, result)
7124 end
7125 return table.concat(apiTable)
7126end
7127
7128local json = getApiJson()
7129local apiDump = JsonDecode(json)
7130
7131local Classes = {}
7132local Enums = {}
7133
7134local function sortAlphabetic(t, property)
7135 table.sort(t,
7136 function(x,y) return x[property] < y[property]
7137 end)
7138end
7139
7140local function isEnum(name)
7141 return Enums[name] ~= nil
7142end
7143
7144local function getProperties(className)
7145 local class = Classes[className]
7146 local properties = {}
7147
7148 if not class then return properties end
7149
7150 while class do
7151 for _,property in pairs(class.Properties) do
7152 table.insert(properties, property)
7153 end
7154 class = Classes[class.Superclass]
7155 end
7156
7157 sortAlphabetic(properties, "Name")
7158
7159 return properties
7160end
7161
7162for _,item in pairs(apiDump) do
7163 local itemType = item.type
7164-- Classes --
7165 if (itemType == 'Class') then
7166 Classes[item.Name] = item
7167 item.Properties = {}
7168 item.Functions = {}
7169 item.YieldFunctions = {}
7170 item.Events = {}
7171 item.Callbacks = {}
7172-- Members --
7173 elseif (itemType == 'Property') then
7174 table.insert(Classes[item.Class].Properties, item)
7175 elseif (itemType == 'Function') then
7176 table.insert(Classes[item.Class].Functions, item)
7177 elseif (itemType == 'YieldFunction') then
7178 table.insert(Classes[item.Class].YieldFunctions, item)
7179 elseif (itemType == 'Event') then
7180 table.insert(Classes[item.Class].Events, item)
7181 elseif (itemType == 'Callback') then
7182 table.insert(Classes[item.Class].Callbacks, item)
7183-- Enums --
7184 elseif (itemType == 'Enum') then
7185 Enums[item.Name] = item
7186 item.EnumItems = {}
7187 elseif (itemType == 'EnumItem') then
7188 Enums[item.Enum].EnumItems[item.Name] = item
7189 end
7190end
7191
7192return {
7193 Classes = Classes;
7194 Enums = Enums;
7195 GetProperties = getProperties;
7196 IsEnum = isEnum;
7197}
7198end
7199
7200-- Modules
7201local Permissions = {CanEdit = true}
7202local RbxApi = getRbxApi()
7203
7204--[[
7205 RbxApi.Classes
7206 RbxApi.Enums
7207 RbxApi.GetProperties(className)
7208 RbxApi.IsEnum(valueType)
7209--]]
7210
7211-- Styles
7212
7213local function CreateColor3(r, g, b) return Color3.new(r/255,g/255,b/255) end
7214
7215local Styles = {
7216 Font = Enum.Font.Arial;
7217 Margin = 5;
7218 Black = CreateColor3(0,0,0);
7219 White = CreateColor3(32,32,32);
7220}
7221
7222local Row = {
7223 Font = Styles.Font;
7224 FontSize = Enum.FontSize.Size14;
7225 TextXAlignment = Enum.TextXAlignment.Left;
7226 TextColor = Color3.fromRGB(244,244,244);
7227 TextColorOver = Color3.fromRGB(244,244,244);
7228 TextLockedColor = CreateColor3(230,230,230);
7229 Height = 24;
7230 BorderColor = CreateColor3(216/4,216/4,216/4);
7231 BackgroundColor = Styles.White;
7232 BackgroundColorAlternate = CreateColor3(32, 32, 32);
7233 BackgroundColorMouseover = CreateColor3(40, 40, 40);
7234 TitleMarginLeft = 15;
7235}
7236
7237local DropDown = {
7238 Font = Styles.Font;
7239 FontSize = Enum.FontSize.Size14;
7240 TextColor = CreateColor3(255,255,255);
7241 TextColorOver = Color3.new(1, 1, 1);
7242 TextXAlignment = Enum.TextXAlignment.Left;
7243 Height = 16;
7244 BackColor = Styles.White;
7245 BackColorOver = CreateColor3(0, 170, 255);
7246 BorderColor = CreateColor3(45,45,45);
7247 BorderSizePixel = 2;
7248 ArrowColor = CreateColor3(160/2,160/2,160/2);
7249 ArrowColorOver = Styles.Black;
7250}
7251
7252local BrickColors = {
7253 BoxSize = 13;
7254 BorderSizePixel = 1;
7255 BorderColor = CreateColor3(160,160,160);
7256 FrameColor = CreateColor3(160,160,160);
7257 Size = 20;
7258 Padding = 4;
7259 ColorsPerRow = 8;
7260 OuterBorder = 1;
7261 OuterBorderColor = Styles.Black;
7262}
7263
7264wait(1)
7265
7266local Gui = D_E_X
7267local PropertiesFrame = Gui:WaitForChild("PropertiesFrame")
7268local ExplorerFrame = Gui:WaitForChild("ExplorerPanel")
7269
7270local bindGetSelection = ExplorerFrame.GetSelection
7271local bindSelectionChanged = ExplorerFrame.SelectionChanged
7272local bindGetApi = PropertiesFrame.GetApi
7273local bindGetAwait = PropertiesFrame.GetAwaiting
7274local bindSetAwait = PropertiesFrame.SetAwaiting
7275
7276local ContentUrl = ContentProvider.BaseUrl .. "asset/?id="
7277
7278local SettingsRemote = Gui:WaitForChild("SettingsPanel"):WaitForChild("GetSetting")
7279
7280local propertiesSearch = PropertiesFrame.Header.TextBox
7281
7282local AwaitingObjectValue = false
7283local AwaitingObjectObj
7284local AwaitingObjectProp
7285
7286function searchingProperties()
7287 if propertiesSearch.Text ~= "" and propertiesSearch.Text ~= "Search Properties" then
7288 return true
7289 end
7290 return false
7291end
7292
7293local function GetSelection()
7294 local selection = bindGetSelection:Invoke()
7295 if #selection == 0 then
7296 return nil
7297 else
7298 return selection
7299 end
7300end
7301
7302-- Number
7303
7304local function Round(number, decimalPlaces)
7305 return tonumber(string.format("%." .. (decimalPlaces or 0) .. "f", number))
7306end
7307
7308-- Strings
7309
7310local function Split(str, delimiter)
7311 local start = 1
7312 local t = {}
7313 while true do
7314 local pos = string.find (str, delimiter, start, true)
7315 if not pos then
7316 break
7317 end
7318 table.insert (t, string.sub (str, start, pos - 1))
7319 start = pos + string.len (delimiter)
7320 end
7321 table.insert (t, string.sub (str, start))
7322 return t
7323end
7324
7325-- Data Type Handling
7326
7327local function ToString(value, type)
7328 if type == "float" then
7329 return tostring(Round(value,2))
7330 elseif type == "Content" then
7331 if string.find(value,"/asset") then
7332 local match = string.find(value, "=") + 1
7333 local id = string.sub(value, match)
7334 return id
7335 else
7336 return tostring(value)
7337 end
7338 elseif type == "Vector2" then
7339 local x = value.x
7340 local y = value.y
7341 return string.format("%g, %g", x,y)
7342 elseif type == "Vector3" then
7343 local x = value.x
7344 local y = value.y
7345 local z = value.z
7346 return string.format("%g, %g, %g", x,y,z)
7347 elseif type == "Color3" then
7348 local r = value.r
7349 local g = value.g
7350 local b = value.b
7351 return string.format("%d, %d, %d", r*255,g*255,b*255)
7352 elseif type == "UDim2" then
7353 local xScale = value.X.Scale
7354 local xOffset = value.X.Offset
7355 local yScale = value.Y.Scale
7356 local yOffset = value.Y.Offset
7357 return string.format("{%d, %d}, {%d, %d}", xScale, xOffset, yScale, yOffset)
7358 else
7359 return tostring(value)
7360 end
7361end
7362
7363local function ToValue(value,type)
7364 if type == "Vector2" then
7365 local list = Split(value,",")
7366 if #list < 2 then return nil end
7367 local x = tonumber(list[1]) or 0
7368 local y = tonumber(list[2]) or 0
7369 return Vector2.new(x,y)
7370 elseif type == "Vector3" then
7371 local list = Split(value,",")
7372 if #list < 3 then return nil end
7373 local x = tonumber(list[1]) or 0
7374 local y = tonumber(list[2]) or 0
7375 local z = tonumber(list[3]) or 0
7376 return Vector3.new(x,y,z)
7377 elseif type == "Color3" then
7378 local list = Split(value,",")
7379 if #list < 3 then return nil end
7380 local r = tonumber(list[1]) or 0
7381 local g = tonumber(list[2]) or 0
7382 local b = tonumber(list[3]) or 0
7383 return Color3.new(r/255,g/255, b/255)
7384 elseif type == "UDim2" then
7385 local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
7386 if #list < 4 then return nil end
7387 local xScale = tonumber(list[1]) or 0
7388 local xOffset = tonumber(list[2]) or 0
7389 local yScale = tonumber(list[3]) or 0
7390 local yOffset = tonumber(list[4]) or 0
7391 return UDim2.new(xScale, xOffset, yScale, yOffset)
7392 elseif type == "Content" then
7393 if tonumber(value) ~= nil then
7394 value = ContentUrl .. value
7395 end
7396 return value
7397 elseif type == "float" or type == "int" or type == "double" then
7398 return tonumber(value)
7399 elseif type == "string" then
7400 return value
7401 elseif type == "NumberRange" then
7402 local list = Split(value,",")
7403 if #list == 1 then
7404 if tonumber(list[1]) == nil then return nil end
7405 local newVal = tonumber(list[1]) or 0
7406 return NumberRange.new(newVal)
7407 end
7408 if #list < 2 then return nil end
7409 local x = tonumber(list[1]) or 0
7410 local y = tonumber(list[2]) or 0
7411 return NumberRange.new(x,y)
7412 else
7413 return nil
7414 end
7415end
7416
7417
7418-- Tables
7419
7420local function CopyTable(T)
7421 local t2 = {}
7422 for k,v in pairs(T) do
7423 t2[k] = v
7424 end
7425 return t2
7426end
7427
7428local function SortTable(T)
7429 table.sort(T,
7430 function(x,y) return x.Name < y.Name
7431 end)
7432end
7433
7434-- Spritesheet
7435local Sprite = {
7436 Width = 13;
7437 Height = 13;
7438}
7439
7440local Spritesheet = {
7441 Image = "http://www.roblox.com/asset/?id=128896947";
7442 Height = 256;
7443 Width = 256;
7444}
7445
7446local Images = {
7447 "unchecked",
7448 "checked",
7449 "unchecked_over",
7450 "checked_over",
7451 "unchecked_disabled",
7452 "checked_disabled"
7453}
7454
7455local function SpritePosition(spriteName)
7456 local x = 0
7457 local y = 0
7458 for i,v in pairs(Images) do
7459 if (v == spriteName) then
7460 return {x, y}
7461 end
7462 x = x + Sprite.Height
7463 if (x + Sprite.Width) > Spritesheet.Width then
7464 x = 0
7465 y = y + Sprite.Height
7466 end
7467 end
7468end
7469
7470local function GetCheckboxImageName(checked, readOnly, mouseover)
7471 if checked then
7472 if readOnly then
7473 return "checked_disabled"
7474 elseif mouseover then
7475 return "checked_over"
7476 else
7477 return "checked"
7478 end
7479 else
7480 if readOnly then
7481 return "unchecked_disabled"
7482 elseif mouseover then
7483 return "unchecked_over"
7484 else
7485 return "unchecked"
7486 end
7487 end
7488end
7489
7490local MAP_ID = 418720155
7491
7492-- Gui Controls --
7493
7494---- IconMap ----
7495-- Image size: 256px x 256px
7496-- Icon size: 16px x 16px
7497-- Padding between each icon: 2px
7498-- Padding around image edge: 1px
7499-- Total icons: 14 x 14 (196)
7500local Icon do
7501 local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID
7502 game:GetService('ContentProvider'):Preload(iconMap)
7503 local iconDehash do
7504 -- 14 x 14, 0-based input, 0-based output
7505 local f=math.floor
7506 function iconDehash(h)
7507 return f(h/14%14),f(h%14)
7508 end
7509 end
7510
7511 function Icon(IconFrame,index)
7512 local row,col = iconDehash(index)
7513 local mapSize = Vector2.new(256,256)
7514 local pad,border = 2,1
7515 local iconSize = 16
7516
7517 local class = 'Frame'
7518 if type(IconFrame) == 'string' then
7519 class = IconFrame
7520 IconFrame = nil
7521 end
7522
7523 if not IconFrame then
7524 IconFrame = Create(class,{
7525 Name = "Icon";
7526 BackgroundTransparency = 1;
7527 ClipsDescendants = true;
7528 Create('ImageLabel',{
7529 Name = "IconMap";
7530 Active = false;
7531 BackgroundTransparency = 1;
7532 Image = iconMap;
7533 Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0);
7534 });
7535 })
7536 end
7537
7538 IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0)
7539 return IconFrame
7540 end
7541end
7542
7543local function CreateCell()
7544 local tableCell = Instance.new("Frame")
7545 tableCell.Size = UDim2.new(0.5, -1, 1, 0)
7546 tableCell.BackgroundColor3 = Row.BackgroundColor
7547 tableCell.BorderColor3 = Row.BorderColor
7548 return tableCell
7549end
7550
7551local function CreateLabel(readOnly)
7552 local label = Instance.new("TextLabel")
7553 label.Font = Row.Font
7554 label.FontSize = Row.FontSize
7555 label.TextXAlignment = Row.TextXAlignment
7556 label.BackgroundTransparency = 1
7557
7558 if readOnly then
7559 label.TextColor3 = Row.TextLockedColor
7560 else
7561 label.TextColor3 = Row.TextColor
7562 end
7563 return label
7564end
7565
7566local function CreateTextButton(readOnly, onClick)
7567 local button = Instance.new("TextButton")
7568 button.Font = Row.Font
7569 button.FontSize = Row.FontSize
7570 button.TextXAlignment = Row.TextXAlignment
7571 button.BackgroundTransparency = 1
7572 if readOnly then
7573 button.TextColor3 = Row.TextLockedColor
7574 else
7575 button.TextColor3 = Row.TextColor
7576 button.MouseButton1Click:connect(function()
7577 onClick()
7578 end)
7579 end
7580 return button
7581end
7582
7583local function CreateObject(readOnly)
7584 local button = Instance.new("TextButton")
7585 button.Font = Row.Font
7586 button.FontSize = Row.FontSize
7587 button.TextXAlignment = Row.TextXAlignment
7588 button.BackgroundTransparency = 1
7589 if readOnly then
7590 button.TextColor3 = Row.TextLockedColor
7591 else
7592 button.TextColor3 = Row.TextColor
7593 end
7594 local cancel = Create(Icon('ImageButton',177),{
7595 Name = "Cancel";
7596 Visible = false;
7597 Position = UDim2.new(1,-20,0,0);
7598 Size = UDim2.new(0,20,0,20);
7599 Parent = button;
7600 })
7601 return button
7602end
7603
7604local function CreateTextBox(readOnly)
7605 if readOnly then
7606 local box = CreateLabel(readOnly)
7607 return box
7608 else
7609 local box = Instance.new("TextBox")
7610 if not SettingsRemote:Invoke("ClearProps") then
7611 box.ClearTextOnFocus = false
7612 end
7613 box.Font = Row.Font
7614 box.FontSize = Row.FontSize
7615 box.TextXAlignment = Row.TextXAlignment
7616 box.BackgroundTransparency = 1
7617 box.TextColor3 = Row.TextColor
7618 return box
7619 end
7620end
7621
7622local function CreateDropDownItem(text, onClick)
7623 local button = Instance.new("TextButton")
7624 button.Font = DropDown.Font
7625 button.FontSize = DropDown.FontSize
7626 button.TextColor3 = DropDown.TextColor
7627 button.TextXAlignment = DropDown.TextXAlignment
7628 button.BackgroundColor3 = DropDown.BackColor
7629 button.AutoButtonColor = false
7630 button.BorderSizePixel = 0
7631 button.Active = true
7632 button.Text = text
7633
7634 button.MouseEnter:connect(function()
7635 button.TextColor3 = DropDown.TextColorOver
7636 button.BackgroundColor3 = DropDown.BackColorOver
7637 end)
7638 button.MouseLeave:connect(function()
7639 button.TextColor3 = DropDown.TextColor
7640 button.BackgroundColor3 = DropDown.BackColor
7641 end)
7642 button.MouseButton1Click:connect(function()
7643 onClick(text)
7644 end)
7645 return button
7646end
7647
7648local function CreateDropDown(choices, currentChoice, readOnly, onClick)
7649 local frame = Instance.new("Frame")
7650 frame.Name = "DropDown"
7651 frame.Size = UDim2.new(1, 0, 1, 0)
7652 frame.BackgroundTransparency = 1
7653 frame.Active = true
7654
7655 local menu = nil
7656 local arrow = nil
7657 local expanded = false
7658 local margin = DropDown.BorderSizePixel;
7659
7660 local button = Instance.new("TextButton")
7661 button.Font = Row.Font
7662 button.FontSize = Row.FontSize
7663 button.TextXAlignment = Row.TextXAlignment
7664 button.BackgroundTransparency = 1
7665 button.TextColor3 = Row.TextColor
7666 if readOnly then
7667 button.TextColor3 = Row.TextLockedColor
7668 end
7669 button.Text = currentChoice
7670 button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
7671 button.Position = UDim2.new(0, Styles.Margin, 0, 0)
7672 button.Parent = frame
7673
7674 local function showArrow(color)
7675 if arrow then arrow:Destroy() end
7676
7677 local graphicTemplate = Create('Frame',{
7678 Name="Graphic";
7679 BorderSizePixel = 0;
7680 BackgroundColor3 = Color3.new(1, 1, 1);
7681 })
7682 local graphicSize = 16/2
7683
7684 arrow = ArrowGraphic(graphicSize,'Down',true,graphicTemplate)
7685 arrow.Position = UDim2.new(1,-graphicSize * 2,0.5,-graphicSize/2)
7686 arrow.Parent = frame
7687 end
7688
7689 local function hideMenu()
7690 expanded = false
7691 showArrow(DropDown.ArrowColor)
7692 if menu then menu:Destroy() end
7693 end
7694
7695 local function showMenu()
7696 expanded = true
7697 menu = Instance.new("Frame")
7698 menu.Size = UDim2.new(1, -2 * margin, 0, #choices * DropDown.Height)
7699 menu.Position = UDim2.new(0, margin, 0, Row.Height + margin)
7700 menu.BackgroundTransparency = 0
7701 menu.BackgroundColor3 = DropDown.BackColor
7702 menu.BorderColor3 = DropDown.BorderColor
7703 menu.BorderSizePixel = DropDown.BorderSizePixel
7704 menu.Active = true
7705 menu.ZIndex = 5
7706 menu.Parent = frame
7707
7708 local parentFrameHeight = menu.Parent.Parent.Parent.Parent.Size.Y.Offset
7709 local rowHeight = menu.Parent.Parent.Parent.Position.Y.Offset
7710 if (rowHeight + menu.Size.Y.Offset) > math.max(parentFrameHeight,PropertiesFrame.AbsoluteSize.y) then
7711 menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin)
7712 end
7713
7714 local function choice(name)
7715 onClick(name)
7716 hideMenu()
7717 end
7718
7719 for i,name in pairs(choices) do
7720 local option = CreateDropDownItem(name, function()
7721 choice(name)
7722 end)
7723 option.Size = UDim2.new(1, 0, 0, 16)
7724 option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height)
7725 option.ZIndex = menu.ZIndex
7726 option.Parent = menu
7727 end
7728 end
7729
7730 showArrow(DropDown.ArrowColor)
7731
7732 if not readOnly then
7733
7734 button.MouseEnter:connect(function()
7735 button.TextColor3 = Row.TextColor
7736 end)
7737 button.MouseLeave:connect(function()
7738 button.TextColor3 = Row.TextColor
7739 end)
7740 button.MouseButton1Click:connect(function()
7741 if expanded then
7742 hideMenu()
7743 else
7744 showMenu()
7745 end
7746 end)
7747 end
7748
7749 return frame,button
7750end
7751
7752local function CreateBrickColor(readOnly, onClick)
7753 local frame = Instance.new("Frame")
7754 frame.Size = UDim2.new(1,0,1,0)
7755 frame.BackgroundTransparency = 1
7756
7757 local colorPalette = Instance.new("Frame")
7758 colorPalette.BackgroundTransparency = 0
7759 colorPalette.SizeConstraint = Enum.SizeConstraint.RelativeXX
7760 colorPalette.Size = UDim2.new(1, -2 * BrickColors.OuterBorder, 1, -2 * BrickColors.OuterBorder)
7761 colorPalette.BorderSizePixel = BrickColors.BorderSizePixel
7762 colorPalette.BorderColor3 = BrickColors.BorderColor
7763 colorPalette.Position = UDim2.new(0, BrickColors.OuterBorder, 0, BrickColors.OuterBorder + Row.Height)
7764 colorPalette.ZIndex = 5
7765 colorPalette.Visible = false
7766 colorPalette.BorderSizePixel = BrickColors.OuterBorder
7767 colorPalette.BorderColor3 = BrickColors.OuterBorderColor
7768 colorPalette.Parent = frame
7769
7770 local function show()
7771 colorPalette.Visible = true
7772 end
7773
7774 local function hide()
7775 colorPalette.Visible = false
7776 end
7777
7778 local function toggle()
7779 colorPalette.Visible = not colorPalette.Visible
7780 end
7781
7782 local colorBox = Instance.new("TextButton", frame)
7783 colorBox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
7784 colorBox.Size = UDim2.new(0, BrickColors.BoxSize, 0, BrickColors.BoxSize)
7785 colorBox.Text = ""
7786 colorBox.MouseButton1Click:connect(function()
7787 if not readOnly then
7788 toggle()
7789 end
7790 end)
7791
7792 if readOnly then
7793 colorBox.AutoButtonColor = false
7794 end
7795
7796 local spacingBefore = (Styles.Margin * 2) + BrickColors.BoxSize
7797
7798 local propertyLabel = CreateTextButton(readOnly, function()
7799 if not readOnly then
7800 toggle()
7801 end
7802 end)
7803 propertyLabel.Size = UDim2.new(1, (-1 * spacingBefore) - Styles.Margin, 1, 0)
7804 propertyLabel.Position = UDim2.new(0, spacingBefore, 0, 0)
7805 propertyLabel.Parent = frame
7806
7807 local size = (1 / BrickColors.ColorsPerRow)
7808
7809 for index = 0, 127 do
7810 local brickColor = BrickColor.palette(index)
7811 local color3 = brickColor.Color
7812
7813 local x = size * (index % BrickColors.ColorsPerRow)
7814 local y = size * math.floor(index / BrickColors.ColorsPerRow)
7815
7816 local brickColorBox = Instance.new("TextButton")
7817 brickColorBox.Text = ""
7818 brickColorBox.Size = UDim2.new(size,0,size,0)
7819 brickColorBox.BackgroundColor3 = color3
7820 brickColorBox.Position = UDim2.new(x, 0, y, 0)
7821 brickColorBox.ZIndex = colorPalette.ZIndex
7822 brickColorBox.Parent = colorPalette
7823
7824 brickColorBox.MouseButton1Click:connect(function()
7825 hide()
7826 onClick(brickColor)
7827 end)
7828 end
7829
7830 return frame,propertyLabel,colorBox
7831end
7832
7833local function CreateColor3Control(readOnly, onClick)
7834 local frame = Instance.new("Frame")
7835 frame.Size = UDim2.new(1,0,1,0)
7836 frame.BackgroundTransparency = 1
7837
7838 local colorBox = Instance.new("TextButton", frame)
7839 colorBox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
7840 colorBox.Size = UDim2.new(0, BrickColors.BoxSize, 0, BrickColors.BoxSize)
7841 colorBox.Text = ""
7842 colorBox.AutoButtonColor = false
7843
7844 local spacingBefore = (Styles.Margin * 2) + BrickColors.BoxSize
7845 local box = CreateTextBox(readOnly)
7846 box.Size = UDim2.new(1, (-1 * spacingBefore) - Styles.Margin, 1, 0)
7847 box.Position = UDim2.new(0, spacingBefore, 0, 0)
7848 box.Parent = frame
7849
7850 return frame,box,colorBox
7851end
7852
7853function CreateCheckbox(value, readOnly, onClick)
7854 local checked = value
7855 local mouseover = false
7856
7857 local checkboxFrame = Instance.new("ImageButton")
7858 checkboxFrame.Size = UDim2.new(0, Sprite.Width, 0, Sprite.Height)
7859 checkboxFrame.BackgroundTransparency = 1
7860 checkboxFrame.ClipsDescendants = true
7861 --checkboxFrame.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
7862
7863 local spritesheetImage = Instance.new("Frame", checkboxFrame);
7864 spritesheetImage.Name = "SpritesheetImageLabel";
7865 spritesheetImage.Size = UDim2.new(0, Spritesheet.Width, 0, Spritesheet.Height);
7866 spritesheetImage.BorderSizePixel = 0;
7867 spritesheetImage.BackgroundColor3 = Color3.fromRGB(113, 45, 59);
7868
7869 local checkedImage = Instance.new("Frame", checkboxFrame);
7870 checkedImage.Name = "CheckedImageLabel";
7871 checkedImage.AnchorPoint = Vector2.new(0.5, 0.5);
7872 checkedImage.Position = UDim2.new(0.5, 0, 0.5, 0);
7873 checkedImage.Size = UDim2.new(0, 9, 0, 9);
7874 checkedImage.BorderSizePixel = 0;
7875 checkedImage.BackgroundColor3 = Color3.fromRGB(0, 170, 255);
7876 checkedImage.Visible = checked;
7877
7878 local function updateSprite()
7879 checkedImage.Visible = checked;
7880 end
7881
7882 local function setValue(val)
7883 checked = val
7884 updateSprite()
7885 end
7886
7887 if not readOnly then
7888 --checkboxFrame.MouseEnter:connect(function() mouseover = true updateSprite() end)
7889 --checkboxFrame.MouseLeave:connect(function() mouseover = false updateSprite() end)
7890 checkboxFrame.MouseButton1Click:connect(function()
7891 onClick(checked)
7892 end)
7893 end
7894
7895 updateSprite()
7896
7897 return checkboxFrame, setValue
7898end
7899
7900
7901
7902-- Code for handling controls of various data types --
7903
7904local Controls = {}
7905
7906Controls["default"] = function(object, propertyData, readOnly)
7907 local propertyName = propertyData["Name"]
7908 local propertyType = propertyData["ValueType"]
7909
7910 local box = CreateTextBox(readOnly)
7911 box.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
7912 box.Position = UDim2.new(0, Styles.Margin, 0, 0)
7913
7914 local function update()
7915 local value = object[propertyName]
7916 box.Text = ToString(value, propertyType)
7917 end
7918
7919 if not readOnly then
7920 box.FocusLost:connect(function(enterPressed)
7921 Set(object, propertyData, ToValue(box.Text,propertyType))
7922 update()
7923 end)
7924 end
7925
7926 update()
7927
7928 object.Changed:connect(function(property)
7929 if (property == propertyName) then
7930 update()
7931 end
7932 end)
7933
7934 return box
7935end
7936
7937Controls["bool"] = function(object, propertyData, readOnly)
7938 local propertyName = propertyData["Name"]
7939 local checked = object[propertyName]
7940
7941 local checkbox, setValue = CreateCheckbox(checked, readOnly, function(value)
7942 Set(object, propertyData, not checked)
7943 end)
7944 checkbox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
7945
7946 setValue(checked)
7947
7948 local function update()
7949 checked = object[propertyName]
7950 setValue(checked)
7951 end
7952
7953 object.Changed:connect(function(property)
7954 if (property == propertyName) then
7955 update()
7956 end
7957 end)
7958
7959 if object:IsA("BoolValue") then
7960 object.Changed:connect(function(val)
7961 update()
7962 end)
7963 end
7964
7965 update()
7966
7967 return checkbox
7968end
7969
7970Controls["BrickColor"] = function(object, propertyData, readOnly)
7971 local propertyName = propertyData["Name"]
7972
7973 local frame,label,brickColorBox = CreateBrickColor(readOnly, function(brickColor)
7974 Set(object, propertyData, brickColor)
7975 end)
7976
7977 local function update()
7978 local value = object[propertyName]
7979 brickColorBox.BackgroundColor3 = value.Color
7980 label.Text = tostring(value)
7981 end
7982
7983 update()
7984
7985 object.Changed:connect(function(property)
7986 if (property == propertyName) then
7987 update()
7988 end
7989 end)
7990
7991 return frame
7992end
7993
7994Controls["Color3"] = function(object, propertyData, readOnly)
7995 local propertyName = propertyData["Name"]
7996
7997 local frame,textBox,colorBox = CreateColor3Control(readOnly)
7998
7999 textBox.FocusLost:connect(function(enterPressed)
8000 Set(object, propertyData, ToValue(textBox.Text,"Color3"))
8001 local value = object[propertyName]
8002 colorBox.BackgroundColor3 = value
8003 textBox.Text = ToString(value, "Color3")
8004 end)
8005
8006 local function update()
8007 local value = object[propertyName]
8008 colorBox.BackgroundColor3 = value
8009 textBox.Text = ToString(value, "Color3")
8010 end
8011
8012 update()
8013
8014 object.Changed:connect(function(property)
8015 if (property == propertyName) then
8016 update()
8017 end
8018 end)
8019
8020 return frame
8021end
8022
8023Controls["Enum"] = function(object, propertyData, readOnly)
8024 local propertyName = propertyData["Name"]
8025 local propertyType = propertyData["ValueType"]
8026
8027 local enumName = object[propertyName].Name
8028
8029 local enumNames = {}
8030 for _,enum in pairs(Enum[tostring(propertyType)]:GetEnumItems()) do
8031 table.insert(enumNames, enum.Name)
8032 end
8033
8034 local dropdown, propertyLabel = CreateDropDown(enumNames, enumName, readOnly, function(value)
8035 Set(object, propertyData, value)
8036 end)
8037 --dropdown.Parent = frame
8038
8039 local function update()
8040 local value = object[propertyName].Name
8041 propertyLabel.Text = tostring(value)
8042 end
8043
8044 update()
8045
8046 object.Changed:connect(function(property)
8047 if (property == propertyName) then
8048 update()
8049 end
8050 end)
8051
8052 return dropdown
8053end
8054
8055Controls["Object"] = function(object, propertyData, readOnly)
8056 local propertyName = propertyData["Name"]
8057 local propertyType = propertyData["ValueType"]
8058
8059 local box = CreateObject(readOnly,function()end)
8060 box.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
8061 box.Position = UDim2.new(0, Styles.Margin, 0, 0)
8062
8063 local function update()
8064 if AwaitingObjectObj == object then
8065 if AwaitingObjectValue == true then
8066 box.Text = "Select an Object"
8067 return
8068 end
8069 end
8070 local value = object[propertyName]
8071 box.Text = ToString(value, propertyType)
8072 end
8073
8074 if not readOnly then
8075 box.MouseButton1Click:connect(function()
8076 if AwaitingObjectValue then
8077 AwaitingObjectValue = false
8078 update()
8079 return
8080 end
8081 AwaitingObjectValue = true
8082 AwaitingObjectObj = object
8083 AwaitingObjectProp = propertyData
8084 box.Text = "Select an Object"
8085 end)
8086
8087 box.Cancel.Visible = true
8088 box.Cancel.MouseButton1Click:connect(function()
8089 object[propertyName] = nil
8090 end)
8091 end
8092
8093 update()
8094
8095 object.Changed:connect(function(property)
8096 if (property == propertyName) then
8097 update()
8098 end
8099 end)
8100
8101 if object:IsA("ObjectValue") then
8102 object.Changed:connect(function(val)
8103 update()
8104 end)
8105 end
8106
8107 return box
8108end
8109
8110function GetControl(object, propertyData, readOnly)
8111 local propertyType = propertyData["ValueType"]
8112 local control = nil
8113
8114 if Controls[propertyType] then
8115 control = Controls[propertyType](object, propertyData, readOnly)
8116 elseif RbxApi.IsEnum(propertyType) then
8117 control = Controls["Enum"](object, propertyData, readOnly)
8118 else
8119 control = Controls["default"](object, propertyData, readOnly)
8120 end
8121 return control
8122end
8123-- Permissions
8124
8125function CanEditObject(object)
8126 local player = Players.LocalPlayer
8127 local character = player.Character
8128 return Permissions.CanEdit
8129end
8130
8131function CanEditProperty(object,propertyData)
8132 local tags = propertyData["tags"]
8133 for _,name in pairs(tags) do
8134 if name == "readonly" then
8135 return false
8136 end
8137 end
8138 return CanEditObject(object)
8139end
8140
8141--RbxApi
8142local function PropertyIsHidden(propertyData)
8143 local tags = propertyData["tags"]
8144 for _,name in pairs(tags) do
8145 if name == "deprecated"
8146 or name == "hidden"
8147 or name == "writeonly" then
8148 return true
8149 end
8150 end
8151 return false
8152end
8153
8154function Set(object, propertyData, value)
8155 local propertyName = propertyData["Name"]
8156 local propertyType = propertyData["ValueType"]
8157
8158 if value == nil then return end
8159
8160 for i,v in pairs(GetSelection()) do
8161 if CanEditProperty(v,propertyData) then
8162 pcall(function()
8163 --print("Setting " .. propertyName .. " to " .. tostring(value))
8164 v[propertyName] = value
8165 end)
8166 end
8167 end
8168end
8169
8170function CreateRow(object, propertyData, isAlternateRow)
8171 local propertyName = propertyData["Name"]
8172 local propertyType = propertyData["ValueType"]
8173 local propertyValue = object[propertyName]
8174 --rowValue, rowValueType, isAlternate
8175 local backColor = Row.BackgroundColor;
8176 if (isAlternateRow) then
8177 backColor = Row.BackgroundColorAlternate
8178 end
8179
8180 local readOnly = not CanEditProperty(object, propertyData)
8181 if propertyType == "Instance" or propertyName == "Parent" then readOnly = true end
8182
8183 local rowFrame = Instance.new("Frame")
8184 rowFrame.Size = UDim2.new(1,0,0,Row.Height)
8185 rowFrame.BackgroundTransparency = 1
8186 rowFrame.Name = 'Row'
8187
8188 local propertyLabelFrame = CreateCell()
8189 propertyLabelFrame.Parent = rowFrame
8190 propertyLabelFrame.ClipsDescendants = true
8191
8192 local propertyLabel = CreateLabel(readOnly)
8193 propertyLabel.Text = propertyName
8194 propertyLabel.Size = UDim2.new(1, -1 * Row.TitleMarginLeft, 1, 0)
8195 propertyLabel.Position = UDim2.new(0, Row.TitleMarginLeft, 0, 0)
8196 propertyLabel.Parent = propertyLabelFrame
8197
8198 local propertyValueFrame = CreateCell()
8199 propertyValueFrame.Size = UDim2.new(0.5, -1, 1, 0)
8200 propertyValueFrame.Position = UDim2.new(0.5, 0, 0, 0)
8201 propertyValueFrame.Parent = rowFrame
8202
8203 local control = GetControl(object, propertyData, readOnly)
8204 control.Parent = propertyValueFrame
8205
8206 rowFrame.MouseEnter:connect(function()
8207 propertyLabelFrame.BackgroundColor3 = Row.BackgroundColorMouseover
8208 propertyValueFrame.BackgroundColor3 = Row.BackgroundColorMouseover
8209 end)
8210 rowFrame.MouseLeave:connect(function()
8211 propertyLabelFrame.BackgroundColor3 = backColor
8212 propertyValueFrame.BackgroundColor3 = backColor
8213 end)
8214
8215 propertyLabelFrame.BackgroundColor3 = backColor
8216 propertyValueFrame.BackgroundColor3 = backColor
8217
8218 return rowFrame
8219end
8220
8221function ClearPropertiesList()
8222 for _,instance in pairs(ContentFrame:GetChildren()) do
8223 instance:Destroy()
8224 end
8225end
8226
8227local selection = Gui:FindFirstChild("Selection", 1)
8228
8229function displayProperties(props)
8230 for i,v in pairs(props) do
8231 pcall(function()
8232 local a = CreateRow(v.object, v.propertyData, ((numRows % 2) == 0))
8233 a.Position = UDim2.new(0,0,0,numRows*Row.Height)
8234 a.Parent = ContentFrame
8235 numRows = numRows + 1
8236 end)
8237 end
8238end
8239
8240function checkForDupe(prop,props)
8241 for i,v in pairs(props) do
8242 if v.propertyData.Name == prop.Name and v.propertyData.ValueType == prop.ValueType then
8243 return true
8244 end
8245 end
8246 return false
8247end
8248
8249function sortProps(t)
8250 table.sort(t,
8251 function(x,y) return x.propertyData.Name < y.propertyData.Name
8252 end)
8253end
8254
8255function showProperties(obj)
8256 ClearPropertiesList()
8257 if obj == nil then return end
8258 local propHolder = {}
8259 local foundProps = {}
8260 numRows = 0
8261 for _,nextObj in pairs(obj) do
8262 if not foundProps[nextObj.className] then
8263 foundProps[nextObj.className] = true
8264 for i,v in pairs(RbxApi.GetProperties(nextObj.className)) do
8265 local suc, err = pcall(function()
8266 if not (PropertyIsHidden(v)) and not checkForDupe(v,propHolder) then
8267 if string.find(string.lower(v.Name),string.lower(propertiesSearch.Text)) or not searchingProperties() then
8268 table.insert(propHolder,{propertyData = v, object = nextObj})
8269 end
8270 end
8271 end)
8272 --[[if not suc then
8273 warn("Problem getting the value of property " .. v.Name .. " | " .. err)
8274 end --]]
8275 end
8276 end
8277 end
8278 sortProps(propHolder)
8279 displayProperties(propHolder)
8280 ContentFrame.Size = UDim2.new(1, 0, 0, numRows * Row.Height)
8281 scrollBar.ScrollIndex = 0
8282 scrollBar.TotalSpace = numRows * Row.Height
8283 scrollBar.Update()
8284end
8285
8286----------------------------------------------------------------
8287-----------------------SCROLLBAR STUFF--------------------------
8288----------------------------------------------------------------
8289----------------------------------------------------------------
8290local ScrollBarWidth = 16
8291
8292local ScrollStyles = {
8293 Background = Color3.fromRGB(233, 233, 233);
8294 Border = Color3.fromRGB(149, 149, 149);
8295 Selected = Color3.fromRGB( 63, 119, 189);
8296 BorderSelected = Color3.fromRGB( 55, 106, 167);
8297 Text = Color3.fromRGB( 0, 0, 0);
8298 TextDisabled = Color3.fromRGB(128, 128, 128);
8299 TextSelected = Color3.fromRGB(255, 255, 255);
8300 Button = Color3.fromRGB( 35, 35, 35);
8301 ButtonBorder = Color3.fromRGB(149, 149, 149);
8302 ButtonSelected = Color3.fromRGB(255, 0, 0);
8303 Field = Color3.fromRGB(255, 255, 255);
8304 FieldBorder = Color3.fromRGB(191, 191, 191);
8305 TitleBackground = Color3.fromRGB(178, 178, 178);
8306}
8307do
8308 local ZIndexLock = {}
8309 function SetZIndex(object,z)
8310 if not ZIndexLock[object] then
8311 ZIndexLock[object] = true
8312 if object:IsA'GuiObject' then
8313 object.ZIndex = z
8314 end
8315 local children = object:GetChildren()
8316 for i = 1,#children do
8317 SetZIndex(children[i],z)
8318 end
8319 ZIndexLock[object] = nil
8320 end
8321 end
8322end
8323function SetZIndexOnChanged(object)
8324 return object.Changed:connect(function(p)
8325 if p == "ZIndex" then
8326 SetZIndex(object,object.ZIndex)
8327 end
8328 end)
8329end
8330function Create(ty,data)
8331 local obj
8332 if type(ty) == 'string' then
8333 obj = Instance.new(ty)
8334 else
8335 obj = ty
8336 end
8337 for k, v in pairs(data) do
8338 if type(k) == 'number' then
8339 v.Parent = obj
8340 else
8341 obj[k] = v
8342 end
8343 end
8344 return obj
8345end
8346-- returns the ascendant ScreenGui of an object
8347function GetScreen(screen)
8348 if screen == nil then return nil end
8349 while not screen:IsA("ScreenGui") do
8350 screen = screen.Parent
8351 if screen == nil then return nil end
8352 end
8353 return screen
8354end
8355-- AutoButtonColor doesn't always reset properly
8356function ResetButtonColor(button)
8357 local active = button.Active
8358 button.Active = not active
8359 button.Active = active
8360end
8361
8362function ArrowGraphic(size,dir,scaled,template)
8363 local Frame = Create('Frame',{
8364 Name = "Arrow Graphic";
8365 BorderSizePixel = 0;
8366 Size = UDim2.new(0,size,0,size);
8367 Transparency = 1;
8368 })
8369 if not template then
8370 template = Instance.new("Frame")
8371 template.BorderSizePixel = 0
8372 end
8373
8374 template.BackgroundColor3 = Color3.new(1, 1, 1);
8375
8376 local transform
8377 if dir == nil or dir == 'Up' then
8378 function transform(p,s) return p,s end
8379 elseif dir == 'Down' then
8380 function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
8381 elseif dir == 'Left' then
8382 function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
8383 elseif dir == 'Right' then
8384 function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
8385 end
8386
8387 local scale
8388 if scaled then
8389 function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
8390 else
8391 function scale(p,s) return p,s end
8392 end
8393
8394 local o = math.floor(size/4)
8395 if size%2 == 0 then
8396 local n = size/2-1
8397 for i = 0,n do
8398 local t = template:Clone()
8399 local p,s = scale(transform(
8400 UDim2.new(0,n-i,0,o+i),
8401 UDim2.new(0,(i+1)*2,0,1)
8402 ))
8403 t.Position = p
8404 t.Size = s
8405 t.Parent = Frame
8406 end
8407 else
8408 local n = (size-1)/2
8409 for i = 0,n do
8410 local t = template:Clone()
8411 local p,s = scale(transform(
8412 UDim2.new(0,n-i,0,o+i),
8413 UDim2.new(0,i*2+1,0,1)
8414 ))
8415 t.Position = p
8416 t.Size = s
8417 t.Parent = Frame
8418 end
8419 end
8420 if size%4 > 1 then
8421 local t = template:Clone()
8422 local p,s = scale(transform(
8423 UDim2.new(0,0,0,size-o-1),
8424 UDim2.new(0,size,0,1)
8425 ))
8426 t.Position = p
8427 t.Size = s
8428 t.Parent = Frame
8429 end
8430
8431 for i,v in pairs(Frame:GetChildren()) do
8432 v.BackgroundColor3 = Color3.new(1, 1, 1);
8433 end
8434
8435 return Frame
8436end
8437
8438function GripGraphic(size,dir,spacing,scaled,template)
8439 local Frame = Create('Frame',{
8440 Name = "Grip Graphic";
8441 BorderSizePixel = 0;
8442 Size = UDim2.new(0,size.x,0,size.y);
8443 Transparency = 1;
8444 })
8445 if not template then
8446 template = Instance.new("Frame")
8447 template.BorderSizePixel = 0
8448 end
8449
8450 spacing = spacing or 2
8451
8452 local scale
8453 if scaled then
8454 function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
8455 else
8456 function scale(p) return p end
8457 end
8458
8459 if dir == 'Vertical' then
8460 for i=0,size.x-1,spacing do
8461 local t = template:Clone()
8462 t.Size = scale(UDim2.new(0,1,0,size.y))
8463 t.Position = scale(UDim2.new(0,i,0,0))
8464 t.Parent = Frame
8465 end
8466 elseif dir == nil or dir == 'Horizontal' then
8467 for i=0,size.y-1,spacing do
8468 local t = template:Clone()
8469 t.Size = scale(UDim2.new(0,size.x,0,1))
8470 t.Position = scale(UDim2.new(0,0,0,i))
8471 t.Parent = Frame
8472 end
8473 end
8474
8475 return Frame
8476end
8477
8478do
8479 local mt = {
8480 __index = {
8481 GetScrollPercent = function(self)
8482 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
8483 end;
8484 CanScrollDown = function(self)
8485 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
8486 end;
8487 CanScrollUp = function(self)
8488 return self.ScrollIndex > 0
8489 end;
8490 ScrollDown = function(self)
8491 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
8492 self:Update()
8493 end;
8494 ScrollUp = function(self)
8495 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
8496 self:Update()
8497 end;
8498 ScrollTo = function(self,index)
8499 self.ScrollIndex = index
8500 self:Update()
8501 end;
8502 SetScrollPercent = function(self,percent)
8503 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
8504 self:Update()
8505 end;
8506 };
8507 }
8508 mt.__index.CanScrollRight = mt.__index.CanScrollDown
8509 mt.__index.CanScrollLeft = mt.__index.CanScrollUp
8510 mt.__index.ScrollLeft = mt.__index.ScrollUp
8511 mt.__index.ScrollRight = mt.__index.ScrollDown
8512
8513 function ScrollBar(horizontal)
8514 -- create row scroll bar
8515 local ScrollFrame = Create('Frame',{
8516 Name = "ScrollFrame";
8517 Position = horizontal and UDim2.new(0,0,1,-ScrollBarWidth) or UDim2.new(1,-ScrollBarWidth,0,0);
8518 Size = horizontal and UDim2.new(1,0,0,ScrollBarWidth) or UDim2.new(0,ScrollBarWidth,1,0);
8519 BackgroundTransparency = 1;
8520 Create('ImageButton',{
8521 Name = "ScrollDown";
8522 Position = horizontal and UDim2.new(1,-ScrollBarWidth,0,0) or UDim2.new(0,0,1,-ScrollBarWidth);
8523 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
8524 BackgroundColor3 = ScrollStyles.Button;
8525 BorderColor3 = ScrollStyles.Border;
8526 BorderSizePixel = 0;
8527 });
8528 Create('ImageButton',{
8529 Name = "ScrollUp";
8530 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
8531 BackgroundColor3 = ScrollStyles.Button;
8532 BorderColor3 = ScrollStyles.Border;
8533 BorderSizePixel = 0;
8534 });
8535 Create('ImageButton',{
8536 Name = "ScrollBar";
8537 Size = horizontal and UDim2.new(1,-ScrollBarWidth*2,1,0) or UDim2.new(1,0,1,-ScrollBarWidth*2);
8538 Position = horizontal and UDim2.new(0,ScrollBarWidth,0,0) or UDim2.new(0,0,0,ScrollBarWidth);
8539 AutoButtonColor = false;
8540 BackgroundColor3 = Color3.fromRGB(20, 20, 20);
8541 BorderColor3 = ScrollStyles.Border;
8542 BorderSizePixel = 0;
8543 Create('ImageButton',{
8544 Name = "ScrollThumb";
8545 AutoButtonColor = false;
8546 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
8547 BackgroundColor3 = ScrollStyles.Button;
8548 BorderColor3 = ScrollStyles.Border;
8549 BorderSizePixel = 0;
8550 });
8551 });
8552 })
8553
8554 local graphicTemplate = Create('Frame',{
8555 Name="Graphic";
8556 BorderSizePixel = 0;
8557 BackgroundColor3 = Color3.new(1, 1, 1);
8558 })
8559 local graphicSize = ScrollBarWidth/2
8560
8561 local ScrollDownFrame = ScrollFrame.ScrollDown
8562 local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
8563 ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
8564 ScrollDownGraphic.Parent = ScrollDownFrame
8565 local ScrollUpFrame = ScrollFrame.ScrollUp
8566 local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
8567 ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
8568 ScrollUpGraphic.Parent = ScrollUpFrame
8569 local ScrollBarFrame = ScrollFrame.ScrollBar
8570 local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
8571 do
8572 local size = ScrollBarWidth*3/8
8573 local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
8574 Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
8575 Decal.Parent = ScrollThumbFrame
8576 end
8577
8578 local MouseDrag = Create('ImageButton',{
8579 Name = "MouseDrag";
8580 Position = UDim2.new(-0.25,0,-0.25,0);
8581 Size = UDim2.new(1.5,0,1.5,0);
8582 Transparency = 1;
8583 AutoButtonColor = false;
8584 Active = true;
8585 ZIndex = 10;
8586 })
8587
8588 local Class = setmetatable({
8589 GUI = ScrollFrame;
8590 ScrollIndex = 0;
8591 VisibleSpace = 0;
8592 TotalSpace = 0;
8593 PageIncrement = 1;
8594 },mt)
8595
8596 local UpdateScrollThumb
8597 if horizontal then
8598 function UpdateScrollThumb()
8599 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,ScrollBarWidth)
8600 if ScrollThumbFrame.AbsoluteSize.x < ScrollBarWidth then
8601 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
8602 end
8603 local barSize = ScrollBarFrame.AbsoluteSize.x
8604 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
8605 end
8606 else
8607 function UpdateScrollThumb()
8608 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,Class.VisibleSpace/Class.TotalSpace,0)
8609 if ScrollThumbFrame.AbsoluteSize.y < ScrollBarWidth then
8610 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
8611 end
8612 local barSize = ScrollBarFrame.AbsoluteSize.y
8613 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
8614 end
8615 end
8616
8617 local lastDown
8618 local lastUp
8619 local scrollStyle = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0}
8620 local scrollStyle_ds = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0.7}
8621
8622 local function Update()
8623 local t = Class.TotalSpace
8624 local v = Class.VisibleSpace
8625 local s = Class.ScrollIndex
8626 if v <= t then
8627 if s > 0 then
8628 if s + v > t then
8629 Class.ScrollIndex = t - v
8630 end
8631 else
8632 Class.ScrollIndex = 0
8633 end
8634 else
8635 Class.ScrollIndex = 0
8636 end
8637
8638 if Class.UpdateCallback then
8639 if Class.UpdateCallback(Class) == false then
8640 return
8641 end
8642 end
8643
8644 local down = Class:CanScrollDown()
8645 local up = Class:CanScrollUp()
8646 if down ~= lastDown then
8647 lastDown = down
8648 ScrollDownFrame.Active = down
8649 ScrollDownFrame.AutoButtonColor = down
8650 local children = ScrollDownGraphic:GetChildren()
8651 local style = down and scrollStyle or scrollStyle_ds
8652 for i = 1,#children do
8653 Create(children[i],style)
8654 end
8655 end
8656 if up ~= lastUp then
8657 lastUp = up
8658 ScrollUpFrame.Active = up
8659 ScrollUpFrame.AutoButtonColor = up
8660 local children = ScrollUpGraphic:GetChildren()
8661 local style = up and scrollStyle or scrollStyle_ds
8662 for i = 1,#children do
8663 Create(children[i],style)
8664 end
8665 end
8666 ScrollThumbFrame.Visible = down or up
8667 UpdateScrollThumb()
8668 end
8669 Class.Update = Update
8670
8671 SetZIndexOnChanged(ScrollFrame)
8672
8673 local scrollEventID = 0
8674 ScrollDownFrame.MouseButton1Down:connect(function()
8675 scrollEventID = tick()
8676 local current = scrollEventID
8677 local up_con
8678 up_con = MouseDrag.MouseButton1Up:connect(function()
8679 scrollEventID = tick()
8680 MouseDrag.Parent = nil
8681 ResetButtonColor(ScrollDownFrame)
8682 up_con:disconnect(); drag = nil
8683 end)
8684 MouseDrag.Parent = GetScreen(ScrollFrame)
8685 Class:ScrollDown()
8686 wait(0.2) -- delay before auto scroll
8687 while scrollEventID == current do
8688 Class:ScrollDown()
8689 if not Class:CanScrollDown() then break end
8690 wait()
8691 end
8692 end)
8693
8694 ScrollDownFrame.MouseButton1Up:connect(function()
8695 scrollEventID = tick()
8696 end)
8697
8698 ScrollUpFrame.MouseButton1Down:connect(function()
8699 scrollEventID = tick()
8700 local current = scrollEventID
8701 local up_con
8702 up_con = MouseDrag.MouseButton1Up:connect(function()
8703 scrollEventID = tick()
8704 MouseDrag.Parent = nil
8705 ResetButtonColor(ScrollUpFrame)
8706 up_con:disconnect(); drag = nil
8707 end)
8708 MouseDrag.Parent = GetScreen(ScrollFrame)
8709 Class:ScrollUp()
8710 wait(0.2)
8711 while scrollEventID == current do
8712 Class:ScrollUp()
8713 if not Class:CanScrollUp() then break end
8714 wait()
8715 end
8716 end)
8717
8718 ScrollUpFrame.MouseButton1Up:connect(function()
8719 scrollEventID = tick()
8720 end)
8721
8722 if horizontal then
8723 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
8724 scrollEventID = tick()
8725 local current = scrollEventID
8726 local up_con
8727 up_con = MouseDrag.MouseButton1Up:connect(function()
8728 scrollEventID = tick()
8729 MouseDrag.Parent = nil
8730 ResetButtonColor(ScrollUpFrame)
8731 up_con:disconnect(); drag = nil
8732 end)
8733 MouseDrag.Parent = GetScreen(ScrollFrame)
8734 if x > ScrollThumbFrame.AbsolutePosition.x then
8735 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
8736 wait(0.2)
8737 while scrollEventID == current do
8738 if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
8739 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
8740 wait()
8741 end
8742 else
8743 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
8744 wait(0.2)
8745 while scrollEventID == current do
8746 if x > ScrollThumbFrame.AbsolutePosition.x then break end
8747 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
8748 wait()
8749 end
8750 end
8751 end)
8752 else
8753 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
8754 scrollEventID = tick()
8755 local current = scrollEventID
8756 local up_con
8757 up_con = MouseDrag.MouseButton1Up:connect(function()
8758 scrollEventID = tick()
8759 MouseDrag.Parent = nil
8760 ResetButtonColor(ScrollUpFrame)
8761 up_con:disconnect(); drag = nil
8762 end)
8763 MouseDrag.Parent = GetScreen(ScrollFrame)
8764 if y > ScrollThumbFrame.AbsolutePosition.y then
8765 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
8766 wait(0.2)
8767 while scrollEventID == current do
8768 if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
8769 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
8770 wait()
8771 end
8772 else
8773 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
8774 wait(0.2)
8775 while scrollEventID == current do
8776 if y > ScrollThumbFrame.AbsolutePosition.y then break end
8777 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
8778 wait()
8779 end
8780 end
8781 end)
8782 end
8783
8784 if horizontal then
8785 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
8786 scrollEventID = tick()
8787 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
8788 local drag_con
8789 local up_con
8790 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
8791 if not UserInputService:IsMouseButtonPressed'MouseButton1' then
8792 scrollEventID = tick()
8793 MouseDrag.Parent = nil
8794 ResetButtonColor(ScrollThumbFrame)
8795 drag_con:disconnect(); drag_con = nil
8796 up_con:disconnect(); drag = nil
8797 end
8798 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
8799 local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
8800 local bar_abs_one = bar_abs_pos + bar_drag
8801 x = x - mouse_offset
8802 x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
8803 x = x - bar_abs_pos
8804 Class:SetScrollPercent(x/(bar_drag))
8805 end)
8806 up_con = MouseDrag.MouseButton1Up:connect(function()
8807 scrollEventID = tick()
8808 MouseDrag.Parent = nil
8809 ResetButtonColor(ScrollThumbFrame)
8810 drag_con:disconnect(); drag_con = nil
8811 up_con:disconnect(); drag = nil
8812 end)
8813 MouseDrag.Parent = GetScreen(ScrollFrame)
8814 end)
8815 else
8816 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
8817 scrollEventID = tick()
8818 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
8819 local drag_con
8820 local up_con
8821 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
8822 if not UserInputService:IsMouseButtonPressed'MouseButton1' then
8823 scrollEventID = tick()
8824 MouseDrag.Parent = nil
8825 ResetButtonColor(ScrollThumbFrame)
8826 drag_con:disconnect(); drag_con = nil
8827 up_con:disconnect(); drag = nil
8828 end
8829 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
8830 local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
8831 local bar_abs_one = bar_abs_pos + bar_drag
8832 y = y - mouse_offset
8833 y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
8834 y = y - bar_abs_pos
8835 Class:SetScrollPercent(y/(bar_drag))
8836 end)
8837 up_con = MouseDrag.MouseButton1Up:connect(function()
8838 scrollEventID = tick()
8839 MouseDrag.Parent = nil
8840 ResetButtonColor(ScrollThumbFrame)
8841 drag_con:disconnect(); drag_con = nil
8842 up_con:disconnect(); drag = nil
8843 end)
8844 MouseDrag.Parent = GetScreen(ScrollFrame)
8845 end)
8846 end
8847
8848 function Class:Destroy()
8849 ScrollFrame:Destroy()
8850 MouseDrag:Destroy()
8851 for k in pairs(Class) do
8852 Class[k] = nil
8853 end
8854 setmetatable(Class,nil)
8855 end
8856
8857 Update()
8858
8859 return Class
8860 end
8861end
8862
8863----------------------------------------------------------------
8864----------------------------------------------------------------
8865----------------------------------------------------------------
8866----------------------------------------------------------------
8867
8868local MainFrame = Instance.new("Frame")
8869MainFrame.Name = "MainFrame"
8870MainFrame.Size = UDim2.new(1, -1 * ScrollBarWidth, 1, 0)
8871MainFrame.Position = UDim2.new(0, 0, 0, 0)
8872MainFrame.BackgroundTransparency = 1
8873MainFrame.ClipsDescendants = true
8874MainFrame.Parent = PropertiesFrame
8875
8876ContentFrame = Instance.new("Frame")
8877ContentFrame.Name = "ContentFrame"
8878ContentFrame.Size = UDim2.new(1, 0, 0, 0)
8879ContentFrame.BackgroundTransparency = 1
8880ContentFrame.Parent = MainFrame
8881
8882scrollBar = ScrollBar(false)
8883scrollBar.PageIncrement = 1
8884Create(scrollBar.GUI,{
8885 Position = UDim2.new(1,-ScrollBarWidth,0,0);
8886 Size = UDim2.new(0,ScrollBarWidth,1,0);
8887 Parent = PropertiesFrame;
8888})
8889
8890scrollBarH = ScrollBar(true)
8891scrollBarH.PageIncrement = ScrollBarWidth
8892Create(scrollBarH.GUI,{
8893 Position = UDim2.new(0,0,1,-ScrollBarWidth);
8894 Size = UDim2.new(1,-ScrollBarWidth,0,ScrollBarWidth);
8895 Visible = false;
8896 Parent = PropertiesFrame;
8897})
8898
8899do
8900 local listEntries = {}
8901 local nameConnLookup = {}
8902
8903 function scrollBar.UpdateCallback(self)
8904 scrollBar.TotalSpace = ContentFrame.AbsoluteSize.Y
8905 scrollBar.VisibleSpace = MainFrame.AbsoluteSize.Y
8906 ContentFrame.Position = UDim2.new(ContentFrame.Position.X.Scale,ContentFrame.Position.X.Offset,0,-1*scrollBar.ScrollIndex)
8907 end
8908
8909 function scrollBarH.UpdateCallback(self)
8910
8911 end
8912
8913 MainFrame.Changed:connect(function(p)
8914 if p == 'AbsoluteSize' then
8915 scrollBarH.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.x)
8916 scrollBarH:Update()
8917 scrollBar.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.y)
8918 scrollBar:Update()
8919 end
8920 end)
8921
8922 local wheelAmount = Row.Height
8923 PropertiesFrame.MouseWheelForward:connect(function()
8924 if input ~= nil and input.down ~= nil and input.down.leftshift then
8925 if scrollBarH.VisibleSpace - 1 > wheelAmount then
8926 scrollBarH:ScrollTo(scrollBarH.ScrollIndex - wheelAmount)
8927 else
8928 scrollBarH:ScrollTo(scrollBarH.ScrollIndex - scrollBarH.VisibleSpace)
8929 end
8930 else
8931 if scrollBar.VisibleSpace - 1 > wheelAmount then
8932 scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
8933 else
8934 scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
8935 end
8936 end
8937 end)
8938 PropertiesFrame.MouseWheelBackward:connect(function()
8939 if input ~= nil and input.down ~= nil and input.down.leftshift then
8940 if scrollBarH.VisibleSpace - 1 > wheelAmount then
8941 scrollBarH:ScrollTo(scrollBarH.ScrollIndex + wheelAmount)
8942 else
8943 scrollBarH:ScrollTo(scrollBarH.ScrollIndex + scrollBarH.VisibleSpace)
8944 end
8945 else
8946 if scrollBar.VisibleSpace - 1 > wheelAmount then
8947 scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
8948 else
8949 scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
8950 end
8951 end
8952 end)
8953end
8954
8955scrollBar.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.y)
8956scrollBar:Update()
8957
8958showProperties(GetSelection())
8959
8960bindSelectionChanged.Event:connect(function()
8961 showProperties(GetSelection())
8962end)
8963
8964bindSetAwait.Event:connect(function(obj)
8965 if AwaitingObjectValue then
8966 AwaitingObjectValue = false
8967 local mySel = obj
8968 if mySel then
8969 pcall(function()
8970 Set(AwaitingObjectObj, AwaitingObjectProp, mySel)
8971 end)
8972 end
8973 end
8974end)
8975
8976propertiesSearch.Changed:connect(function(prop)
8977 if prop == "Text" then
8978 showProperties(GetSelection())
8979 end
8980end)
8981
8982bindGetApi.OnInvoke = function()
8983 return RbxApi
8984end
8985
8986bindGetAwait.OnInvoke = function()
8987 return AwaitingObjectValue
8988end
8989end)
8990spawn(function()
8991
8992local top = D_E_X.ScriptEditor
8993
8994local editorGrid = top:WaitForChild("EditorGrid")
8995
8996local currentSource = ""
8997local currentScrName = "";
8998
8999local currentEditor = {
9000 x = 0,
9001 y = 0
9002}
9003
9004local mouse = game:GetService'Players'.LocalPlayer:GetMouse()
9005
9006local topBar = top:WaitForChild("TopBar")
9007local scriptBar = topBar:WaitForChild("ScriptBar")
9008local scriptBarLeft = topBar:WaitForChild("ScriptBarLeft")
9009local scriptBarRight = topBar:WaitForChild("ScriptBarRight")
9010local clipboardButton = topBar:WaitForChild("Clipboard")
9011local saveScriptButton = topBar:FindFirstChild("SaveScript")
9012
9013local entryTemplate = topBar:WaitForChild("Entry")
9014
9015local openEvent = top:WaitForChild("OpenScript")
9016
9017local closeButton = top:WaitForChild("Close")
9018
9019local memoryScripts = {}
9020
9021local editingIndex = 0
9022
9023-- Scrollbar
9024
9025local ScrollBarWidth = 16
9026
9027local ScrollStyles = {
9028 Background = Color3.fromRGB(233, 233, 233);
9029 Border = Color3.fromRGB( 20, 20, 20);
9030 Selected = Color3.fromRGB( 63, 119, 189);
9031 BorderSelected = Color3.fromRGB( 55, 106, 167);
9032 Text = Color3.fromRGB( 0, 0, 0);
9033 TextDisabled = Color3.fromRGB(128, 128, 128);
9034 TextSelected = Color3.fromRGB(255, 255, 255);
9035 Button = Color3.fromRGB( 35, 35, 35);
9036 ButtonBorder = Color3.fromRGB(149, 149, 149);
9037 ButtonSelected = Color3.fromRGB(255, 0, 0);
9038 Field = Color3.fromRGB(255, 255, 255);
9039 FieldBorder = Color3.fromRGB(191, 191, 191);
9040 TitleBackground = Color3.fromRGB(178, 178, 178);
9041}
9042do
9043 local ZIndexLock = {}
9044 function SetZIndex(object,z)
9045 if not ZIndexLock[object] then
9046 ZIndexLock[object] = true
9047 if object:IsA'GuiObject' then
9048 object.ZIndex = z
9049 end
9050 local children = object:GetChildren()
9051 for i = 1,#children do
9052 SetZIndex(children[i],z)
9053 end
9054 ZIndexLock[object] = nil
9055 end
9056 end
9057end
9058function SetZIndexOnChanged(object)
9059 return object.Changed:connect(function(p)
9060 if p == "ZIndex" then
9061 SetZIndex(object,object.ZIndex)
9062 end
9063 end)
9064end
9065function Create(ty,data)
9066 local obj
9067 if type(ty) == 'string' then
9068 obj = Instance.new(ty)
9069 else
9070 obj = ty
9071 end
9072 for k, v in pairs(data) do
9073 if type(k) == 'number' then
9074 v.Parent = obj
9075 else
9076 obj[k] = v
9077 end
9078 end
9079 return obj
9080end
9081-- returns the ascendant ScreenGui of an object
9082function GetScreen(screen)
9083 if screen == nil then return nil end
9084 while not screen:IsA("ScreenGui") do
9085 screen = screen.Parent
9086 if screen == nil then return nil end
9087 end
9088 return screen
9089end
9090-- AutoButtonColor doesn't always reset properly
9091function ResetButtonColor(button)
9092 local active = button.Active
9093 button.Active = not active
9094 button.Active = active
9095end
9096
9097function ArrowGraphic(size,dir,scaled,template)
9098 local Frame = Create('Frame',{
9099 Name = "Arrow Graphic";
9100 BorderSizePixel = 0;
9101 Size = UDim2.new(0,size,0,size);
9102 Transparency = 1;
9103 })
9104 if not template then
9105 template = Instance.new("Frame")
9106 template.BorderSizePixel = 0
9107 end
9108
9109 template.BackgroundColor3 = Color3.new(1, 1, 1);
9110
9111 local transform
9112 if dir == nil or dir == 'Up' then
9113 function transform(p,s) return p,s end
9114 elseif dir == 'Down' then
9115 function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
9116 elseif dir == 'Left' then
9117 function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
9118 elseif dir == 'Right' then
9119 function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
9120 end
9121
9122 local scale
9123 if scaled then
9124 function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
9125 else
9126 function scale(p,s) return p,s end
9127 end
9128
9129 local o = math.floor(size/4)
9130 if size%2 == 0 then
9131 local n = size/2-1
9132 for i = 0,n do
9133 local t = template:Clone()
9134 local p,s = scale(transform(
9135 UDim2.new(0,n-i,0,o+i),
9136 UDim2.new(0,(i+1)*2,0,1)
9137 ))
9138 t.Position = p
9139 t.Size = s
9140 t.Parent = Frame
9141 end
9142 else
9143 local n = (size-1)/2
9144 for i = 0,n do
9145 local t = template:Clone()
9146 local p,s = scale(transform(
9147 UDim2.new(0,n-i,0,o+i),
9148 UDim2.new(0,i*2+1,0,1)
9149 ))
9150 t.Position = p
9151 t.Size = s
9152 t.Parent = Frame
9153 end
9154 end
9155 if size%4 > 1 then
9156 local t = template:Clone()
9157 local p,s = scale(transform(
9158 UDim2.new(0,0,0,size-o-1),
9159 UDim2.new(0,size,0,1)
9160 ))
9161 t.Position = p
9162 t.Size = s
9163 t.Parent = Frame
9164 end
9165
9166 for i,v in pairs(Frame:GetChildren()) do
9167 v.BackgroundColor3 = Color3.new(1, 1, 1);
9168 end
9169
9170 return Frame
9171end
9172
9173function GripGraphic(size,dir,spacing,scaled,template)
9174 local Frame = Create('Frame',{
9175 Name = "Grip Graphic";
9176 BorderSizePixel = 0;
9177 Size = UDim2.new(0,size.x,0,size.y);
9178 Transparency = 1;
9179 })
9180 if not template then
9181 template = Instance.new("Frame")
9182 template.BorderSizePixel = 0
9183 end
9184
9185 spacing = spacing or 2
9186
9187 local scale
9188 if scaled then
9189 function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
9190 else
9191 function scale(p) return p end
9192 end
9193
9194 if dir == 'Vertical' then
9195 for i=0,size.x-1,spacing do
9196 local t = template:Clone()
9197 t.Size = scale(UDim2.new(0,1,0,size.y))
9198 t.Position = scale(UDim2.new(0,i,0,0))
9199 t.Parent = Frame
9200 end
9201 elseif dir == nil or dir == 'Horizontal' then
9202 for i=0,size.y-1,spacing do
9203 local t = template:Clone()
9204 t.Size = scale(UDim2.new(0,size.x,0,1))
9205 t.Position = scale(UDim2.new(0,0,0,i))
9206 t.Parent = Frame
9207 end
9208 end
9209
9210 return Frame
9211end
9212
9213do
9214 local mt = {
9215 __index = {
9216 GetScrollPercent = function(self)
9217 return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
9218 end;
9219 CanScrollDown = function(self)
9220 return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
9221 end;
9222 CanScrollUp = function(self)
9223 return self.ScrollIndex > 0
9224 end;
9225 ScrollDown = function(self)
9226 self.ScrollIndex = self.ScrollIndex + self.PageIncrement
9227 self:Update()
9228 end;
9229 ScrollUp = function(self)
9230 self.ScrollIndex = self.ScrollIndex - self.PageIncrement
9231 self:Update()
9232 end;
9233 ScrollTo = function(self,index)
9234 self.ScrollIndex = index
9235 self:Update()
9236 end;
9237 SetScrollPercent = function(self,percent)
9238 self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
9239 self:Update()
9240 end;
9241 };
9242 }
9243 mt.__index.CanScrollRight = mt.__index.CanScrollDown
9244 mt.__index.CanScrollLeft = mt.__index.CanScrollUp
9245 mt.__index.ScrollLeft = mt.__index.ScrollUp
9246 mt.__index.ScrollRight = mt.__index.ScrollDown
9247
9248 function ScrollBar(horizontal)
9249 -- create row scroll bar
9250 local ScrollFrame = Create('Frame',{
9251 Name = "ScrollFrame";
9252 Position = horizontal and UDim2.new(0,0,1,-ScrollBarWidth) or UDim2.new(1,-ScrollBarWidth,0,0);
9253 Size = horizontal and UDim2.new(1,0,0,ScrollBarWidth) or UDim2.new(0,ScrollBarWidth,1,0);
9254 BackgroundTransparency = 1;
9255 Create('ImageButton',{
9256 Name = "ScrollDown";
9257 Position = horizontal and UDim2.new(1,-ScrollBarWidth,0,0) or UDim2.new(0,0,1,-ScrollBarWidth);
9258 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
9259 BackgroundColor3 = ScrollStyles.Button;
9260 BorderColor3 = ScrollStyles.Border;
9261 BorderSizePixel = 0;
9262 });
9263 Create('ImageButton',{
9264 Name = "ScrollUp";
9265 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
9266 BackgroundColor3 = ScrollStyles.Button;
9267 BorderColor3 = ScrollStyles.Border;
9268 BorderSizePixel = 0;
9269 });
9270 Create('ImageButton',{
9271 Name = "ScrollBar";
9272 Size = horizontal and UDim2.new(1,-ScrollBarWidth*2,1,0) or UDim2.new(1,0,1,-ScrollBarWidth*2);
9273 Position = horizontal and UDim2.new(0,ScrollBarWidth,0,0) or UDim2.new(0,0,0,ScrollBarWidth);
9274 AutoButtonColor = false;
9275 BackgroundColor3 = Color3.fromRGB(20, 20, 20);
9276 BorderColor3 = ScrollStyles.Border;
9277 BorderSizePixel = 0;
9278 Create('ImageButton',{
9279 Name = "ScrollThumb";
9280 AutoButtonColor = false;
9281 Size = UDim2.new(0, ScrollBarWidth, 0, ScrollBarWidth);
9282 BackgroundColor3 = ScrollStyles.Button;
9283 BorderColor3 = ScrollStyles.Border;
9284 BorderSizePixel = 0;
9285 });
9286 });
9287 })
9288
9289 local graphicTemplate = Create('Frame',{
9290 Name="Graphic";
9291 BorderSizePixel = 0;
9292 BackgroundColor3 = Color3.new(1, 1, 1);
9293 })
9294 local graphicSize = ScrollBarWidth/2
9295
9296 local ScrollDownFrame = ScrollFrame.ScrollDown
9297 local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
9298 ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
9299 ScrollDownGraphic.Parent = ScrollDownFrame
9300 local ScrollUpFrame = ScrollFrame.ScrollUp
9301 local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
9302 ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
9303 ScrollUpGraphic.Parent = ScrollUpFrame
9304 local ScrollBarFrame = ScrollFrame.ScrollBar
9305 local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
9306 do
9307 local size = ScrollBarWidth*3/8
9308 local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
9309 Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
9310 Decal.Parent = ScrollThumbFrame
9311 end
9312
9313 local MouseDrag = Create('ImageButton',{
9314 Name = "MouseDrag";
9315 Position = UDim2.new(-0.25,0,-0.25,0);
9316 Size = UDim2.new(1.5,0,1.5,0);
9317 Transparency = 1;
9318 AutoButtonColor = false;
9319 Active = true;
9320 ZIndex = 10;
9321 })
9322
9323 local Class = setmetatable({
9324 GUI = ScrollFrame;
9325 ScrollIndex = 0;
9326 VisibleSpace = 0;
9327 TotalSpace = 0;
9328 PageIncrement = 1;
9329 },mt)
9330
9331 local UpdateScrollThumb
9332 if horizontal then
9333 function UpdateScrollThumb()
9334 ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,ScrollBarWidth)
9335 if ScrollThumbFrame.AbsoluteSize.x < ScrollBarWidth then
9336 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
9337 end
9338 local barSize = ScrollBarFrame.AbsoluteSize.x
9339 ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
9340 end
9341 else
9342 function UpdateScrollThumb()
9343 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,Class.VisibleSpace/Class.TotalSpace,0)
9344 if ScrollThumbFrame.AbsoluteSize.y < ScrollBarWidth then
9345 ScrollThumbFrame.Size = UDim2.new(0,ScrollBarWidth,0,ScrollBarWidth)
9346 end
9347 local barSize = ScrollBarFrame.AbsoluteSize.y
9348 ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
9349 end
9350 end
9351
9352 local lastDown
9353 local lastUp
9354 local scrollStyle = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0}
9355 local scrollStyle_ds = {BackgroundColor3=Color3.new(1, 1, 1),BackgroundTransparency=0.7}
9356
9357 local function Update()
9358 local t = Class.TotalSpace
9359 local v = Class.VisibleSpace
9360 local s = Class.ScrollIndex
9361 if v <= t then
9362 if s > 0 then
9363 if s + v > t then
9364 Class.ScrollIndex = t - v
9365 end
9366 else
9367 Class.ScrollIndex = 0
9368 end
9369 else
9370 Class.ScrollIndex = 0
9371 end
9372
9373 if Class.UpdateCallback then
9374 if Class.UpdateCallback(Class) == false then
9375 return
9376 end
9377 end
9378
9379 local down = Class:CanScrollDown()
9380 local up = Class:CanScrollUp()
9381 if down ~= lastDown then
9382 lastDown = down
9383 ScrollDownFrame.Active = down
9384 ScrollDownFrame.AutoButtonColor = down
9385 local children = ScrollDownGraphic:GetChildren()
9386 local style = down and scrollStyle or scrollStyle_ds
9387 for i = 1,#children do
9388 Create(children[i],style)
9389 end
9390 end
9391 if up ~= lastUp then
9392 lastUp = up
9393 ScrollUpFrame.Active = up
9394 ScrollUpFrame.AutoButtonColor = up
9395 local children = ScrollUpGraphic:GetChildren()
9396 local style = up and scrollStyle or scrollStyle_ds
9397 for i = 1,#children do
9398 Create(children[i],style)
9399 end
9400 end
9401 ScrollThumbFrame.Visible = down or up
9402 UpdateScrollThumb()
9403 end
9404 Class.Update = Update
9405
9406 SetZIndexOnChanged(ScrollFrame)
9407
9408 local scrollEventID = 0
9409 ScrollDownFrame.MouseButton1Down:connect(function()
9410 scrollEventID = tick()
9411 local current = scrollEventID
9412 local up_con
9413 up_con = MouseDrag.MouseButton1Up:connect(function()
9414 scrollEventID = tick()
9415 MouseDrag.Parent = nil
9416 ResetButtonColor(ScrollDownFrame)
9417 up_con:disconnect(); drag = nil
9418 end)
9419 MouseDrag.Parent = GetScreen(ScrollFrame)
9420 Class:ScrollDown()
9421 wait(0.2) -- delay before auto scroll
9422 while scrollEventID == current do
9423 Class:ScrollDown()
9424 if not Class:CanScrollDown() then break end
9425 wait()
9426 end
9427 end)
9428
9429 ScrollDownFrame.MouseButton1Up:connect(function()
9430 scrollEventID = tick()
9431 end)
9432
9433 ScrollUpFrame.MouseButton1Down:connect(function()
9434 scrollEventID = tick()
9435 local current = scrollEventID
9436 local up_con
9437 up_con = MouseDrag.MouseButton1Up:connect(function()
9438 scrollEventID = tick()
9439 MouseDrag.Parent = nil
9440 ResetButtonColor(ScrollUpFrame)
9441 up_con:disconnect(); drag = nil
9442 end)
9443 MouseDrag.Parent = GetScreen(ScrollFrame)
9444 Class:ScrollUp()
9445 wait(0.2)
9446 while scrollEventID == current do
9447 Class:ScrollUp()
9448 if not Class:CanScrollUp() then break end
9449 wait()
9450 end
9451 end)
9452
9453 ScrollUpFrame.MouseButton1Up:connect(function()
9454 scrollEventID = tick()
9455 end)
9456
9457 if horizontal then
9458 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
9459 scrollEventID = tick()
9460 local current = scrollEventID
9461 local up_con
9462 up_con = MouseDrag.MouseButton1Up:connect(function()
9463 scrollEventID = tick()
9464 MouseDrag.Parent = nil
9465 ResetButtonColor(ScrollUpFrame)
9466 up_con:disconnect(); drag = nil
9467 end)
9468 MouseDrag.Parent = GetScreen(ScrollFrame)
9469 if x > ScrollThumbFrame.AbsolutePosition.x then
9470 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
9471 wait(0.2)
9472 while scrollEventID == current do
9473 if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
9474 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
9475 wait()
9476 end
9477 else
9478 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
9479 wait(0.2)
9480 while scrollEventID == current do
9481 if x > ScrollThumbFrame.AbsolutePosition.x then break end
9482 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
9483 wait()
9484 end
9485 end
9486 end)
9487 else
9488 ScrollBarFrame.MouseButton1Down:connect(function(x,y)
9489 scrollEventID = tick()
9490 local current = scrollEventID
9491 local up_con
9492 up_con = MouseDrag.MouseButton1Up:connect(function()
9493 scrollEventID = tick()
9494 MouseDrag.Parent = nil
9495 ResetButtonColor(ScrollUpFrame)
9496 up_con:disconnect(); drag = nil
9497 end)
9498 MouseDrag.Parent = GetScreen(ScrollFrame)
9499 if y > ScrollThumbFrame.AbsolutePosition.y then
9500 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
9501 wait(0.2)
9502 while scrollEventID == current do
9503 if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
9504 Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
9505 wait()
9506 end
9507 else
9508 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
9509 wait(0.2)
9510 while scrollEventID == current do
9511 if y > ScrollThumbFrame.AbsolutePosition.y then break end
9512 Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
9513 wait()
9514 end
9515 end
9516 end)
9517 end
9518
9519 if horizontal then
9520 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
9521 scrollEventID = tick()
9522 local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
9523 local drag_con
9524 local up_con
9525 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
9526 if not UserInputService:IsMouseButtonPressed'MouseButton1' then
9527 scrollEventID = tick()
9528 MouseDrag.Parent = nil
9529 ResetButtonColor(ScrollThumbFrame)
9530 drag_con:disconnect(); drag_con = nil
9531 up_con:disconnect(); drag = nil
9532 end
9533 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
9534 local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
9535 local bar_abs_one = bar_abs_pos + bar_drag
9536 x = x - mouse_offset
9537 x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
9538 x = x - bar_abs_pos
9539 Class:SetScrollPercent(x/(bar_drag))
9540 end)
9541 up_con = MouseDrag.MouseButton1Up:connect(function()
9542 scrollEventID = tick()
9543 MouseDrag.Parent = nil
9544 ResetButtonColor(ScrollThumbFrame)
9545 drag_con:disconnect(); drag_con = nil
9546 up_con:disconnect(); drag = nil
9547 end)
9548 MouseDrag.Parent = GetScreen(ScrollFrame)
9549 end)
9550 else
9551 ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
9552 scrollEventID = tick()
9553 local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
9554 local drag_con
9555 local up_con
9556 drag_con = MouseDrag.MouseMoved:connect(function(x,y)
9557 if not UserInputService:IsMouseButtonPressed'MouseButton1' then
9558 scrollEventID = tick()
9559 MouseDrag.Parent = nil
9560 ResetButtonColor(ScrollThumbFrame)
9561 drag_con:disconnect(); drag_con = nil
9562 up_con:disconnect(); drag = nil
9563 end
9564 local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
9565 local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
9566 local bar_abs_one = bar_abs_pos + bar_drag
9567 y = y - mouse_offset
9568 y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
9569 y = y - bar_abs_pos
9570 Class:SetScrollPercent(y/(bar_drag))
9571 end)
9572 up_con = MouseDrag.MouseButton1Up:connect(function()
9573 scrollEventID = tick()
9574 MouseDrag.Parent = nil
9575 ResetButtonColor(ScrollThumbFrame)
9576 drag_con:disconnect(); drag_con = nil
9577 up_con:disconnect(); drag = nil
9578 end)
9579 MouseDrag.Parent = GetScreen(ScrollFrame)
9580 end)
9581 end
9582
9583 function Class:Destroy()
9584 ScrollFrame:Destroy()
9585 MouseDrag:Destroy()
9586 for k in pairs(Class) do
9587 Class[k] = nil
9588 end
9589 setmetatable(Class,nil)
9590 end
9591
9592 Update()
9593
9594 return Class
9595 end
9596end
9597
9598
9599-- End Scrollbar
9600
9601local scrollBar = ScrollBar(false)
9602scrollBar.PageIncrement = 16
9603Create(scrollBar.GUI,{
9604 Position = UDim2.new(1,0,0,0);
9605 Size = UDim2.new(0,ScrollBarWidth,1,0);
9606 Parent = editorGrid;
9607})
9608
9609local scrollBarH = ScrollBar(true)
9610scrollBarH.PageIncrement = 8
9611Create(scrollBarH.GUI,{
9612 Position = UDim2.new(0,0,1,0);
9613 Size = UDim2.new(1,0,0,ScrollBarWidth);
9614 Parent = editorGrid;
9615})
9616
9617local wheelAmount = 24;
9618
9619editorGrid.MouseWheelForward:connect(function()
9620 if input ~= nil and input.down ~= nil and input.down.leftshift then
9621 if scrollBarH.VisibleSpace - 1 > wheelAmount then
9622 scrollBarH:ScrollTo(scrollBarH.ScrollIndex - wheelAmount)
9623 else
9624 scrollBarH:ScrollTo(scrollBarH.ScrollIndex - scrollBarH.VisibleSpace)
9625 end
9626 else
9627 if scrollBar.VisibleSpace - 1 > wheelAmount then
9628 scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
9629 else
9630 scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
9631 end
9632 end
9633end)
9634editorGrid.MouseWheelBackward:connect(function()
9635 if input ~= nil and input.down ~= nil and input.down.leftshift then
9636 if scrollBarH.VisibleSpace - 1 > wheelAmount then
9637 scrollBarH:ScrollTo(scrollBarH.ScrollIndex + wheelAmount)
9638 else
9639 scrollBarH:ScrollTo(scrollBarH.ScrollIndex + scrollBarH.VisibleSpace)
9640 end
9641 else
9642 if scrollBar.VisibleSpace - 1 > wheelAmount then
9643 scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
9644 else
9645 scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
9646 end
9647 end
9648end)
9649
9650local entries = {}
9651
9652local grid = {}
9653
9654local count = 1
9655local xCount = 1
9656
9657local lineSpan = 0
9658
9659for i = 0,editorGrid.AbsoluteSize.X - 20,8 do
9660 local newRow = {}
9661 for j = 0,390,16 do
9662 local cellText = Instance.new("TextLabel",editorGrid)
9663 cellText.Name = string.format('grid(%s,%s)', i, j);
9664 cellText.BackgroundTransparency = 1
9665 cellText.BorderSizePixel = 0
9666 cellText.Text = ""
9667 cellText.Position = UDim2.new(0,i,0,j)
9668 cellText.Size = UDim2.new(0,8,0,16)
9669 cellText.Font = Enum.Font.SourceSans
9670 cellText.FontSize = Enum.FontSize.Size18
9671 table.insert(newRow,cellText)
9672 xCount = xCount + 1
9673 end
9674 table.insert(grid,newRow)
9675 count = count + 1
9676 xCount = 1
9677end
9678
9679local syntaxHighlightList = {
9680 {["Keyword"] = "for", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9681 {["Keyword"] = "and", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9682 {["Keyword"] = "or", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9683 {["Keyword"] = "local", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9684 {["Keyword"] = "if", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9685 {["Keyword"] = "then", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9686 {["Keyword"] = "do", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9687 {["Keyword"] = "while", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9688 {["Keyword"] = "end", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9689 {["Keyword"] = "function", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9690 {["Keyword"] = "return", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9691 {["Keyword"] = "break", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9692 {["Keyword"] = "else", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9693 {["Keyword"] = "elseif", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9694 {["Keyword"] = "in", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9695 {["Keyword"] = "+", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9696 {["Keyword"] = "-", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9697 {["Keyword"] = "*", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9698 {["Keyword"] = "/", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9699 {["Keyword"] = "%", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9700 {["Keyword"] = "^", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9701 {["Keyword"] = "=", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9702 {["Keyword"] = ",", ["Color"] = Color3.fromRGB( 252, 97, 141), ["Independent"] = true};
9703 {["Keyword"] = "true", ["Color"] = Color3.fromRGB(122, 114, 185), ["Independent"] = true};
9704 {["Keyword"] = "false", ["Color"] = Color3.fromRGB(122, 114, 185), ["Independent"] = true};
9705 {["Keyword"] = "nil", ["Color"] = Color3.fromRGB(122, 114, 185), ["Independent"] = true};
9706}
9707
9708for i,v in pairs(getrenv()) do
9709 if type(v)=='function' and type(i)=='string' then
9710 table.insert(syntaxHighlightList, {['Keyword']=i, ["Color"] = Color3.fromRGB(123, 216, 143), ["Independent"] = true})
9711 end
9712end
9713
9714
9715function checkMouseInGui(gui)
9716 if gui == nil then return false end
9717 local plrMouse = game:GetService'Players'.LocalPlayer:GetMouse()
9718 local guiPosition = gui.AbsolutePosition
9719 local guiSize = gui.AbsoluteSize
9720
9721 if plrMouse.X >= guiPosition.x and plrMouse.X <= guiPosition.x + guiSize.x and plrMouse.Y >= guiPosition.y and plrMouse.Y <= guiPosition.y + guiSize.y then
9722 return true
9723 else
9724 return false
9725 end
9726end
9727
9728function AddZeros(num,reach)
9729 local toConvert = tostring(num)
9730 while #toConvert < reach do
9731 toConvert = " "..toConvert
9732 end
9733 return toConvert
9734end
9735
9736function buildScript(source,xOff,yOff,override)
9737 local buildingRows = true
9738 local buildScr = source
9739
9740 local totalLines = 0
9741
9742 if currentSource ~= source then
9743 currentSource = source
9744 end
9745
9746 if override then
9747 currentSource = source
9748 entries = {}
9749 buildScr = tostring(buildScr);
9750 while buildingRows do
9751 local x,y = string.find(buildScr,"\n")
9752 if x and y then
9753 table.insert(entries,string.sub(buildScr,1,y))
9754 buildScr = string.sub(buildScr,y+1,string.len(buildScr))
9755 else
9756 buildingRows = false
9757 table.insert(entries,buildScr)
9758 end
9759 end
9760 end
9761
9762 totalLines = #entries
9763 lineSpan = #tostring(totalLines)
9764
9765 if lineSpan == 1 then lineSpan = 2 end
9766
9767 local currentRow = 1
9768 local currentColumn = 2 + lineSpan
9769
9770 local colorTime = 0
9771 local colorReplace = nil
9772
9773 local inString = false
9774
9775 local workingEntries = entries
9776
9777 --[[
9778 for i,v in pairs(entries) do
9779 table.insert(workingEntries,v)
9780 end
9781
9782 for i = 1,yOff do
9783 table.remove(workingEntries,1)
9784 end
9785 --]]
9786
9787 local delayance = xOff
9788
9789 for i = 1,#grid do
9790 for j = 1,#grid[i] do
9791 if i <= lineSpan then
9792 local newNum = AddZeros(yOff + j,lineSpan)
9793 local newDigit = string.sub(newNum,i,i)
9794 if newDigit == " " then
9795 grid[i][j].Text = ""
9796 else
9797 grid[i][j].Text = newDigit
9798 end
9799
9800 -- grid[i][j].BorderSizePixel = 1
9801
9802 grid[i][j].TextColor3 = Color3.fromRGB(245, 245, 245)
9803 grid[i][j].BackgroundTransparency = 0
9804 grid[i][j].BackgroundColor3 = Color3.fromRGB(60, 60, 60)
9805 grid[i][j].Font = Enum.Font.SourceSans
9806 elseif i == lineSpan + 1 then
9807 -- grid[i][j].BorderSizePixel = 1
9808
9809 grid[i][j].Text = ""
9810 grid[i][j].BackgroundTransparency = 0
9811 grid[i][j].BackgroundColor3 = Color3.fromRGB(55, 55, 55)
9812 -- grid[i][j].Font = Enum.Font.SourceSans
9813 else
9814 -- grid[i][j].BorderSizePixel = 1
9815
9816 grid[i][j].Text = ""
9817 grid[i][j].BackgroundTransparency = 1
9818 --grid[i][j].Font = Enum.Font.SourceSans
9819 end
9820 end
9821 end
9822
9823 while true do
9824 if currentRow > #workingEntries or currentRow > #grid[1] then break end
9825 local entry = workingEntries[currentRow+yOff]
9826 while entry ~= nil and typeof(entry) == 'string' and string.len(entry) > 0 do
9827 if string.sub(entry,1,1) == "\t" then entry = " "..string.sub(entry,2) end
9828
9829 if currentColumn > #grid then break end
9830
9831 if delayance == 0 then
9832 grid[currentColumn][currentRow].Text = string.sub(entry,1,1)
9833 end
9834
9835 -- Coloring
9836
9837 if not inString then
9838 for i,v in pairs(syntaxHighlightList) do
9839 if string.sub(entry,1,string.len(v["Keyword"])) == v["Keyword"] then
9840 if v["Independent"] then
9841 local outCheck = string.len(v["Keyword"])+1
9842 local outEntry = string.sub(entry,outCheck,outCheck)
9843 if not string.find(outEntry,"%w") then
9844 colorTime = string.len(v["Keyword"])
9845 colorReplace = v["Color"]
9846 end
9847 else
9848 colorTime = string.len(v["Keyword"])
9849 colorReplace = v["Color"]
9850 end
9851 end
9852 end
9853 end
9854
9855 if string.sub(entry,1,1) == "\"" and string.match(entry,"\".+\"") then
9856 inString = true
9857 colorTime = string.len(string.match(entry,"\".+\""))
9858 colorReplace = Color3.fromRGB(243, 221, 99);
9859 end
9860
9861 local oldTC3 = Color3.fromRGB(244, 244, 244); --grid[currentColumn][currentRow].TextColor3
9862
9863 if colorTime > 0 then
9864 colorTime = colorTime - 1
9865 oldTC3 = grid[currentColumn][currentRow].TextColor3
9866 grid[currentColumn][currentRow].TextColor3 = colorReplace
9867 if colorTime == 0 then inString = false end
9868 else
9869 grid[currentColumn][currentRow].TextColor3 = oldTC3 --Color3.new(0,0,0)
9870 inString = false
9871 end
9872
9873 if delayance == 0 then
9874 currentColumn = currentColumn + 1
9875 else
9876 delayance = delayance - 1
9877 end
9878 entry = string.sub(entry,2,string.len(entry))
9879 end
9880 currentRow = currentRow + 1
9881 currentColumn = 2 + lineSpan
9882 colorTime = 0
9883 delayance = xOff
9884 inString = false
9885 end
9886end
9887
9888function scrollBar.UpdateCallback(self)
9889 scrollBar.TotalSpace = #entries * 16
9890 scrollBar.VisibleSpace = editorGrid.AbsoluteSize.Y
9891 buildScript(currentSource,math.floor(scrollBarH.ScrollIndex/8),math.floor(scrollBar.ScrollIndex/16))
9892end
9893
9894function scrollBarH.UpdateCallback(self)
9895 scrollBarH.TotalSpace = (getLongestEntry(entries) + 1 + lineSpan) * 8
9896 scrollBarH.VisibleSpace = editorGrid.AbsoluteSize.X
9897 buildScript(currentSource,math.floor(scrollBarH.ScrollIndex/8),math.floor(scrollBar.ScrollIndex/16))
9898end
9899
9900function getLongestEntry(tab)
9901 local longest = 0
9902 for i,v in pairs(tab) do
9903 if string.len(v) > longest then
9904 longest = string.len(v)
9905 end
9906 end
9907 return longest
9908end
9909
9910function openScript(scrObj)
9911 if scrObj:IsA("LocalScript") then
9912 scrObj.Archivable = true
9913 scrObj = scrObj:Clone()
9914 scrObj.Disabled = true
9915 end
9916
9917 local scrName = scrObj.Name
9918 local scrSource = decompile(scrObj)
9919 currentScrName = scrObj.Name;
9920
9921 table.insert(memoryScripts,{Name = scrName,Source = scrSource})
9922
9923 local newTab = entryTemplate:Clone()
9924 newTab.Button.Text = scrName
9925 newTab.Position = UDim2.new(0,#scriptBar:GetChildren() * 100,0,0)
9926 newTab.BackgroundColor3 = Color3.new(33, 33, 33)
9927 newTab.Visible = true
9928
9929 newTab.Button.MouseButton1Down:connect(function()
9930 for i,v in pairs(scriptBar:GetChildren()) do
9931 if v == newTab then
9932 editingIndex = i
9933 buildScript(memoryScripts[i].Source,0,0,true)
9934 wait(.1);
9935 scrollBar:ScrollTo(1)
9936 scrollBar:Update()
9937 scrollBarH:ScrollTo(1)
9938 scrollBarH:Update()
9939 end
9940 end
9941 end)
9942
9943 newTab.Close.MouseButton1Click:connect(function()
9944 for i,v in pairs(scriptBar:GetChildren()) do
9945 if v == newTab then
9946 table.remove(memoryScripts,i)
9947 if editingIndex == i then
9948 editingIndex = #memoryScripts
9949 if editingIndex > 0 then
9950 buildScript(memoryScripts[#memoryScripts].Source,0,0,true)
9951 else
9952 buildScript("",0,0,true)
9953 end
9954 end
9955
9956 scrollBar:ScrollTo(1)
9957 scrollBar:Update()
9958 scrollBarH:ScrollTo(1)
9959 scrollBarH:Update()
9960
9961 for i2 = i,#scriptBar:GetChildren() do
9962 scriptBar:GetChildren()[i2].Position = scriptBar:GetChildren()[i2].Position + UDim2.new(0,-100,0,0)
9963 end
9964 if editingIndex > i then
9965 editingIndex = editingIndex - 1
9966 end
9967 newTab:Destroy()
9968 end
9969 end
9970 end)
9971
9972 editingIndex = #memoryScripts
9973 buildScript(scrSource,0,0,true)
9974
9975 newTab.Parent = scriptBar
9976end
9977
9978getgenv().openScript = openScript;
9979
9980function updateScriptBar()
9981
9982end
9983
9984function _updateScriptBar()
9985 local entryCount = 0
9986
9987 scriptBarLeft.Active = false
9988 scriptBarLeft.AutoButtonColor = false
9989 for i,v in pairs(scriptBarLeft["Arrow Graphic"]:GetChildren()) do
9990 v.BackgroundTransparency = 0.7
9991 end
9992 scriptBarRight.Active = false
9993 scriptBarRight.AutoButtonColor = false
9994 for i,v in pairs(scriptBarRight["Arrow Graphic"]:GetChildren()) do
9995 v.BackgroundTransparency = 0.7
9996 end
9997 for i,v in pairs(scriptBar:GetChildren()) do
9998 if v.Position.X.Offset < 0 then
9999 scriptBarLeft.Active = true
10000 for i,v in pairs(scriptBarLeft["Arrow Graphic"]:GetChildren()) do
10001 v.BackgroundTransparency = 0
10002 end
10003 elseif v.Position.X.Offset >= 0 then
10004 entryCount = entryCount + 1
10005 if entryCount == 5 then
10006 scriptBarRight.Active = true
10007 for i,v in pairs(scriptBarRight["Arrow Graphic"]:GetChildren()) do
10008 v.BackgroundTransparency = 0
10009 end
10010 end
10011 end
10012 end
10013end
10014
10015scriptBar.ChildAdded:connect(updateScriptBar)
10016scriptBar.ChildRemoved:connect(updateScriptBar)
10017
10018scriptBarLeft.MouseButton1Click:connect(function()
10019 if scriptBarLeft.Active == false then return end
10020 for i,v in pairs(scriptBar:GetChildren()) do
10021 v.Position = v.Position + UDim2.new(0,100,0,0)
10022 end
10023 updateScriptBar()
10024end)
10025
10026scriptBarRight.MouseButton1Click:connect(function()
10027 if scriptBarRight.Active == false then return end
10028 for i,v in pairs(scriptBar:GetChildren()) do
10029 v.Position = v.Position + UDim2.new(0,-100,0,0)
10030 end
10031 updateScriptBar()
10032end)
10033
10034mouse.Button1Down:connect(function()
10035 if checkMouseInGui(editorGrid) then
10036 end
10037end)
10038
10039openEvent.Event:connect(function(...)
10040 top.Visible = true
10041 local args = {...}
10042 if #args > 0 then
10043 openScript(args[1])
10044 end
10045end)
10046
10047clipboardButton.MouseButton1Click:connect(function()
10048 if Clipboard and Clipboard.set then
10049 Clipboard.set(currentSource)
10050 elseif CopyString then
10051 CopyString(currentSource)
10052 elseif Synapse then
10053 Synapse:Copy(currentSource)
10054 elseif setclipboard then
10055 setclipboard(currentSource)
10056 end
10057end)
10058
10059saveScriptButton.MouseButton1Click:connect(function()
10060 if Synapse then
10061 Synapse:WriteFile(game.PlaceId .. '_' .. currentScrName:gsub('%W', '') .. '_' .. math.random(100000, 999999) .. '.lua', currentSource)
10062 elseif writefile then
10063 writefile(game.PlaceId .. '_' .. currentScrName:gsub('%W', '') .. '_' .. math.random(100000, 999999) .. '.lua', currentSource);
10064 end
10065end)
10066
10067closeButton.MouseButton1Click:connect(function()
10068 top.Visible = false
10069end)
10070
10071--[[
10072local scr = script.Parent:WaitForChild("Scr")
10073local scr2 = script.Parent:WaitForChild("Scr2")
10074local scr3 = script.Parent:WaitForChild("Scr3")
10075local scr4 = script.Parent:WaitForChild("TOS")
10076local scr5 = script.Parent:WaitForChild("HW")
10077--]]
10078
10079buildScript("",0,0,true)
10080--[[
10081openScript(scr)
10082openScript(scr2)
10083openScript(scr3)
10084openScript(scr4)
10085openScript(scr5)
10086--]]
10087
10088scrollBar:Update()
10089scrollBarH:Update()
10090end)
10091
10092function ScrambleNames(A)
10093 for i,v in pairs(A:GetDescendants()) do
10094 v.Name = RandomCharacters(math.random(16, 64));
10095 end
10096end
10097
10098wait(.25)
10099
10100D_E_X.Parent = coregui