forked from LorekeeperZinnia/Dex
-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.lua
1104 lines (965 loc) · 41.9 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--[[
New Dex
Final Version
Developed by Moon
Dex is a debugging suite designed to help the user debug games and find any potential vulnerabilities.
This is the final version of this script.
You are encouraged to edit, fork, do whatever with this. I pretty much won't be updating it anymore.
Though I would appreciate it if you kept the credits in the script if you enjoy this hard work.
If you want more info, you can join the server: https://discord.io/zinnia
Note that very limited to no support will be provided.
]]
-- Main vars
local Main, Explorer, Properties, ScriptViewer, DefaultSettings, Notebook, Serializer, Lib
local API, RMD
-- Default Settings
DefaultSettings = (function()
local rgb = Color3.fromRGB
return {
Explorer = {
_Recurse = true,
Sorting = true,
TeleportToOffset = Vector3.new(0,0,0),
ClickToRename = true,
AutoUpdateSearch = true,
AutoUpdateMode = 0, -- 0 Default, 1 no tree update, 2 no descendant events, 3 frozen
PartSelectionBox = true,
GuiSelectionBox = true,
CopyPathUseGetChildren = true
},
Properties = {
_Recurse = true,
MaxConflictCheck = 50,
ShowDeprecated = false,
ShowHidden = false,
ClearOnFocus = false,
LoadstringInput = true,
NumberRounding = 3,
ShowAttributes = false,
MaxAttributes = 50,
ScaleType = 1 -- 0 Full Name Shown, 1 Equal Halves
},
Theme = {
_Recurse = true,
Main1 = rgb(52,52,52),
Main2 = rgb(45,45,45),
Outline1 = rgb(33,33,33), -- Mainly frames
Outline2 = rgb(55,55,55), -- Mainly button
Outline3 = rgb(30,30,30), -- Mainly textbox
TextBox = rgb(38,38,38),
Menu = rgb(32,32,32),
ListSelection = rgb(11,90,175),
Button = rgb(60,60,60),
ButtonHover = rgb(68,68,68),
ButtonPress = rgb(40,40,40),
Highlight = rgb(75,75,75),
Text = rgb(255,255,255),
PlaceholderText = rgb(100,100,100),
Important = rgb(255,0,0),
ExplorerIconMap = "",
MiscIconMap = "",
Syntax = {
Text = rgb(204,204,204),
Background = rgb(36,36,36),
Selection = rgb(255,255,255),
SelectionBack = rgb(11,90,175),
Operator = rgb(204,204,204),
Number = rgb(255,198,0),
String = rgb(173,241,149),
Comment = rgb(102,102,102),
Keyword = rgb(248,109,124),
Error = rgb(255,0,0),
FindBackground = rgb(141,118,0),
MatchingWord = rgb(85,85,85),
BuiltIn = rgb(132,214,247),
CurrentLine = rgb(45,50,65),
LocalMethod = rgb(253,251,172),
LocalProperty = rgb(97,161,241),
Nil = rgb(255,198,0),
Bool = rgb(255,198,0),
Function = rgb(248,109,124),
Local = rgb(248,109,124),
Self = rgb(248,109,124),
FunctionName = rgb(253,251,172),
Bracket = rgb(204,204,204)
},
}
}
end)()
-- Vars
local Settings = {}
local Apps = {}
local env = {}
local service = setmetatable({},{__index = function(self,name)
local serv = game:GetService(name)
self[name] = serv
return serv
end})
local plr = service.Players.LocalPlayer or service.Players.PlayerAdded:wait()
local create = function(data)
local insts = {}
for i,v in pairs(data) do insts[v[1]] = Instance.new(v[2]) end
for _,v in pairs(data) do
for prop,val in pairs(v[3]) do
if type(val) == "table" then
insts[v[1]][prop] = insts[val[1]]
else
insts[v[1]][prop] = val
end
end
end
return insts[1]
end
local createSimple = function(class,props)
local inst = Instance.new(class)
for i,v in next,props do
inst[i] = v
end
return inst
end
Main = (function()
local Main = {}
Main.ModuleList = {"Explorer","Properties","ScriptViewer"}
Main.Elevated = false
Main.MissingEnv = {}
Main.Version = "Beta 1.0.0"
Main.Mouse = plr:GetMouse()
Main.AppControls = {}
Main.Apps = Apps
Main.MenuApps = {}
Main.GitRepoName = "peyton2465/Dex"
Main.DisplayOrders = {
SideWindow = 8,
Window = 10,
Menu = 100000,
Core = 101000
}
Main.GetInitDeps = function()
return {
Main = Main,
Lib = Lib,
Apps = Apps,
Settings = Settings,
API = API,
RMD = RMD,
env = env,
service = service,
plr = plr,
create = create,
createSimple = createSimple
}
end
Main.Error = function(str)
if rconsoleprint then
rconsoleprint("DEX ERROR: "..tostring(str).."\n")
coroutine.yield()
else
error(str)
end
end
Main.LoadModule = function(name)
if Main.Elevated then -- If you don't have filesystem api then ur outta luck tbh
local control
if EmbeddedModules then -- Offline Modules
control = EmbeddedModules[name]()
-- TODO: Remove when open source
if gethsfuncs then
control = _G.moduleData
end
if not control then Main.Error("Missing Embedded Module: "..name) end
elseif _G.DebugLoadModel then -- Load Debug Model File
local model = Main.DebugModel
if not model then model = game:GetObjects(getsynasset("AfterModules.rbxm"))[1] end
control = loadstring(model.Modules[name].Source)()
print("Locally Loaded Module",name,control)
else
-- Get hash data
local hashs = Main.ModuleHashData
if not hashs then
local s,hashDataStr = pcall(game.HttpGet, game, "https://api.github.com/repos/"..Main.GitRepoName.."/ModuleHashs.dat")
if not s then Main.Error("Failed to get module hashs") end
local s,hashData = pcall(service.HttpService.JSONDecode,service.HttpService,hashDataStr)
if not s then Main.Error("Failed to decode module hash JSON") end
hashs = hashData
Main.ModuleHashData = hashs
end
-- Check if local copy exists with matching hashs
local hashfunc = (syn and syn.crypt.hash) or function() return "" end
local filePath = "dex/ModuleCache/"..name..".lua"
local s,moduleStr = pcall(env.readfile,filePath)
if s and hashfunc(moduleStr) == hashs[name] then
control = loadstring(moduleStr)()
else
-- Download and cache
local s,moduleStr = pcall(game.HttpGet, game, "https://api.github.com/repos/"..Main.GitRepoName.."/Modules/"..name..".lua")
if not s then Main.Error("Failed to get external module data of "..name) end
env.writefile(filePath,moduleStr)
control = loadstring(moduleStr)()
end
end
Main.AppControls[name] = control
control.InitDeps(Main.GetInitDeps())
local moduleData = control.Main()
Apps[name] = moduleData
return moduleData
else
local module = script:WaitForChild("Modules"):WaitForChild(name,2)
if not module then Main.Error("CANNOT FIND MODULE "..name) end
local control = require(module)
Main.AppControls[name] = control
control.InitDeps(Main.GetInitDeps())
local moduleData = control.Main()
Apps[name] = moduleData
return moduleData
end
end
Main.LoadModules = function()
for i,v in pairs(Main.ModuleList) do
local s,e = pcall(Main.LoadModule,v)
if not s then
Main.Error("FAILED LOADING " + v + " CAUSE " + e)
end
end
-- Init Major Apps and define them in modules
Explorer = Apps.Explorer
Properties = Apps.Properties
ScriptViewer = Apps.ScriptViewer
Notebook = Apps.Notebook
local appTable = {
Explorer = Explorer,
Properties = Properties,
ScriptViewer = ScriptViewer,
Notebook = Notebook
}
Main.AppControls.Lib.InitAfterMain(appTable)
for i,v in pairs(Main.ModuleList) do
local control = Main.AppControls[v]
if control then
control.InitAfterMain(appTable)
end
end
end
Main.InitEnv = function()
setmetatable(env,{__newindex = function(self,name,func)
if not func then Main.MissingEnv[#Main.MissingEnv+1] = name return end
rawset(self,name,func)
end})
-- file
env.readfile = readfile
env.writefile = writefile
env.appendfile = appendfile
env.makefolder = makefolder
env.listfiles = listfiles
env.loadfile = loadfile
env.saveinstance = saveinstance
-- debug
env.getupvalues = debug.getupvalues or getupvals
env.getconstants = debug.getconstants or getconsts
env.islclosure = islclosure or is_l_closure
env.checkcaller = checkcaller
env.getreg = getreg
env.getgc = getgc
-- other
env.setfflag = setfflag
env.decompile = decompile
env.protectgui = protect_gui or (syn and syn.protect_gui)
env.gethui = gethui
env.setclipboard = setclipboard
env.getnilinstances = getnilinstances or get_nil_instances
env.getloadedmodules = getloadedmodules
if identifyexecutor then
Main.Executor = identifyexecutor()
end
Main.GuiHolder = Main.Elevated and service.CoreGui or plr:FindFirstChildOfClass("PlayerGui")
setmetatable(env,nil)
end
--[[
Main.IncompatibleTest = function()
local function incompatibleMessage(reason)
local msg = Instance.new("ScreenGui")
local t = Instance.new("TextLabel",msg)
t.BackgroundColor3 = Color3.fromRGB(50,50,50)
t.Position = UDim2.new(0,0,0,-36)
t.Size = UDim2.new(1,0,1,36)
t.TextColor3 = Color3.new(1,1,1)
t.TextWrapped = true
t.TextScaled = true
t.Text = "\n\n\n\n\n\n\n\nHello Skidsploit user,\nZinnia and the Secret Service does not approve of Dex being used on your skidsploit.\nPlease consider getting something better.\n\nIncompatible Reason: "..reason.."\n\n\n\n\n\n\n\n"
local sound = Instance.new("Sound",msg)
sound.SoundId = "rbxassetid://175964948"
sound.Volume = 1
sound.Looped = true
sound.Playing = true
Lib.ShowGui(msg)
if os and os.execute then pcall(os.execute,'explorer "https://x.synapse.to/"') end
while wait() do end
end
local t = {}
t[1] = t
local x = unpack(t) or incompatibleMessage("WRAPPER FAILED TO CYCLIC #1")
if x[1] ~= t then incompatibleMessage("WRAPPER FAILED TO CYCLIC #2") end
if game ~= workspace.Parent then incompatibleMessage("WRAPPER NO CACHE") end
if Main.Elevated and not loadstring("for i = 1,1 do continue end") then incompatibleMessage("CAN'T CONTINUE OR NO LOADSTRING") end
local obj = newproxy(true)
local mt = getmetatable(obj)
mt.__index = function() incompatibleMessage("CAN'T NAMECALL") end
mt.__namecall = function() end
obj:No()
local fEnv = setmetatable({zin = 5},{__index = getfenv()})
local caller = function(f) f() end
setfenv(caller,fEnv)
caller(function() if not getfenv(2).zin then incompatibleMessage("RERU WILL BE FILING A LAWSUIT AGAINST YOU SOON") end end)
local second = false
coroutine.wrap(function() local start = tick() wait(5) if tick() - start < 0.1 or not second then incompatibleMessage("SKIDDED YIELDING") end end)()
second = true
end
]]
Main.LoadSettings = function()
local s,data = pcall(env.readfile or error,"DexSettings.json")
if s and data and data ~= "" then
local s,decoded = service.HttpService:JSONDecode(data)
if s and decoded then
for i,v in next,decoded do
end
else
-- TODO: Notification
end
else
Main.ResetSettings()
end
end
Main.ResetSettings = function()
local function recur(t,res)
for set,val in pairs(t) do
if type(val) == "table" and val._Recurse then
if type(res[set]) ~= "table" then
res[set] = {}
end
recur(val,res[set])
else
res[set] = val
end
end
return res
end
recur(DefaultSettings,Settings)
end
Main.FetchAPI = function()
local api,rawAPI
if Main.Elevated then
if Main.LocalDepsUpToDate() then
local localAPI = Lib.ReadFile("dex/rbx_api.dat")
if localAPI then
rawAPI = localAPI
else
Main.DepsVersionData[1] = ""
end
end
rawAPI = rawAPI or game:HttpGet("http://setup.roblox.com/"..Main.RobloxVersion.."-API-Dump.json")
else
if script:FindFirstChild("API") then
rawAPI = require(script.API)
else
error("NO API EXISTS")
end
end
Main.RawAPI = rawAPI
api = service.HttpService:JSONDecode(rawAPI)
local classes,enums = {},{}
local categoryOrder,seenCategories = {},{}
local function insertAbove(t,item,aboveItem)
local findPos = table.find(t,item)
if not findPos then return end
table.remove(t,findPos)
local pos = table.find(t,aboveItem)
if not pos then return end
table.insert(t,pos,item)
end
for _,class in pairs(api.Classes) do
local newClass = {}
newClass.Name = class.Name
newClass.Superclass = class.Superclass
newClass.Properties = {}
newClass.Functions = {}
newClass.Events = {}
newClass.Callbacks = {}
newClass.Tags = {}
if class.Tags then for c,tag in pairs(class.Tags) do newClass.Tags[tag] = true end end
for __,member in pairs(class.Members) do
local newMember = {}
newMember.Name = member.Name
newMember.Class = class.Name
newMember.Security = member.Security
newMember.Tags ={}
if member.Tags then for c,tag in pairs(member.Tags) do newMember.Tags[tag] = true end end
local mType = member.MemberType
if mType == "Property" then
local propCategory = member.Category or "Other"
propCategory = propCategory:match("^%s*(.-)%s*$")
if not seenCategories[propCategory] then
categoryOrder[#categoryOrder+1] = propCategory
seenCategories[propCategory] = true
end
newMember.ValueType = member.ValueType
newMember.Category = propCategory
newMember.Serialization = member.Serialization
table.insert(newClass.Properties,newMember)
elseif mType == "Function" then
newMember.Parameters = {}
newMember.ReturnType = member.ReturnType.Name
for c,param in pairs(member.Parameters) do
table.insert(newMember.Parameters,{Name = param.Name, Type = param.Type.Name})
end
table.insert(newClass.Functions,newMember)
elseif mType == "Event" then
newMember.Parameters = {}
for c,param in pairs(member.Parameters) do
table.insert(newMember.Parameters,{Name = param.Name, Type = param.Type.Name})
end
table.insert(newClass.Events,newMember)
end
end
classes[class.Name] = newClass
end
for _,class in pairs(classes) do
class.Superclass = classes[class.Superclass]
end
for _,enum in pairs(api.Enums) do
local newEnum = {}
newEnum.Name = enum.Name
newEnum.Items = {}
newEnum.Tags = {}
if enum.Tags then for c,tag in pairs(enum.Tags) do newEnum.Tags[tag] = true end end
for __,item in pairs(enum.Items) do
local newItem = {}
newItem.Name = item.Name
newItem.Value = item.Value
table.insert(newEnum.Items,newItem)
end
enums[enum.Name] = newEnum
end
local function getMember(class,member)
if not classes[class] or not classes[class][member] then return end
local result = {}
local currentClass = classes[class]
while currentClass do
for _,entry in pairs(currentClass[member]) do
result[#result+1] = entry
end
currentClass = currentClass.Superclass
end
table.sort(result,function(a,b) return a.Name < b.Name end)
return result
end
insertAbove(categoryOrder,"Behavior","Tuning")
insertAbove(categoryOrder,"Appearance","Data")
insertAbove(categoryOrder,"Attachments","Axes")
insertAbove(categoryOrder,"Cylinder","Slider")
insertAbove(categoryOrder,"Localization","Jump Settings")
insertAbove(categoryOrder,"Surface","Motion")
insertAbove(categoryOrder,"Surface Inputs","Surface")
insertAbove(categoryOrder,"Part","Surface Inputs")
insertAbove(categoryOrder,"Assembly","Surface Inputs")
insertAbove(categoryOrder,"Character","Controls")
categoryOrder[#categoryOrder+1] = "Unscriptable"
categoryOrder[#categoryOrder+1] = "Attributes"
local categoryOrderMap = {}
for i = 1,#categoryOrder do
categoryOrderMap[categoryOrder[i]] = i
end
return {
Classes = classes,
Enums = enums,
CategoryOrder = categoryOrderMap,
GetMember = getMember
}
end
Main.FetchRMD = function()
local rawXML
if Main.Elevated then
if Main.LocalDepsUpToDate() then
local localRMD = Lib.ReadFile("dex/rbx_rmd.dat")
if localRMD then
rawXML = localRMD
else
Main.DepsVersionData[1] = ""
end
end
rawXML = rawXML or game:HttpGet("https://raw.githubusercontent.com/CloneTrooper1019/Roblox-Client-Tracker/roblox/ReflectionMetadata.xml")
else
if script:FindFirstChild("RMD") then
rawXML = require(script.RMD)
else
error("NO RMD EXISTS")
end
end
Main.RawRMD = rawXML
local parsed = Lib.ParseXML(rawXML)
local classList = parsed.children[1].children[1].children
local enumList = parsed.children[1].children[2].children
local propertyOrders = {}
local classes,enums = {},{}
for _,class in pairs(classList) do
local className = ""
for _,child in pairs(class.children) do
if child.tag == "Properties" then
local data = {Properties = {}, Functions = {}}
local props = child.children
for _,prop in pairs(props) do
local name = prop.attrs.name
name = name:sub(1,1):upper()..name:sub(2)
data[name] = prop.children[1].text
end
className = data.Name
classes[className] = data
elseif child.attrs.class == "ReflectionMetadataProperties" then
local members = child.children
for _,member in pairs(members) do
if member.attrs.class == "ReflectionMetadataMember" then
local data = {}
if member.children[1].tag == "Properties" then
local props = member.children[1].children
for _,prop in pairs(props) do
if prop.attrs then
local name = prop.attrs.name
name = name:sub(1,1):upper()..name:sub(2)
data[name] = prop.children[1].text
end
end
if data.PropertyOrder then
local orders = propertyOrders[className]
if not orders then orders = {} propertyOrders[className] = orders end
orders[data.Name] = tonumber(data.PropertyOrder)
end
classes[className].Properties[data.Name] = data
end
end
end
elseif child.attrs.class == "ReflectionMetadataFunctions" then
local members = child.children
for _,member in pairs(members) do
if member.attrs.class == "ReflectionMetadataMember" then
local data = {}
if member.children[1].tag == "Properties" then
local props = member.children[1].children
for _,prop in pairs(props) do
if prop.attrs then
local name = prop.attrs.name
name = name:sub(1,1):upper()..name:sub(2)
data[name] = prop.children[1].text
end
end
classes[className].Functions[data.Name] = data
end
end
end
end
end
end
for _,enum in pairs(enumList) do
local enumName = ""
for _,child in pairs(enum.children) do
if child.tag == "Properties" then
local data = {Items = {}}
local props = child.children
for _,prop in pairs(props) do
local name = prop.attrs.name
name = name:sub(1,1):upper()..name:sub(2)
data[name] = prop.children[1].text
end
enumName = data.Name
enums[enumName] = data
elseif child.attrs.class == "ReflectionMetadataEnumItem" then
local data = {}
if child.children[1].tag == "Properties" then
local props = child.children[1].children
for _,prop in pairs(props) do
local name = prop.attrs.name
name = name:sub(1,1):upper()..name:sub(2)
data[name] = prop.children[1].text
end
enums[enumName].Items[data.Name] = data
end
end
end
end
return {Classes = classes, Enums = enums, PropertyOrders = propertyOrders}
end
Main.ShowGui = function(gui)
if env.protectgui then
env.protectgui(gui)
end
gui.Parent = Main.GuiHolder
end
Main.CreateIntro = function(initStatus) -- TODO: Must theme and show errors
local gui = create({
{1,"ScreenGui",{Name="Intro",}},
{2,"Frame",{Active=true,BackgroundColor3=Color3.new(0.20392157137394,0.20392157137394,0.20392157137394),BorderSizePixel=0,Name="Main",Parent={1},Position=UDim2.new(0.5,-175,0.5,-100),Size=UDim2.new(0,350,0,200),}},
{3,"Frame",{BackgroundColor3=Color3.new(0.17647059261799,0.17647059261799,0.17647059261799),BorderSizePixel=0,ClipsDescendants=true,Name="Holder",Parent={2},Size=UDim2.new(1,0,1,0),}},
{4,"UIGradient",{Parent={3},Rotation=30,Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(1,1,0),}),}},
{5,"TextLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=4,Name="Title",Parent={3},Position=UDim2.new(0,-190,0,15),Size=UDim2.new(0,100,0,50),Text="Dex",TextColor3=Color3.new(1,1,1),TextSize=50,TextTransparency=1,}},
{6,"TextLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=3,Name="Desc",Parent={3},Position=UDim2.new(0,-230,0,60),Size=UDim2.new(0,180,0,25),Text="Ultimate Debugging Suite",TextColor3=Color3.new(1,1,1),TextSize=18,TextTransparency=1,}},
{7,"TextLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=3,Name="StatusText",Parent={3},Position=UDim2.new(0,20,0,110),Size=UDim2.new(0,180,0,25),Text="Fetching API",TextColor3=Color3.new(1,1,1),TextSize=14,TextTransparency=1,}},
{8,"Frame",{BackgroundColor3=Color3.new(0.20392157137394,0.20392157137394,0.20392157137394),BorderSizePixel=0,Name="ProgressBar",Parent={3},Position=UDim2.new(0,110,0,145),Size=UDim2.new(0,0,0,4),}},
{9,"Frame",{BackgroundColor3=Color3.new(0.2392156869173,0.56078433990479,0.86274510622025),BorderSizePixel=0,Name="Bar",Parent={8},Size=UDim2.new(0,0,1,0),}},
{10,"ImageLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Image="rbxassetid://2764171053",ImageColor3=Color3.new(0.17647059261799,0.17647059261799,0.17647059261799),Parent={8},ScaleType=1,Size=UDim2.new(1,0,1,0),SliceCenter=Rect.new(2,2,254,254),}},
{11,"TextLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=3,Name="Creator",Parent={2},Position=UDim2.new(1,-110,1,-20),Size=UDim2.new(0,105,0,20),Text="Developed by Moon",TextColor3=Color3.new(1,1,1),TextSize=14,TextXAlignment=1,}},
{12,"UIGradient",{Parent={11},Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(1,1,0),}),}},
{13,"TextLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=3,Name="Version",Parent={2},Position=UDim2.new(1,-110,1,-35),Size=UDim2.new(0,105,0,20),Text="Beta 1.0.0",TextColor3=Color3.new(1,1,1),TextSize=14,TextXAlignment=1,}},
{14,"UIGradient",{Parent={13},Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(1,1,0),}),}},
{15,"ImageLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderSizePixel=0,Image="rbxassetid://1427967925",Name="Outlines",Parent={2},Position=UDim2.new(0,-5,0,-5),ScaleType=1,Size=UDim2.new(1,10,1,10),SliceCenter=Rect.new(6,6,25,25),TileSize=UDim2.new(0,20,0,20),}},
{16,"UIGradient",{Parent={15},Rotation=-30,Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(1,1,0),}),}},
{17,"UIGradient",{Parent={2},Rotation=-30,Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(1,1,0),}),}},
})
Main.ShowGui(gui)
local backGradient = gui.Main.UIGradient
local outlinesGradient = gui.Main.Outlines.UIGradient
local holderGradient = gui.Main.Holder.UIGradient
local titleText = gui.Main.Holder.Title
local descText = gui.Main.Holder.Desc
local versionText = gui.Main.Version
local versionGradient = versionText.UIGradient
local creatorText = gui.Main.Creator
local creatorGradient = creatorText.UIGradient
local statusText = gui.Main.Holder.StatusText
local progressBar = gui.Main.Holder.ProgressBar
local tweenS = service.TweenService
local renderStepped = service.RunService.RenderStepped
local signalWait = renderStepped.wait
local fastwait = function(s)
if not s then return signalWait(renderStepped) end
local start = tick()
while tick() - start < s do signalWait(renderStepped) end
end
statusText.Text = initStatus
local function tweenNumber(n,ti,func)
local tweenVal = Instance.new("IntValue")
tweenVal.Value = 0
tweenVal.Changed:Connect(func)
local tween = tweenS:Create(tweenVal,ti,{Value = n})
tween:Play()
tween.Completed:Connect(function()
tweenVal:Destroy()
end)
end
local ti = TweenInfo.new(0.4,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
tweenNumber(100,ti,function(val)
val = val/200
local start = NumberSequenceKeypoint.new(0,0)
local a1 = NumberSequenceKeypoint.new(val,0)
local a2 = NumberSequenceKeypoint.new(math.min(0.5,val+math.min(0.05,val)),1)
if a1.Time == a2.Time then a2 = a1 end
local b1 = NumberSequenceKeypoint.new(1-val,0)
local b2 = NumberSequenceKeypoint.new(math.max(0.5,1-val-math.min(0.05,val)),1)
if b1.Time == b2.Time then b2 = b1 end
local goal = NumberSequenceKeypoint.new(1,0)
backGradient.Transparency = NumberSequence.new({start,a1,a2,b2,b1,goal})
outlinesGradient.Transparency = NumberSequence.new({start,a1,a2,b2,b1,goal})
end)
fastwait(0.4)
tweenNumber(100,ti,function(val)
val = val/166.66
local start = NumberSequenceKeypoint.new(0,0)
local a1 = NumberSequenceKeypoint.new(val,0)
local a2 = NumberSequenceKeypoint.new(val+0.01,1)
local goal = NumberSequenceKeypoint.new(1,1)
holderGradient.Transparency = NumberSequence.new({start,a1,a2,goal})
end)
tweenS:Create(titleText,ti,{Position = UDim2.new(0,60,0,15), TextTransparency = 0}):Play()
tweenS:Create(descText,ti,{Position = UDim2.new(0,20,0,60), TextTransparency = 0}):Play()
local function rightTextTransparency(obj)
tweenNumber(100,ti,function(val)
val = val/100
local a1 = NumberSequenceKeypoint.new(1-val,0)
local a2 = NumberSequenceKeypoint.new(math.max(0,1-val-0.01),1)
if a1.Time == a2.Time then a2 = a1 end
local start = NumberSequenceKeypoint.new(0,a1 == a2 and 0 or 1)
local goal = NumberSequenceKeypoint.new(1,0)
obj.Transparency = NumberSequence.new({start,a2,a1,goal})
end)
end
rightTextTransparency(versionGradient)
rightTextTransparency(creatorGradient)
fastwait(0.9)
local progressTI = TweenInfo.new(0.25,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
tweenS:Create(statusText,progressTI,{Position = UDim2.new(0,20,0,120), TextTransparency = 0}):Play()
tweenS:Create(progressBar,progressTI,{Position = UDim2.new(0,60,0,145), Size = UDim2.new(0,100,0,4)}):Play()
fastwait(0.25)
local function setProgress(text,n)
statusText.Text = text
tweenS:Create(progressBar.Bar,progressTI,{Size = UDim2.new(n,0,1,0)}):Play()
end
local function close()
tweenS:Create(titleText,progressTI,{TextTransparency = 1}):Play()
tweenS:Create(descText,progressTI,{TextTransparency = 1}):Play()
tweenS:Create(versionText,progressTI,{TextTransparency = 1}):Play()
tweenS:Create(creatorText,progressTI,{TextTransparency = 1}):Play()
tweenS:Create(statusText,progressTI,{TextTransparency = 1}):Play()
tweenS:Create(progressBar,progressTI,{BackgroundTransparency = 1}):Play()
tweenS:Create(progressBar.Bar,progressTI,{BackgroundTransparency = 1}):Play()
tweenS:Create(progressBar.ImageLabel,progressTI,{ImageTransparency = 1}):Play()
tweenNumber(100,TweenInfo.new(0.4,Enum.EasingStyle.Back,Enum.EasingDirection.In),function(val)
val = val/250
local start = NumberSequenceKeypoint.new(0,0)
local a1 = NumberSequenceKeypoint.new(0.6+val,0)
local a2 = NumberSequenceKeypoint.new(math.min(1,0.601+val),1)
if a1.Time == a2.Time then a2 = a1 end
local goal = NumberSequenceKeypoint.new(1,a1 == a2 and 0 or 1)
holderGradient.Transparency = NumberSequence.new({start,a1,a2,goal})
end)
fastwait(0.5)
gui.Main.BackgroundTransparency = 1
outlinesGradient.Rotation = 30
tweenNumber(100,ti,function(val)
val = val/100
local start = NumberSequenceKeypoint.new(0,1)
local a1 = NumberSequenceKeypoint.new(val,1)
local a2 = NumberSequenceKeypoint.new(math.min(1,val+math.min(0.05,val)),0)
if a1.Time == a2.Time then a2 = a1 end
local goal = NumberSequenceKeypoint.new(1,a1 == a2 and 1 or 0)
outlinesGradient.Transparency = NumberSequence.new({start,a1,a2,goal})
holderGradient.Transparency = NumberSequence.new({start,a1,a2,goal})
end)
fastwait(0.45)
gui:Destroy()
end
return {SetProgress = setProgress, Close = close}
end
Main.CreateApp = function(data)
if Main.MenuApps[data.Name] then return end -- TODO: Handle conflict
local control = {}
local app = Main.AppTemplate:Clone()
local iconIndex = data.Icon
if data.IconMap and iconIndex then
if type(iconIndex) == "number" then
data.IconMap:Display(app.Main.Icon,iconIndex)
elseif type(iconIndex) == "string" then
data.IconMap:DisplayByKey(app.Main.Icon,iconIndex)
end
elseif type(iconIndex) == "string" then
app.Main.Icon.Image = iconIndex
else
app.Main.Icon.Image = ""
end
local function updateState()
app.Main.BackgroundTransparency = data.Open and 0 or (Lib.CheckMouseInGui(app.Main) and 0 or 1)
app.Main.Highlight.Visible = data.Open
end
local function enable(silent)
if data.Open then return end
data.Open = true
updateState()
if not silent then
if data.Window then data.Window:Show() end
if data.OnClick then data.OnClick(data.Open) end
end
end
local function disable(silent)
if not data.Open then return end
data.Open = false
updateState()
if not silent then
if data.Window then data.Window:Hide() end
if data.OnClick then data.OnClick(data.Open) end
end
end
updateState()
local ySize = service.TextService:GetTextSize(data.Name,14,Enum.Font.SourceSans,Vector2.new(62,999999)).Y
app.Main.Size = UDim2.new(1,0,0,math.clamp(46+ySize,60,74))
app.Main.AppName.Text = data.Name
app.Main.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
app.Main.BackgroundTransparency = 0
app.Main.BackgroundColor3 = Settings.Theme.ButtonHover
end
end)
app.Main.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
app.Main.BackgroundTransparency = data.Open and 0 or 1
app.Main.BackgroundColor3 = Settings.Theme.Button
end
end)
app.Main.MouseButton1Click:Connect(function()
if data.Open then disable() else enable() end
end)
local window = data.Window
if window then
window.OnActivate:Connect(function() enable(true) end)
window.OnDeactivate:Connect(function() disable(true) end)
end
app.Visible = true
app.Parent = Main.AppsContainer
Main.AppsFrame.CanvasSize = UDim2.new(0,0,0,Main.AppsContainerGrid.AbsoluteCellCount.Y*82 + 8)
control.Enable = enable
control.Disable = disable
Main.MenuApps[data.Name] = control
return control
end
Main.SetMainGuiOpen = function(val)
Main.MainGuiOpen = val
Main.MainGui.OpenButton.Text = val and "X" or "Dex"
if val then Main.MainGui.OpenButton.MainFrame.Visible = true end
Main.MainGui.OpenButton.MainFrame:TweenSize(val and UDim2.new(0,224,0,200) or UDim2.new(0,0,0,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,0.2,true)
--Main.MainGui.OpenButton.BackgroundTransparency = val and 0 or (Lib.CheckMouseInGui(Main.MainGui.OpenButton) and 0 or 0.2)
service.TweenService:Create(Main.MainGui.OpenButton,TweenInfo.new(0.2,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{BackgroundTransparency = val and 0 or (Lib.CheckMouseInGui(Main.MainGui.OpenButton) and 0 or 0.2)}):Play()
if Main.MainGuiMouseEvent then Main.MainGuiMouseEvent:Disconnect() end
if not val then
local startTime = tick()
Main.MainGuiCloseTime = startTime
coroutine.wrap(function()
Lib.FastWait(0.2)
if not Main.MainGuiOpen and startTime == Main.MainGuiCloseTime then Main.MainGui.OpenButton.MainFrame.Visible = false end
end)()
else
Main.MainGuiMouseEvent = service.UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 and not Lib.CheckMouseInGui(Main.MainGui.OpenButton) and not Lib.CheckMouseInGui(Main.MainGui.OpenButton.MainFrame) then
Main.SetMainGuiOpen(false)
end
end)
end
end
Main.CreateMainGui = function()
local gui = create({
{1,"ScreenGui",{IgnoreGuiInset=true,Name="MainMenu",}},
{2,"TextButton",{AnchorPoint=Vector2.new(0.5,0),AutoButtonColor=false,BackgroundColor3=Color3.new(0.17647059261799,0.17647059261799,0.17647059261799),BorderSizePixel=0,Font=4,Name="OpenButton",Parent={1},Position=UDim2.new(0.5,0,0,2),Size=UDim2.new(0,32,0,32),Text="Dex",TextColor3=Color3.new(1,1,1),TextSize=16,TextTransparency=0.20000000298023,}},
{3,"UICorner",{CornerRadius=UDim.new(0,4),Parent={2},}},
{4,"Frame",{AnchorPoint=Vector2.new(0.5,0),BackgroundColor3=Color3.new(0.17647059261799,0.17647059261799,0.17647059261799),ClipsDescendants=true,Name="MainFrame",Parent={2},Position=UDim2.new(0.5,0,1,-4),Size=UDim2.new(0,224,0,200),}},
{5,"UICorner",{CornerRadius=UDim.new(0,4),Parent={4},}},
{6,"Frame",{BackgroundColor3=Color3.new(0.20392157137394,0.20392157137394,0.20392157137394),Name="BottomFrame",Parent={4},Position=UDim2.new(0,0,1,-24),Size=UDim2.new(1,0,0,24),}},
{7,"UICorner",{CornerRadius=UDim.new(0,4),Parent={6},}},
{8,"Frame",{BackgroundColor3=Color3.new(0.20392157137394,0.20392157137394,0.20392157137394),BorderSizePixel=0,Name="CoverFrame",Parent={6},Size=UDim2.new(1,0,0,4),}},
{9,"Frame",{BackgroundColor3=Color3.new(0.1294117718935,0.1294117718935,0.1294117718935),BorderSizePixel=0,Name="Line",Parent={8},Position=UDim2.new(0,0,0,-1),Size=UDim2.new(1,0,0,1),}},
{10,"TextButton",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=3,Name="Settings",Parent={6},Position=UDim2.new(1,-48,0,0),Size=UDim2.new(0,24,1,0),Text="",TextColor3=Color3.new(1,1,1),TextSize=14,}},
{11,"ImageLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Image="rbxassetid://6578871732",ImageTransparency=0.20000000298023,Name="Icon",Parent={10},Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,16,0,16),}},
{12,"TextButton",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Font=3,Name="Information",Parent={6},Position=UDim2.new(1,-24,0,0),Size=UDim2.new(0,24,1,0),Text="",TextColor3=Color3.new(1,1,1),TextSize=14,}},
{13,"ImageLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Image="rbxassetid://6578933307",ImageTransparency=0.20000000298023,Name="Icon",Parent={12},Position=UDim2.new(0,4,0,4),Size=UDim2.new(0,16,0,16),}},
{14,"ScrollingFrame",{Active=true,AnchorPoint=Vector2.new(0.5,0),BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderColor3=Color3.new(0.1294117718935,0.1294117718935,0.1294117718935),BorderSizePixel=0,Name="AppsFrame",Parent={4},Position=UDim2.new(0.5,0,0,0),ScrollBarImageColor3=Color3.new(0,0,0),ScrollBarThickness=4,Size=UDim2.new(0,222,1,-25),}},
{15,"Frame",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Name="Container",Parent={14},Position=UDim2.new(0,7,0,8),Size=UDim2.new(1,-14,0,2),}},
{16,"UIGridLayout",{CellSize=UDim2.new(0,66,0,74),Parent={15},SortOrder=2,}},
{17,"Frame",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Name="App",Parent={1},Size=UDim2.new(0,100,0,100),Visible=false,}},
{18,"TextButton",{AutoButtonColor=false,BackgroundColor3=Color3.new(0.2352941185236,0.2352941185236,0.2352941185236),BorderSizePixel=0,Font=3,Name="Main",Parent={17},Size=UDim2.new(1,0,0,60),Text="",TextColor3=Color3.new(0,0,0),TextSize=14,}},
{19,"ImageLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,Image="rbxassetid://6579106223",ImageRectSize=Vector2.new(32,32),Name="Icon",Parent={18},Position=UDim2.new(0.5,-16,0,4),ScaleType=4,Size=UDim2.new(0,32,0,32),}},
{20,"TextLabel",{BackgroundColor3=Color3.new(1,1,1),BackgroundTransparency=1,BorderSizePixel=0,Font=3,Name="AppName",Parent={18},Position=UDim2.new(0,2,0,38),Size=UDim2.new(1,-4,1,-40),Text="Explorer",TextColor3=Color3.new(1,1,1),TextSize=14,TextTransparency=0.10000000149012,TextTruncate=1,TextWrapped=true,TextYAlignment=0,}},
{21,"Frame",{BackgroundColor3=Color3.new(0,0.66666668653488,1),BorderSizePixel=0,Name="Highlight",Parent={18},Position=UDim2.new(0,0,1,-2),Size=UDim2.new(1,0,0,2),}},
})
Main.MainGui = gui
Main.AppsFrame = gui.OpenButton.MainFrame.AppsFrame
Main.AppsContainer = Main.AppsFrame.Container
Main.AppsContainerGrid = Main.AppsContainer.UIGridLayout
Main.AppTemplate = gui.App
Main.MainGuiOpen = false
local openButton = gui.OpenButton
openButton.BackgroundTransparency = 0.2
openButton.MainFrame.Size = UDim2.new(0,0,0,0)
openButton.MainFrame.Visible = false
openButton.MouseButton1Click:Connect(function()
Main.SetMainGuiOpen(not Main.MainGuiOpen)
end)
openButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
service.TweenService:Create(Main.MainGui.OpenButton,TweenInfo.new(0,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{BackgroundTransparency = 0}):Play()
end
end)
openButton.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
service.TweenService:Create(Main.MainGui.OpenButton,TweenInfo.new(0,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{BackgroundTransparency = Main.MainGuiOpen and 0 or 0.2}):Play()
end
end)
-- Create Main Apps
Main.CreateApp({Name = "Explorer", IconMap = Main.LargeIcons, Icon = "Explorer", Open = true, Window = Explorer.Window})
Main.CreateApp({Name = "Properties", IconMap = Main.LargeIcons, Icon = "Properties", Open = true, Window = Properties.Window})
Main.CreateApp({Name = "Script Viewer", IconMap = Main.LargeIcons, Icon = "Script_Viewer", Window = ScriptViewer.Window})
Lib.ShowGui(gui)
end
Main.SetupFilesystem = function()
if not env.writefile or not env.makefolder then return end
local writefile,makefolder = env.writefile,env.makefolder