-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnow
7048 lines (7048 loc) · 285 KB
/
Snow
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
local library = {
Version = "2",
WorkspaceName = "Snow Hub",
flags = {},
signals = {},
objects = {},
elements = {},
globals = {},
subs = {},
colored = {},
configuration = {
hideKeybind = Enum.KeyCode.RightControl,
smoothDragging = false,
easingStyle = Enum.EasingStyle.Quart,
easingDirection = Enum.EasingDirection.Out
},
colors = {
main = Color3.fromRGB(80, 245, 245),
background = Color3.fromRGB(40, 40, 40),
outerBorder = Color3.fromRGB(15, 15, 15),
innerBorder = Color3.fromRGB(73, 63, 73),
topGradient = Color3.fromRGB(35, 35, 35),
bottomGradient = Color3.fromRGB(29, 29, 29),
sectionBackground = Color3.fromRGB(35, 34, 34),
section = Color3.fromRGB(176, 175, 176),
otherElementText = Color3.fromRGB(255, 255, 250),
elementText = Color3.fromRGB(255, 255, 250),
elementBorder = Color3.fromRGB(20, 20, 20),
selectedOption = Color3.fromRGB(55, 55, 55),
unselectedOption = Color3.fromRGB(40, 40, 40),
hoveredOptionTop = Color3.fromRGB(65, 65, 65),
unhoveredOptionTop = Color3.fromRGB(50, 50, 50),
hoveredOptionBottom = Color3.fromRGB(45, 45, 45),
unhoveredOptionBottom = Color3.fromRGB(35, 35, 35),
tabText = Color3.fromRGB(185, 185, 185)
},
gui_parent = (function()
local x, c = pcall(function()
return game:GetService("CoreGui")
end)
if x and c then
return c
end
x, c = pcall(function()
return (game:IsLoaded() or (game.Loaded:Wait() or 1)) and game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
end)
if x and c then
return c
end
x, c = pcall(function()
return game:GetService("StarterGui")
end)
if x and c then
return c
end
return error("Seriously bad engine. Can't find a place to store the GUI. Robust code can't help this much incompetence.")
end)(),
colorpicker = false,
colorpickerconflicts = {},
rainbowflags = {},
rainbows = 0,
rainbowsg = 0
}
library.Subs = library.subs
local library_flags = library.flags
library.Flags = library_flags
local destroyrainbows, destroyrainbowsg = nil
function darkenColor(clr, intensity)
if not intensity or (intensity == 1) then
return clr
end
if clr and ((typeof(clr) == "Color3") or (type(clr) == "table")) then
return Color3.new(clr.R / intensity, clr.G / intensity, clr.B / intensity)
end
end
library.subs.darkenColor = darkenColor
local __runscript = true
local function wait_check(...)
if __runscript then
return wait(...)
else
wait()
return false
end
end
library.subs.Wait, library.subs.wait = wait_check, wait_check
function library.IsGuiValid()
return __runscript
end
local lasthidebing = 0
local temp = game:FindService("MarketplaceService") or game:GetService("MarketplaceService")
local Marketplace = (temp and (cloneref and cloneref(temp))) or temp
local resolvevararg, temp = nil
do
local lwr = string.lower
function library.defaultSort(a, b)
return lwr(tostring(b)) > lwr(tostring(a))
end
end
do
local varargresolve = {
Window = {"Name", "Theme"},
Tab = {"Name", "Image"},
Section = {"Name", "Side"},
Label = {"Text", "Flag", "UnloadValue", "UnloadFunc"},
Toggle = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Locked", "Keybind", "Condition", "AllowDuplicateCalls"},
Textbox = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Placeholder", "Type", "Min", "Max", "Decimals", "Hex", "Binary", "Base", "RichTextBox", "MultiLine", "TextScaled", "TextFont", "PreFormat", "PostFormat", "CustomProperties", "AllowDuplicateCalls"},
Slider = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Min", "Max", "Decimals", "Format", "IllegalInput", "Textbox", "AllowDuplicateCalls"},
Button = {"Name", "Callback", "Locked", "Condition"},
Keybind = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Pressed", "KeyNames", "AllowDuplicateCalls"},
Dropdown = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "List", "Filter", "Method", "Nothing", "Sort", "MultiSelect", "ItemAdded", "ItemRemoved", "ItemChanged", "ItemsCleared", "ScrollUpButton", "ScrollDownButton", "ScrollButtonRate", "DisablePrecisionScrolling", "AllowDuplicateCalls"},
SearchBox = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "List", "Filter", "Method", "Nothing", "Sort", "MultiSelect", "ItemAdded", "ItemRemoved", "ItemChanged", "ItemsCleared", "ScrollUpButton", "ScrollDownButton", "ScrollButtonRate", "DisablePrecisionScrolling", "RegEx", "AllowDuplicateCalls"},
Colorpicker = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Rainbow", "Random", "AllowDuplicateCalls"},
Persistence = {"Name", "Value", "Callback", "Flag", "Location", "LocationFlag", "UnloadValue", "UnloadFunc", "Workspace", "Persistive", "Suffix", "LoadCallback", "SaveCallback", "PostLoadCallback", "PostSaveCallback", "ScrollUpButton", "ScrollDownButton", "ScrollButtonRate", "DisablePrecisionScrolling", "AllowDuplicateCalls"},
Designer = {"Backdrop", "Image", "Info", "Credit"}
}
function resolvevararg(objtype, ...)
local data = varargresolve[objtype]
local t = {}
if data then
for index, value in next, {...} do
t[data[index]] = value
end
end
return t
end
end
local resolvercache = {}
library.resolvercache = resolvercache
local function resolveid(image, flag)
if image then
if type(image) == "string" then
if (#image > 14 and string.sub(image, 1, 13) == "rbxassetid://") or (#image > 12 and string.sub(image, 1, 11) == "rbxasset://") or (#image > 12 and string.sub(image, 1, 11) ~= "rbxthumb://") then
if flag then
local thing = library.elements[flag] or library.designerelements[flag]
if thing and thing.Set then
task.spawn(thing.Set, thing, image)
end
end
return image
end
end
local orig = image
if resolvercache[orig] then
if flag then
local thing = library.elements[flag] or library.designerelements[flag]
if thing and thing.Set then
task.spawn(thing.Set, thing, resolvercache[orig])
end
end
return resolvercache[orig]
end
image = tonumber(image) or image
local succezz = pcall(function()
local typ = type(image)
if typ == "string" then
if getsynasset then
if #image > 11 and (string.sub(image, 1, 11) == "synasset://") then
return getsynasset(string.sub(image, 12))
elseif (#image > 14) and (string.sub(image, 1, 14) == "synasseturl://") then
local x, e = pcall(function()
local codename, fixes = string.gsub(image, ".", function(c)
if c:lower() == c:upper() and not tonumber(c) then
return ""
end
end)
codename = string.sub(codename, 1, 24) .. tostring(fixes)
local fold = isfolder("./Pepsi Lib")
if fold then
else
makefolder("./Pepsi Lib")
end
fold = isfolder("./Pepsi Lib/Themes")
if fold then
else
makefolder("./Pepsi Lib/Themes")
end
fold = isfolder("./Pepsi Lib/Themes/SynapseAssetsCache")
if fold then
else
makefolder("./Pepsi Lib Themes/SynapseAssetsCache")
end
if not fold or not isfile("./Pepsi Lib/Themes/SynapseAssetsCache/" .. codename .. ".dat") then
local res = game:HttpGet(string.sub(image, 15))
if res ~= nil then
writefile("./Pepsi Lib/Themes/SynapseAssetsCache/" .. codename .. ".dat", res)
end
end
return getsynasset(readfile("./Pepsi Lib/Themes/SynapseAssetsCache/" .. codename .. ".dat"))
end)
if x and e ~= nil then
return e
end
end
end
if (#image < 11) or ((string.sub(image, 1, 13) ~= "rbxassetid://") and (string.sub(image, 1, 11) ~= "rbxasset://") and string.sub(image, 1, 11) ~= "rbxthumb://") then
image = tonumber(image:gsub("%D", ""), 10) or image
typ = type(image)
end
end
if (typ == "number") and (image > 0) then
pcall(function()
local nfo = Marketplace and Marketplace:GetProductInfo(image)
image = tostring(image)
if nfo and nfo.AssetTypeId == 1 then
image = "rbxassetid://" .. image
elseif nfo.AssetTypeId == 13 then
local decal = game:GetObjects("rbxassetid://" .. image)[1]
image = "rbxassetid://" .. ((decal and decal.Texture) or "0"):match("%d+$")
decal = (decal and decal:Destroy() and nil) or nil
end
end)
else
image = nil
end
end)
if succezz and image then
if orig then
resolvercache[orig] = image
end
resolvercache[image] = image
if flag then
local thing = library.elements[flag] or library.designerelements[flag]
if thing and thing.Set then
task.spawn(thing.Set, thing, image)
end
end
end
end
return image
end
library.subs.ResolveID = resolveid
library.resolvercache = resolvercache
local colored, colors = library.colored, library.colors
local tweenService = game:GetService("TweenService")
local updatecolors, MainScreenGui = nil
do
local MayGC = 0
spawn(function()
local IsDescendantOf = game.IsDescendantOf
local RemoveTable = table.remove
while wait_check() do
wait(10)
local Breathe = 30
for DataIndex = #colored, 1, -1 do
if MayGC > 0 then
break
end
Breathe -= 1
if Breathe <= 0 then
Breathe = 30
if wait_check() then
if MayGC > 0 then
break
end
else
return
end
end
if MayGC > 0 then
break
end
local data = colored[DataIndex]
data = data and data[1]
if data and (typeof(data) == "Instance") and IsDescendantOf(data, MainScreenGui) then
elseif MayGC <= 0 then
RemoveTable(colored, DataIndex)
else
break
end
end
local sigs = library.signals
local len = sigs and #sigs
if len then
local Dyn = math.round(len / 10)
Dyn = ((Dyn < 1) and 1) or Dyn
for DataIndex = len, 1, -1 do
Breathe -= 1
if Breathe <= 0 then
Breathe = Dyn
if wait_check() then
else
return
end
end
local data = colored[DataIndex]
if data and (typeof(data) == "RBXScriptConnection") and data.Connected then
else
RemoveTable(colored, DataIndex)
end
end
end
end
end)
local function colortwee(data, tweenit)
local cclr = colors[data[3]]
local darkness = data[4]
tweenService:Create(data[1], TweenInfo.new(tweenit, library.configuration.easingStyle, library.configuration.easingDirection), {
[data[2]] = (darkness and darkness ~= 1 and darkenColor(cclr, darkness)) or cclr
}):Play()
end
local function colordarktwee(data)
local cclr = colors[data[3]]
local darkness = data[4]
data[1][data[2]] = (darkness and darkness ~= 1 and darkenColor(cclr, darkness)) or cclr
end
function updatecolors(tweenit)
MayGC += 1
if library.objects and (#library.objects > 0 or next(library.objects)) then
for _, data in next, colored do
local x, e
if tweenit then
x, e = pcall(colortwee, data, tweenit)
end
if not x then
local x, e = pcall(colordarktwee, data)
if not x and e then
warn(debug.traceback(e))
end
end
end
pcall(function()
if library.Backdrop then
library.Backdrop.Visible = library_flags["__Designer.Background.UseBackgroundImage"] and true
library.Backdrop.Image = resolveid(library_flags["__Designer.Background.ImageAssetID"], "__Designer.Background.ImageAssetID") or ""
library.Backdrop.ImageColor3 = library_flags["__Designer.Background.ImageColor"] or Color3.new(1, 1, 1)
library.Backdrop.ImageTransparency = (library_flags["__Designer.Background.ImageTransparency"] or 95) / 100
end
end)
end
MayGC -= 1
end
end
local function updatecolorsnotween()
updatecolors()
end
library.subs.updatecolors = updatecolors
library.colors = setmetatable({}, {
__index = colors,
__newindex = function(_, k, v)
if colors[k] ~= v then
colors[k] = v
spawn(updatecolorsnotween)
end
end
})
local elements = library.elements
shared.libraries = shared.libraries or {}
local colorpickerconflicts = library.colorpickerconflicts
local keyHandler = {
notAllowedKeys = {
[Enum.KeyCode.Return] = true,
[Enum.KeyCode.Space] = true,
[Enum.KeyCode.Tab] = true,
[Enum.KeyCode.Unknown] = true,
[Enum.KeyCode.Backspace] = true
},
notAllowedMouseInputs = {
[Enum.UserInputType.MouseMovement] = true,
[Enum.UserInputType.MouseWheel] = true,
[Enum.UserInputType.MouseButton1] = true,
[Enum.UserInputType.MouseButton2] = true,
[Enum.UserInputType.MouseButton3] = true
},
allowedKeys = {
[Enum.KeyCode.LeftShift] = "LShift",
[Enum.KeyCode.RightShift] = "RShift",
[Enum.KeyCode.LeftControl] = "LCtrl",
[Enum.KeyCode.RightControl] = "RCtrl",
[Enum.KeyCode.LeftAlt] = "LAlt",
[Enum.KeyCode.RightAlt] = "RAlt",
[Enum.KeyCode.CapsLock] = "CAPS",
[Enum.KeyCode.One] = "1",
[Enum.KeyCode.Two] = "2",
[Enum.KeyCode.Three] = "3",
[Enum.KeyCode.Four] = "4",
[Enum.KeyCode.Five] = "5",
[Enum.KeyCode.Six] = "6",
[Enum.KeyCode.Seven] = "7",
[Enum.KeyCode.Eight] = "8",
[Enum.KeyCode.Nine] = "9",
[Enum.KeyCode.Zero] = "0",
[Enum.KeyCode.KeypadOne] = "Num-1",
[Enum.KeyCode.KeypadTwo] = "Num-2",
[Enum.KeyCode.KeypadThree] = "Num-3",
[Enum.KeyCode.KeypadFour] = "Num-4",
[Enum.KeyCode.KeypadFive] = "Num-5",
[Enum.KeyCode.KeypadSix] = "Num-6",
[Enum.KeyCode.KeypadSeven] = "Num-7",
[Enum.KeyCode.KeypadEight] = "Num-8",
[Enum.KeyCode.KeypadNine] = "Num-9",
[Enum.KeyCode.KeypadZero] = "Num-0",
[Enum.KeyCode.Minus] = "-",
[Enum.KeyCode.Equals] = "=",
[Enum.KeyCode.Tilde] = "~",
[Enum.KeyCode.LeftBracket] = "[",
[Enum.KeyCode.RightBracket] = "]",
[Enum.KeyCode.RightParenthesis] = ")",
[Enum.KeyCode.LeftParenthesis] = "(",
[Enum.KeyCode.Semicolon] = ";",
[Enum.KeyCode.Quote] = "'",
[Enum.KeyCode.BackSlash] = "\\",
[Enum.KeyCode.Comma] = ",",
[Enum.KeyCode.Period] = ".",
[Enum.KeyCode.Slash] = "/",
[Enum.KeyCode.Asterisk] = "*",
[Enum.KeyCode.Plus] = "+",
[Enum.KeyCode.Period] = ".",
[Enum.KeyCode.Backquote] = "`"
}
}
local SeverAllConnections = nil
function SeverAllConnections(t, cache)
cache = cache or {}
for k, v in next, t do
t[k] = nil
if v ~= nil then
if cache[v] then
continue
end
local te = v and typeof(v)
if te then
if te == "RBXScriptConnection" then
v:Disconnect()
elseif te == "Instance" then
v:Destroy()
elseif te == "table" then
cache[v] = true
SeverAllConnections(v, cache)
end
end
end
end
end
local function hardunload(library)
if library.UnloadCallback and (type(library.UnloadCallback) == "function") then
local x, e = pcall(library.UnloadCallback)
if not x and e then
task.spawn(error, e, 2)
end
end
for cflag, data in next, elements do
if data.Type ~= "Persistence" then
if data.Set and data.Options.UnloadValue ~= nil then
data.Set(data.Options.UnloadValue)
end
if data.Options.UnloadFunc then
local y, u = pcall(data.Options.UnloadFunc)
if not y and u then
warn(debug.traceback("Error unloading '" .. tostring(cflag) .. "'\n" .. u))
end
end
end
end
local hardcache = {}
SeverAllConnections(library.signals, hardcache)
SeverAllConnections(library.objects, hardcache)
hardcache = (table.clear(hardcache) and nil) or nil
library.signals = nil
library.objects = nil
end
library.Subs.UnloadArg = hardunload
local function unloadall()
if shared.libraries then
local b = 50
while #shared.libraries > 0 do
b = b - 1
if b < 0 then
b = 50
wait(warn("Looped 50 times while unloading....?"))
end
local v = shared.libraries[1]
if v and v.unload and (type(v.unload) == "function") then
if not pcall(v.unload) then
pcall(hardunload, v)
for k in next, v do
v[k] = nil
end
end
if shared.libraries then
pcall(function()
table.remove(shared.libraries, 1)
end)
else
return pcall(hardunload, library)
end
end
end
end
shared.libraries = nil
end
shared.unloadall = unloadall
library.unloadall = unloadall
shared.libraries[1 + #shared.libraries] = library
function library.unload()
__runscript = nil
hardunload(library)
if shared.libraries then
for k, v in next, shared.libraries or {} do
if v == library then
for k in next, table.remove(shared.libraries or {}, k) do
v[k] = nil
end
break
end
end
if shared.libraries and (#shared.libraries == 0) then
shared.libraries = nil
end
end
warn("Unloaded")
end
library.Unload = library.unload
local Instance_new = (syn and syn.protect_gui and function(...)
local x = {Instance.new(...)}
if x[1] then
library.objects[1 + #library.objects] = x[1]
pcall(syn.protect_gui, x[1])
end
return unpack(x)
end) or function(...)
local x = {Instance.new(...)}
if x[1] then
library.objects[1 + #library.objects] = x[1]
end
return unpack(x)
end
library.subs.Instance_new = Instance_new
local playersservice = game:GetService("Players")
local function getresolver(listt, filter, method, _)
local huo, args = type(filter), {}
local hou = typeof(listt)
return ((hou == "function") and function(...)
return listt(...)
end) or ((hou == "table") and function()
return listt
end) or function()
local hardtype = nil
local g = listt
for _ = 1, 5 do
hardtype = typeof(g)
if hardtype == "function" then
local x, e = pcall(listt)
if x and e then
g = e
end
hardtype = typeof(g)
end
if hardtype == "Instance" then
local lastg = g
if method == nil and listt == playersservice then
g = listt:GetPlayers()
end
if method then
local metype = type(method)
if metype == "table" then
method = method.Method or method[1]
args = method.Args or method.Arguments or unpack(method, (method.Method ~= nil and 1) or 2)
metype = type(method)
end
local y, u = nil, nil
if metype == "function" then
y, u = pcall(method, listt, unpack(args))
elseif metype == "string" then
local y, u = pcall(function()
return listt[method](listt, unpack(args))
end)
else
warn("Idk how to handle method type of", metype, debug.traceback(""))
end
if u then
if y then
g = u
else
warn("Error trying method", method, "on", listt, debug.traceback(u))
end
end
end
if g == lastg then
g = listt:GetChildren()
end
end
if hardtype == "Enum" then
g = listt:GetEnumItems()
end
hardtype = typeof(g)
if hardtype == "table" then
break
end
end
hardtype = typeof(g)
if hardtype ~= "table" then
warn("Could not resolve " .. hou .. " type to a list.")
return {}
end
if filter then
if huo == "function" then
local accept = {}
for _, v in next, g do
local x, e = pcall(filter, v)
if x and e then
accept[1 + #accept] = (e == true and v) or e
end
end
g = accept
elseif huo == "string" then
local accept = {}
for _, v in next, g do
if tostring(v):lower():find(huo) then
accept[1 + #accept] = v
end
end
g = accept
elseif huo == "table" then
local accept = {}
if type(filter[1]) == "string" then
for _, v in next, g do
if tostring(v):lower():find(huo) then
accept[1 + #accept] = v
elseif filter[0] then
accept[1 + #accept] = v
end
end
else
for _, v in next, g do
if not table.find(filter, v) and not table.find(filter, tostring(v)) then
accept[1 + #accept] = v
elseif not filter[0] then
accept[1 + #accept] = v
end
end
end
g = accept
end
end
return g
end
end
library.subs.GetResolver = getresolver
local function resetall()
destroyrainbowsg = true
pcall(function()
for k, v in next, elements do
if v and k and v.Set and (v.Default ~= nil) and (library_flags[k] ~= v.Default) and (string.sub(k, 1, 11) ~= "__Designer.") then
v:Set(v.Default)
end
end
end)
end
library.ResetAll = resetall
local textService = game:GetService("TextService")
local userInputService = game:GetService("UserInputService")
local runService = game:GetService("RunService")
local LP = playersservice.LocalPlayer
library.LP = LP
library.Players = playersservice
library.UserInputService = userInputService
library.RunService = runService
local mouse = LP and LP:GetMouse()
if not mouse and PluginManager and runService:IsStudio() then
shared.library_plugin = shared.library_plugin or print("Creating Studio Test-Plugin...") or PluginManager():CreatePlugin()
mouse = shared.library_plugin:GetMouse()
library.plugin = shared.library_plugin
end
library.Mouse = mouse
local textToSize = nil
do
local textService = game:GetService("TextService")
local bigv2 = Vector2.one * math.huge
function textToSize(object)
return textService:GetTextSize(object.Text, object.TextSize, object.Font, bigv2)
end
end
library.subs.textToSize = textToSize
local function removeSpaces(str)
if str then
local newStr = str:gsub(" ", "")
return newStr
end
end
library.subs.removeSpaces = removeSpaces
local function Color3FromHex(hex)
hex = hex:gsub("#", ""):upper():gsub("0X", "")
return Color3.fromRGB(tonumber(hex:sub(1, 2), 16), tonumber(hex:sub(3, 4), 16), tonumber(hex:sub(5, 6), 16))
end
library.subs.Color3FromHex = Color3FromHex
local floor = math.floor
local function Color3ToHex(color)
local r, g, b = string.format("%X", floor(color.R * 255)), string.format("%X", floor(color.G * 255)), string.format("%X", floor(color.B * 255))
if #r < 2 then
r = "0" .. r
end
if #g < 2 then
g = "0" .. g
end
if #b < 2 then
b = "0" .. b
end
return string.format("%s%s%s", r, g, b)
end
if Color3.ToHex and not shared.overridecolortohex then
local x, e = pcall(Color3.ToHex, Color3.new())
if x and type(e) == "string" and #e == 6 then
Color3ToHex = Color3.ToHex
end
end
library.subs.Color3ToHex = Color3ToHex
local isDraggingSomething = false
local function makeDraggable(topBarObject, object)
local dragging = nil
local dragInput = nil
local dragStart = nil
local startPosition = nil
library.signals[1 + #library.signals] = topBarObject.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPosition = object.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
library.signals[1 + #library.signals] = topBarObject.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
library.signals[1 + #library.signals] = userInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - dragStart
if not isDraggingSomething and library.configuration.smoothDragging then
tweenService:Create(object, TweenInfo.new(0.25, library.configuration.easingStyle, library.configuration.easingDirection), {
Position = UDim2.new(startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y)
}):Play()
elseif not isDraggingSomething and not library.configuration.smoothDragging then
object.Position = UDim2.new(startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y)
end
end
end)
end
library.subs.makeDraggable = makeDraggable
local JSONEncode, JSONDecode = nil, nil
do
local temp_http = game:FindService("HttpService") or game:GetService("HttpService")
local httpservice = temp_http
if cloneref and (type(cloneref) == "function") then
httpservice, temp_http = cloneref(httpservice), nil
end
library.Http = httpservice
local JSONEncodeFunc = httpservice.JSONEncode
function JSONEncode(...)
return pcall(JSONEncodeFunc, httpservice, ...)
end
library.JSONEncode = JSONEncode
local JSONDecodeFunc = httpservice.JSONDecode
function JSONDecode(...)
return pcall(JSONDecodeFunc, httpservice, ...)
end
library.JSONDecode = JSONDecode
end
local convertfilename
do
local string_gsub = string.gsub
function convertfilename(str, default, replace)
replace = replace or "_"
local corrections = 0
local predname = string_gsub(str, "%W", function(c)
local byt = c:byte()
if ((byt == 0) or (byt == 32) or (byt == 33) or (byt == 59) or (byt == 61) or ((byt >= 35) and (byt <= 41)) or ((byt >= 43) and (byt <= 57)) or ((byt >= 64) and (byt <= 123)) or ((byt >= 125) and (byt <= 127))) then
else
corrections = 1 + corrections
return replace
end
end)
return (default and corrections == #predname and tostring(default)) or predname
end
library.subs.ConvertFilename = convertfilename
end
do
do
local function NewOption(TextStr, Order, Parent)
local Option = Instance_new("Frame")
local BBorder = Instance_new("Frame")
local Inner_2 = Instance_new("Frame")
local Border_2 = Instance_new("Frame")
local Text = Instance_new("TextLabel")
local Button = Instance_new("TextButton")
Option.AnchorPoint = Vector2.new(0, 0.5)
Option.BackgroundColor3 = library.colors.background
colored[1 + #colored] = {Option, "BackgroundColor3", "background"}
Option.BorderColor3 = Color3.fromRGB(27, 27, 27)
Option.LayoutOrder = Order or #Parent:GetChildren()
Option.Name = "Option"
Option.Position = UDim2.new(0, 5, 0.5, 0)
Option.Size = UDim2.new(0, 35, 0, 25)
BBorder.AnchorPoint = Vector2.new(0.5, 0.5)
BBorder.BackgroundColor3 = library.colors.background
colored[1 + #colored] = {BBorder, "BackgroundColor3", "background"}
BBorder.BorderColor3 = Color3.fromRGB(50, 43, 50)
BBorder.BorderMode = Enum.BorderMode.Inset
BBorder.Name = "BBorder"
BBorder.Parent = Option
BBorder.Position = UDim2.new(0.5, 0, 0.5, 0)
BBorder.Size = UDim2.new(1, 0, 1, 0)
Inner_2.AnchorPoint = Vector2.new(0.5, 0.5)
Inner_2.BackgroundColor3 = library.colors.background
colored[1 + #colored] = {Inner_2, "BackgroundColor3", "background"}
Inner_2.BorderColor3 = Color3.fromRGB(27, 27, 27)
Inner_2.Name = "Inner"
Inner_2.Parent = Option
Inner_2.Position = UDim2.new(0.5, 0, 0.5, 0)
Inner_2.Size = UDim2.new(1, -6, 1, -6)
Border_2.AnchorPoint = Vector2.new(0.5, 0.5)
Border_2.BackgroundColor3 = library.colors.background
colored[1 + #colored] = {Border_2, "BackgroundColor3", "background"}
Border_2.BorderColor3 = Color3.fromRGB(50, 43, 50)
Border_2.BorderMode = Enum.BorderMode.Inset
Border_2.Name = "Border"
Border_2.Parent = Inner_2
Border_2.Position = UDim2.new(0.5, 0, 0.5, 0)
Border_2.Size = UDim2.new(1, 0, 1, 0)
Text.AnchorPoint = Vector2.new(0.5, 0.5)
Text.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Text.BackgroundTransparency = 1
Text.Font = Enum.Font.Code
Text.FontSize = Enum.FontSize.Size14
Text.Name = "Text"
Text.Parent = Border_2
Text.Position = UDim2.new(0.5, 0, 0.5, 0)
Text.Size = UDim2.new(1, 0, 1, 0)
Text.TextColor3 = library.colors.elementText
colored[1 + #colored] = {Text, "TextColor3", "elementText"}
Text.TextSize = 14
Text.TextStrokeTransparency = 0.75
Button.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Button.BackgroundTransparency = 1
Button.BorderSizePixel = 0
Button.Font = Enum.Font.SourceSans
Button.FontSize = Enum.FontSize.Size14
Button.Name = "Button"
Button.Parent = Option
Button.Size = UDim2.new(1, 0, 1, 0)
Button.Text = ""
Button.TextColor3 = Color3.fromRGB(0, 0, 0)
Button.TextSize = 14
Button.TextTransparency = 1
Text.Text = TextStr
local siz = textToSize(Text)
Option.Size = UDim2.new(0, math.max(siz.X, 28) + 12, 0, 25)
Option.Parent = Parent
return Option, Button, Text
end
local function AddOption(OptionData, Key, OptionCount, Parent, Close, PromptEvent, KeepOpen)
local Enabled = OptionData.Enabled
if OptionData.Disabled then
Enabled = false
else
Enabled = Enabled or (Enabled == nil)
end
local OptionText = OptionData.Text or OptionData.String or OptionData.Message or OptionData.Value or OptionData.Name or Key
local Callback = OptionData.Callback or OptionData.OnPressed or OptionData.Function or nil
local Order = tonumber(OptionData.Slot or OptionData.Order or OptionData.LayoutOrder or OptionData.Index or OptionCount)
local OptionIns, OptionButton, OptionTxt = NewOption(tostring(OptionText), Order, Parent)
local OptionObj = {
Text = OptionText,
Callback = Callback,
ButtonObject = OptionIns,
Pressed = OptionButton.MouseButton1Click,
PressedRight = OptionButton.MouseButton2Click,
Activated = OptionButton.Activated,
TextButton = OptionButton,
Order = Order,
Enabled = Enabled
}
function OptionObj.Remove()
do
local Btn = OptionObj.ButtonObject
if Btn then
Btn:Destroy()
end
end
for k in next, OptionObj do
rawset(OptionObj, k, nil)
end
return true
end
local Proxy = nil
local function Clicked(f)
return function(...)
if f then
task.spawn(f, ...)
end
PromptEvent:Fire(Key, OptionButton.Text, ...)
if KeepOpen then
else
Close()
end
end
end
function OptionObj.Press(...)
OptionObj.Update()
Proxy = Proxy or Clicked(Callback)
Proxy(...)
end
function OptionObj.Lock()
OptionObj.Enabled = false
OptionObj.Update()
end
function OptionObj.Unlock()
OptionObj.Enabled = true
OptionObj.Update()
end
function OptionObj.SetLocked(self, state)
if type(self) == "boolean" then
state = self
end
OptionObj.Enabled = state
OptionObj.Update()
end
function OptionObj.SetCondition(self, Condition)
if type(self) ~= "table" then
Condition = self
end
OptionObj.Condition = Condition
OptionObj.Update()
end
function OptionObj.Update()
do
local OptionText = OptionObj.Text or OptionData.Text or OptionData.String or OptionData.Message or OptionData.Value or OptionData.Name or OptionButton.Text or Key
OptionButton.Text = tostring(OptionText)
end
OptionIns.LayoutOrder = tonumber(OptionObj.Order or OptionData.Slot or OptionData.Order or OptionData.LayoutOrder or OptionData.Index or OptionIns.LayoutOrder or OptionCount)
do
local Enabled = OptionData.Enabled
local Cond = OptionObj.Condition
if Cond then
local x, e = pcall(Cond, OptionObj)
if x then
Enabled = e and true
else
warn(debug.traceback(string.format("Error in prompt-option %s's Condition function: %s", OptionButton.Text, e), 2))
end
else
if OptionData.Disabled then
Enabled = false
else
Enabled = (Enabled and true) or (Enabled == nil)
end
end
local Proxy = nil
do
local nCallback = (Enabled and (OptionData.Callback or OptionData.OnPressed or OptionData.Function)) or nil
if not Proxy or Callback ~= nCallback then
Callback = nCallback
Proxy = Clicked(Callback)
OptionObj.PressedConnection = (OptionObj.PressedConnection and OptionObj.PressedConnection:Disconnect() and nil) or (Callback and OptionObj.Pressed:Connect(Proxy)) or nil
end
local PC = OptionObj.PressedConnection
if Enabled then
if PC then
if Callback then
else
OptionObj.PressedConnection = (PC:Disconnect() and nil) or nil
end
elseif Callback then
Proxy = Proxy or Clicked(Callback)
OptionObj.PressedConnection = OptionObj.Pressed:Connect(Proxy)
end
elseif PC then
OptionObj.PressedConnection = (PC:Disconnect() and nil) or nil
end
end
OptionObj.Enabled = Enabled
OptionTxt.TextTransparency = (Enabled and 0) or 0.5
end
return OptionObj
end
OptionObj.Update()
return OptionObj
end
local function SortByLayoutOrder(a, b)
return a.Order < b.Order
end
local DefaultSelections = {
Ok = true
}
function library.Prompt(self, PromptData, ...)
if rawequal(self, library) then
else
PromptData, self = self, library
end
local PromptEvent = Instance_new("BindableEvent")
local PromptObj = {
OnSelect = PromptEvent.Event,
Active = true,
SelectedEvent = PromptEvent
}