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