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