forked from bloodball/UI-Librarys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gerad lib
1877 lines (1781 loc) · 68.4 KB
/
gerad lib
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 = {flags = {}, ActiveSlider = nil, Count = 0, windows = {}, callbacks = {}, binds = {}, open = true}
---=== Globals ===---
local RunService = game:GetService("RunService")
local Heartbeat = game:GetService("RunService").Heartbeat
local RenderStepped = game:GetService('RunService').RenderStepped
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local UserInputService = game:GetService("UserInputService")
function Tween(Object, Goal, Direction, Style, Time, WaitForTween)
Style = Style or {}
local Tween = game:GetService("TweenService"):Create(Object,TweenInfo.new( Time, Style, Direction ), Goal)
Tween:Play()
if WaitForTween then
Tween.Completed:wait()
end
end
local GlobalRainbowColor;
local GlobalHueColor;
spawn(function()
while true do
for i = 0, 1, 1 / 300 do
GlobalRainbowColor = Color3.fromHSV(i, 1, 1);
GlobalHueColor = i
wait()
end
end
end)
function library:Create(class, properties)
local inst = Instance.new(class)
for property, value in next, properties do
inst[property] = value
end
return inst
end
function ScreenGUIName(length) -- 29 length is ideal
local str = ""
for i = 1, length do
if i%6 == 0 then
str = str .. '-'
else
str = str .. string.char(math.random(65,90))
end
end
return str
end
---=== Main Part ===----
local ScreenGUI = library:Create('ScreenGui', {Name = ScreenGUIName(29); Parent = game.CoreGui})
function library:CreateWindow(Name)
self.Toggled = true
library.Count = library.Count + 1
local TopBar = library:Create("ImageLabel", {
Name = "Top Bar";
Parent = ScreenGUI;
BackgroundColor3 = Color3.fromRGB(114, 137, 218);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(114, 137, 218);
BorderSizePixel = 0;
Position = UDim2.new((library.Count * 0.0155038759) , (( library.Count - 1 )* 208), 0.0246913582, 0);
Size = UDim2.new(0, 208, 0, 35);
ZIndex = 2;
Image = "http://www.roblox.com/asset/?id=4846149319";
ImageColor3 = Color3.fromRGB(0, 0, 0);
Active = true;
Draggable = true;
});
local WindowName = library:Create("TextLabel",{
Name = "Window Name";
Parent = TopBar;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(27, 42, 53);
Position = UDim2.new(0.0500000007, 0, 0.0282485969, 0);
Size = UDim2.new(0.829987586, 0, 1, 0);
ZIndex = 3;
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 20.000;
TextWrapped = true;
TextXAlignment = Enum.TextXAlignment.Left;
});
local WindowToggle = library:Create("TextButton",{
Name = "Window Toggle";
Parent = TopBar;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Position = UDim2.new(0.847619057, 0, 0.142857149, 0);
Size = UDim2.new(0, 25, 0, 25);
ZIndex = 4;
Font = Enum.Font.GothamSemibold;
Text = "-";
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 30.000;
});
local WindowToggleBackground = library:Create("ImageLabel",{
Name = "Window Toggle Background";
Parent = WindowToggle;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.5, 0, 0.5, 0);
Selectable = true;
Size = UDim2.new(1, 0, 1, 0);
ZIndex = 3;
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(31, 30, 31);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.060;
});
local Container = library:Create("Frame",{
Name = "Container";
Parent = TopBar;
BackgroundColor3 = Color3.fromRGB(116, 166, 253);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(114, 137, 218);
BorderSizePixel = 0;
ClipsDescendants = true;
Position = UDim2.new(0, 0, 0.861375749, 0);
Size = UDim2.new(0, 208, 0, 350);
});
local ContainerUIListLayout = library:Create("UIListLayout",{
Name = "Container UI List Layout";
Parent = Container;
SortOrder = Enum.SortOrder.LayoutOrder;
});
-- Dragger skidded from Jan <3
local dragging, dragInput, dragStart, startPos, dragObject
local function update(input)
if not startPos then return end
local delta = input.Position - dragStart
local yPos = (startPos.Y.Offset + delta.Y) < -36 and -36 or startPos.Y.Offset + delta.Y
dragObject:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, yPos), "Out", "Quint", 0.1, true)
end
TopBar.InputBegan:connect(function(input)
if input.UserInputType.Name == "MouseButton1" then
dragObject = TopBar
dragging = true
dragStart = input.Position
startPos = dragObject.Position
end
end)
TopBar.InputChanged:connect(function(input)
if dragging and input.UserInputType.Name == "MouseMovement" then
dragInput = input
end
end)
TopBar.InputEnded:connect(function(input)
if input.UserInputType.Name == "MouseButton1" then
dragging = false
end
end)
UserInputService.InputChanged:connect(function(input)
if input.UserInputType.Name == "MouseMovement" then
if input == dragInput and dragging then
update(input)
end
end
end)
WindowToggle.MouseButton1Click:Connect(function()
self.Toggled = not self.Toggled
if self.Toggled then
Tween(Container, {Size = UDim2.new(0, 208, 0, ContainerUIListLayout.AbsoluteContentSize.Y)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.2, true)
WindowToggle.Text = "-"
else
Tween(Container, {Size = UDim2.new(0, 208, 0, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.2, true)
WindowToggle.Text = "+"
end
end)
local Sections = {}
function Sections:Section(Name)
self.Toggled = false
local Section = {}
table.insert(self, Section)
local SectionPart = library:Create("Frame",{
Name = "SectionPart";
Parent = Container;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
ClipsDescendants = true;
Size = UDim2.new(1, 0, 0, 35);
});
local SectionContainer = library:Create("Frame",{
Name = "Section Container";
Parent = SectionPart;
BackgroundColor3 = Color3.fromRGB(19, 19, 19);
BorderSizePixel = 0;
ClipsDescendants = true;
Position = UDim2.new(0, 0, 0, 30);
Size = UDim2.new(0, 208, 0, 0);
});
local SectionUIListLayout = library:Create("UIListLayout",{
Name = "Section UIListLayout";
Parent = SectionContainer;
SortOrder = Enum.SortOrder.LayoutOrder;
});
local SectionButton = library:Create("ImageButton",{
Name = "Section Button";
Parent = SectionPart;
BackgroundColor3 = Color3.fromRGB(114, 137, 218);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(114, 137, 218);
Size = UDim2.new(1, 0, 0, 35);
Image = "http://www.roblox.com/asset/?id=4846243410";
ImageColor3 = Color3.fromRGB(30, 30, 30);
});
local SectionTEXT = library:Create("TextLabel",{
Name = "Section TEXT";
Parent = SectionButton;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(0, 0, 0);
BorderSizePixel = 0;
Position = UDim2.new(0.0500000007, 0, -0.0571428575, 0);
Size = UDim2.new(0, 189, 1, 0);
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 48, 51);
TextSize = 18.000;
TextXAlignment = Enum.TextXAlignment.Left;
});
library:Create("UIPadding",{
Parent = SectionContainer;
PaddingBottom = UDim.new(0, 5);
PaddingTop = UDim.new(0, 6);
});
SectionButton.MouseButton1Click:Connect(function()
self.Toggled = not self.Toggled
if self.Toggled then
Tween(SectionContainer, {Size = UDim2.new(0, 208, 0, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.15, false)
Tween(SectionPart, {Size = UDim2.new(0, 208, 0, 35)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.15, false)
Tween(SectionTEXT, {TextColor3 = Color3.fromRGB(255, 48, 51),}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.15, false)
else
Tween(SectionContainer, {Size = UDim2.new(0, 208, 0, SectionUIListLayout.AbsoluteContentSize.Y + 10 )}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.15, false)
Tween(SectionPart, {Size = UDim2.new(0, 208, 0, SectionUIListLayout.AbsoluteContentSize.Y + 35 )}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.15, false)
Tween(SectionTEXT, {TextColor3 = Color3.fromRGB(145, 255, 71),}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.15, true)
Tween(Container, {Size = UDim2.new(0, 208, 0, ContainerUIListLayout.AbsoluteContentSize.Y)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.1, true)
end
end)
function Section:Label(Name)
local LabelFrame = Instance.new("Frame")
local TextLabel = Instance.new("TextLabel")
LabelFrame.Name = "Label Frame"
LabelFrame.Parent = SectionContainer
LabelFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
LabelFrame.BackgroundTransparency = 0.75
LabelFrame.BorderSizePixel = 0;
LabelFrame.Size = UDim2.new(1, 0, 0, 20)
TextLabel.Parent = LabelFrame
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.BackgroundTransparency = 1.000
TextLabel.Position = UDim2.new(0.0689999983, 0, 0, -3)
TextLabel.Size = UDim2.new(0.882000029, 0, 0, 25)
TextLabel.Font = Enum.Font.GothamSemibold
TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.TextSize = 15.000
TextLabel.TextXAlignment = Enum.TextXAlignment.Left
TextLabel.Text = Name
TextLabel.BorderSizePixel = 0;
end
function Section:Button(Name, Function)
local ButtonFrame = library:Create("Frame", {
Name = "Button Frame";
Parent = SectionContainer;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Size = UDim2.new(1, 0, 0, 35);
});
local Button = library:Create("TextButton", {
Name = "Button";
Parent = ButtonFrame;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Size = UDim2.new(1, 0, 0, 35);
ZIndex = 3;
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
});
local ButtonBackground = library:Create("ImageLabel", {
Name = "Button Background";
Parent = Button;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.499760836, 0, 0.485714287, 0);
Selectable = true;
Size = UDim2.new(0.90861249, 0, 0.879999995, 0);
ZIndex = 2;
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.075;
});
--Script part
Button.MouseButton1Click:connect(Function)
end
function Section:Toggle(Name, Options, callback)
if not library.flags then
library.flags = {}
end
local Toggle = library:Create("Frame",{
Name = "Toggle";
Parent = SectionContainer;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(27, 42, 53);
Position = UDim2.new(0, 0, 0.103244841, 0);
Size = UDim2.new(1, 0, 0, 35);
});
local ToggleTextBackground = library:Create("ImageLabel",{
Name = "Toggle Text Background";
Parent = Toggle;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.339941978, 0, 0.485714287, 0);
Selectable = true;
Size = UDim2.new(0.588999987, 0, 0.75, 0);
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.075;
});
local ToggleText = library:Create("TextLabel",{
Name = "Toggle Text";
Parent = ToggleTextBackground;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.0568663031, 0, -0.0324675329, 0);
Size = UDim2.new(0.959999979, 0, 1, 0);
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
TextScaled = (string.len(tostring(Name)) > 10 and true) or false;
TextXAlignment = Enum.TextXAlignment.Left;
});
local ToggleButtonOutline = library:Create("ImageButton",{
Name = "Toggle Button Outline";
Parent = Toggle;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.668269217, 0, 0.0285714287, 0);
Size = UDim2.new(0.177000001, 25, 0.75, 0);
Image = "http://www.roblox.com/asset/?id=4875185102";
ImageColor3 = Color3.fromRGB(28, 28, 28);
});
local ToggleInsideColor = library:Create("ImageLabel",{
Name = "Toggle Inside Color";
Parent = ToggleButtonOutline;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0, 0, 0.190476194, 0);
Size = UDim2.new(0.949999988, 0, 0.876999974, 0);
Image = "http://www.roblox.com/asset/?id=4875187236";
});
local ColorGradient = library:Create("UIGradient",{
Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 48, 51)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(0, 225, 100))};
Offset = Vector2.new(1, 0);
Parent = ToggleInsideColor;
});
local CirclePart = library:Create("ImageLabel",{
Name = "Circle Part";
Parent = ToggleInsideColor;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(255, 255, 255);
Position = UDim2.new(0.0170000009, 0, 0.0399999991, 0);
Size = UDim2.new(0, 22, 0, 22);
});
local CircleText = library:Create("TextLabel",{
Name = "Circle Text";
Parent = CirclePart;
Active = true;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Size = UDim2.new(1, 0, 1, 0);
SizeConstraint = Enum.SizeConstraint.RelativeYY;
ZIndex = 2;
Font = Enum.Font.GothamSemibold;
Text = "X";
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 20.000;
});
local check = library:Create("ImageLabel",{
Name = "check";
Parent = CirclePart;
Active = true;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Position = UDim2.new(0.5, -9, 0.5, -9);
Size = UDim2.new(0.75, 0, 0.75, 0);
Image = "http://www.roblox.com/asset/?id=4555411759";
ImageColor3 = Color3.fromRGB(0, 0, 0);
ImageTransparency = 1.000;
});
local location = Options.location or library.flags;
local flagName = Options.flag or "";
location[flagName] = Options.Default or flase
ToggleButtonOutline.MouseButton1Click:Connect(function()
if callback then callback(not location[flagName]) end
if location[flagName] then
Tween(CirclePart, {Position = UDim2.new(0.017, 0, 0.05, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.1, false)
Tween(ColorGradient, {Offset = Vector2.new(1, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.1, true)
CircleText.TextTransparency = 0
check.ImageTransparency = 1
location[flagName] = false;
else
Tween(CirclePart, {Position = UDim2.new(0.6, 0, 0.05, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.1, false)
Tween(ColorGradient, {Offset = Vector2.new(-1, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.1, true)
CircleText.TextTransparency = 1
check.ImageTransparency = 0
location[flagName] = true;
end
end)
end
function Section:Box(Name, Options, callback)
if not library.flags then
library.flags = {}
end
local Box = library:Create("Frame",{
Name = "Box";
Parent = SectionContainer;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0, 0, 0.103244841, 0);
Size = UDim2.new(1, 0, 0, 35);
});
local BoxTextBackground = library:Create("ImageLabel",{
Name = "Box Text Background";
Parent = Box;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.339950055, 0, 0.485714287, 0);
Selectable = true;
Size = UDim2.new(0.588999987, 0, 0.75, 0);
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.075;
});
local BoxText = library:Create("TextLabel",{
Name = "Box Text";
Parent = BoxTextBackground;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.0399726853, 0, 0, 0);
Size = UDim2.new(0.959999979, 0, 1, 0);
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
TextXAlignment = Enum.TextXAlignment.Left;
});
local BoxValue = library:Create("TextBox",{
Name = "Box Value";
Parent = Box;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Position = UDim2.new(0.669767678, 0, 0.0857142881, 0);
Size = UDim2.new(0.177000001, 25, 0.75, 0);
ZIndex = 2;
Font = Enum.Font.GothamSemibold;
PlaceholderText = Options.Default;
Text = Options.Default or "No value";
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
});
local BoxValueBackground = library:Create("ImageLabel",{
Name = "Box Value Background";
Parent = BoxValue;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.501089334, 0, 0.454545468, 0);
Selectable = true;
Size = UDim2.new(1, 0, 1, 0);
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.100;
});
local Type = Options.Type or "number"
local location = Options.location or library.flags;
local flagName = Options.flag or "";
location[flagName] = Options.Default or ( Options.Type == 'string' and "") or 0
BoxValue.FocusLost:Connect(function()
if Type == "string" then
location[flagName] = tostring(BoxValue.Text)
else
local Number = tonumber(BoxValue.Text)
if Number == nil or Number == "" then
Number = Options.Default
BoxValue.Text = Options.Default
else
if Options.Min ~= nil and Number < Options.Min then
Number = Options.Min
BoxValue.Text = Options.Min
end
if Options.Max ~= nil and Number > Options.Max then
Number = Options.Max
BoxValue.Text = Options.Max
end
end
location[flagName] = Number
end
if callback then callback() end
end)
end
function Section:Bind(Name, Options, callback)
local Keybind = library:Create("Frame",{
Name = "Keybind ";
Parent = SectionContainer;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0, 0, 0.103244841, 0);
Size = UDim2.new(1, 0, 0, 35);
});
local KeybindTextBackground = library:Create("ImageLabel",{
Name = "Keybind Text Background";
Parent = Keybind;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.339950055, 0, 0.485714287, 0);
Selectable = true;
Size = UDim2.new(0.588999987, 0, 0.75, 0);
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.075;
});
local KeybindText = library:Create("TextLabel",{
Name = "Keybind Text";
Parent = KeybindTextBackground;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.042825792, 0, -0.0324675329, 0);
Size = UDim2.new(0.959999979, 0, 1, 0);
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
TextXAlignment = Enum.TextXAlignment.Left;
});
local KeybindButton = library:Create("TextButton",{
Name = "Keybind Button";
Parent = Keybind;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.669444978, 0, 0.0859998465, 0);
Size = UDim2.new(0.177000001, 25, 0.75, 0);
ZIndex = 2;
Font = Enum.Font.GothamSemibold;
Text = "None";
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
});
local KeybindBackground = library:Create("ImageLabel",{
Name = "Keybind Background";
Parent = KeybindButton;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.501089334, 0, 0.454545468, 0);
Selectable = true;
Size = UDim2.new(1, 0, 1, 0);
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.100;
});
local banned = {
Return = true;
Space = true;
Tab = true;
Unknown = true;
}
local shortNames = {
RightControl = 'RightCtrl';
LeftControl = 'LeftCtrl';
LeftShift = 'LShift';
RightShift = 'RShift';
MouseButton1 = "Mouse1";
MouseButton2 = "Mouse2";
MouseButton3 = "Mouse3";
}
local allowed = {
MouseButton1 = true;
MouseButton2 = true;
MouseButton3 = true;
MouseButton4 = true;
}
local location = Options.location or library.flags;
local flagName = Options.flag or "";
location[flagName] = Options.Default or Enum.UserInputType.None
local callback = callback or function() end;
KeybindButton.MouseButton1Click:Connect(function()
library.binding = true
KeybindButton.Text = '...'
local a, b = game:GetService('UserInputService').InputBegan:wait()
local name = tostring(a.KeyCode.Name)
local typeName = tostring(a.UserInputType.Name)
if a.KeyCode == Enum.KeyCode.Delete then
location[flagName] = Enum.UserInputType.None
KeybindButton.Text = 'None'
elseif (a.UserInputType ~= Enum.UserInputType.Keyboard and (allowed[a.UserInputType.Name]) and (not keyboardOnly)) or (a.KeyCode and (not banned[a.KeyCode.Name])) then
local name = a.UserInputType ~= Enum.UserInputType.Keyboard and a.UserInputType.Name or a.KeyCode.Name;
location[flagName] = (a);
KeybindButton.Text = shortNames[name] or name;
else
if location[flagName] then
if not pcall(function()
return location[flagName].UserInputType
end) then
local name = tostring(location[flagName])
KeybindButton.Text = shortNames[name] or name
else
local name = location[flagName].UserInputType ~= Enum.UserInputType.Keyboard and location[flagName].UserInputType.Name or location[flagName].KeyCode.Name;
KeybindButton.Text = shortNames[name] or name;
end
end
end
wait(0.1)
library.binding = false;
end)
library.binds[flagName] = {
location = location;
callback = callback;
};
end
function Section:Slider(Name, Options, callback)
local Slider = library:Create("Frame",{
Name = "Slider";
Parent = SectionContainer;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0, 0, 0.412979364, 0);
Size = UDim2.new(1, 0, 0, 60);
});
local BackgroundFrame = library:Create("ImageLabel",{
Name = "Background Frame";
Parent = Slider;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.0480000265, 0, 0.0500000007, 0);
Size = UDim2.new(0.916999996, 0, 0.833333313, 0);
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.125;
});
local SliderName = library:Create("TextLabel",{
Name = "SliderName";
Parent = BackgroundFrame;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.0230727084, 0, 0, 0);
Size = UDim2.new(0.616797447, 0, 0.5, 0);
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
TextXAlignment = Enum.TextXAlignment.Left;
});
local slider = library:Create("TextButton",{
Name = "slider";
Parent = BackgroundFrame;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Size = UDim2.new(1, 0, 1, 0);
Font = Enum.Font.GothamSemibold;
Text = "";
TextColor3 = Color3.fromRGB(0, 0, 0);
TextSize = 14.000;
});
local line = library:Create("Frame",{
Name = "line";
Parent = slider;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BorderSizePixel = 0;
Position = UDim2.new(0.0727822408, 0, 0.639999986, 0);
Size = UDim2.new(0, 160, 0, 2);
});
local UIGradient = library:Create("UIGradient",{
Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 255, 0)), ColorSequenceKeypoint.new(0.50, Color3.fromRGB(0, 255, 255)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(255, 0, 255))};
Parent = line;
});
local fill = library:Create("ImageLabel",{
Name = "fill";
Parent = line;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Size = UDim2.new(0, 0, 1, 0);
ZIndex = 3;
Image = "rbxassetid://4550094458";
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(4, 4, 296, 296);
});
local Frame = library:Create("ImageLabel",{
Name = "Frame";
Parent = line;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Position = UDim2.new(0, 0, -4, 0);
Size = UDim2.new(0, 3, 8, 0);
ZIndex = 4;
Image = "rbxassetid://4550094458";
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(4, 4, 296, 296);
});
local SliderValue = library:Create("TextBox",{
Name = "SliderValue";
Parent = BackgroundFrame;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0.689999998, 0, 0.100000001, 0);
Size = UDim2.new(0.319999993, 0, 0.300000012, 0);
Font = Enum.Font.GothamSemibold;
PlaceholderColor3 = Color3.fromRGB(131, 131, 131);
PlaceholderText = "_____";
Text = Options.Default or "nil";
TextColor3 = Color3.fromRGB(255, 255, 255);
TextScaled = true;
TextSize = 15.000;
TextWrapped = true;
});
local location = Options.location or library.flags;
local flagName = Options.flag or "";
location[flagName] = Options.Default or 0
Options.Min = Options.Min or 0
Options.Max = Options.Max or 100
Options.Default = Options.Default or 0
Options.Precise = Options.Precise or false
local min = ( Options.Min < 0 and -Options.Min ) or Options.Min
local max = ( Options.Max < 0 and -Options.Max ) or Options.Max
local diff = max + min
function SetSliderValue(number)
if (not number) then return end
local percent = 1 - ((Options.Max - number) / (Options.Max - Options.Min ))
SliderValue.Text = math.floor(number * 100)/100;
Tween(fill, {Size = UDim2.new(percent, 0, 1, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.025, false)
Tween(Frame, {Position = UDim2.new(percent, 0, 0, -7)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.025, true)
location[flagName] = math.floor(number * 100)/100
if callback then callback(location[flagName]) end
end
SliderValue.FocusLost:Connect(function(e)
if e and tonumber(SliderValue.Text) then
local num = tonumber(SliderValue.Text)
SetSliderValue(math.clamp(num, Options.Min, Options.Max))
else
input.Text = location[flagName]
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
held = false
ActiveSlider = nil
end
end)
slider.MouseButton1Down:connect(function()
if ActiveSlider == nil then
ActiveSlider = flagName
held = true
end
end)
Heartbeat:connect(function()
if held and ActiveSlider == flagName then
local mouse = game:GetService("UserInputService"):GetMouseLocation()
local percent = (mouse.X - slider.AbsolutePosition.X) / (slider.AbsoluteSize.X)
percent = math.clamp(percent, 0, 1)
local Value = Options.Min + (Options.Max - Options.Min) * percent;
if not Options.Precise then
Value = math.floor(Value);
end;
Tween(fill, {Size = UDim2.new(percent, 0, 1, 0)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.025, false)
Tween(Frame, {Position = UDim2.new(percent, 0, 0, -7)}, Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, 0.025, true)
SliderValue.Text = math.floor(Value * 100)/100
location[flagName] = math.floor(Value * 100)/100
if callback then callback(location[flagName]) end
end
end)
end
function Section:Dropdown(Name, Options, callback)
local Dropdown = library:Create("Frame",{
Name = "Dropdown";
BorderSizePixel = 0;
Parent = SectionContainer;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
Position = UDim2.new(0, 0, 0.293107003, 0);
Size = UDim2.new(1, 0, 0, 40);
});
local DropdownButton = library:Create("TextButton",{ -- DROPDOWN TOGGLE
Name = "Dropdown Button";
Parent = Dropdown;
BackgroundColor3 = Color3.fromRGB(80, 80, 80);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
ClipsDescendants = true;
Size = UDim2.new(1, 0, 0, 40);
ZIndex = 3;
Font = Enum.Font.GothamSemibold;
LineHeight = 2.000;
Text = "";
TextColor3 = Color3.fromRGB(0, 0, 0);
TextSize = 14.000;
TextXAlignment = Enum.TextXAlignment.Left;
});
local DropdownBackground = library:Create("ImageLabel",{
Name = "Dropdown Background";
Parent = DropdownButton;
Active = true;
AnchorPoint = Vector2.new(0.5, 0.5);
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Position = UDim2.new(0.502301931, 0, 0.454545468, 0);
Selectable = true;
Size = UDim2.new(0.905082345, 0, 0.909090936, 0);
ZIndex = 3;
Image = "rbxassetid://3570695787";
ImageColor3 = Color3.fromRGB(28, 28, 28);
ScaleType = Enum.ScaleType.Slice;
SliceCenter = Rect.new(100, 100, 100, 100);
SliceScale = 0.080;
});
local DropdownName = library:Create("TextLabel",{
Name = "Dropdown Name";
Parent = DropdownButton;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderSizePixel = 0;
Position = UDim2.new(0.0765550211, 0, 0, 0);
Size = UDim2.new(0.842105329, 0, 0, 25);
ZIndex = 3;
Font = Enum.Font.GothamSemibold;
Text = Name;
TextColor3 = Color3.fromRGB(255, 255, 255);
TextSize = 15.000;
TextXAlignment = Enum.TextXAlignment.Left;
});
local ArrowImage = library:Create("ImageLabel",{
Name = "Arrow Image";
Parent = DropdownButton;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BackgroundTransparency = 1.000;
BorderColor3 = Color3.fromRGB(27, 42, 53);
BorderSizePixel = 0;
Position = UDim2.new(0.789473712, 0, 0.0606060624, 0);
Size = UDim2.new(0, 25, 0, 25);
ZIndex = 3;
Image = "http://www.roblox.com/asset/?id=4877238073";
});
local DropLine = library:Create("Frame",{
Name = "Drop Line";
Parent = DropdownButton;
BackgroundColor3 = Color3.fromRGB(255, 255, 255);
BorderColor3 = Color3.fromRGB(255, 255, 255);
BorderSizePixel = 0;
Position = UDim2.new(0.0789406002, 0, 0.75757575, 0);
Size = UDim2.new(0, 175, 0, 1);
ZIndex = 3;
});
local DropMenu = library:Create("ScrollingFrame",{
Name = "Drop Menu";
Parent = Dropdown;
Active = true;
BackgroundColor3 = Color3.fromRGB(28, 28, 28);
BorderColor3 = Color3.fromRGB(255, 255, 255);
BorderSizePixel = 0;
Position = UDim2.new(0.0480000004, 0, 0, 31);
Size = UDim2.new(0, 189, 0, 0);
SizeConstraint = Enum.SizeConstraint.RelativeYY;
ZIndex = 2;
BottomImage = "";
CanvasSize = UDim2.new(0, 160, 0, 250);
MidImage = "http://www.roblox.com/asset/?id=4878091618";
ScrollBarThickness = 0;
TopImage = "";
VerticalScrollBarInset = Enum.ScrollBarInset.Always;
});
local DropListLayout = library:Create("UIListLayout",{
Name = "Drop List Layout";
Parent = DropMenu;
HorizontalAlignment = Enum.HorizontalAlignment.Center;
SortOrder = Enum.SortOrder.LayoutOrder;
Padding = UDim.new(0, 2);
});
library:Create("UIPadding",{
Name = "Drop Padding";
Parent = DropMenu;
PaddingLeft = UDim.new(0, 5);
PaddingRight = UDim.new(0, 5);
PaddingTop = UDim.new(0, 5);
});
function GetLengthOfDirectory(AAA)
local length = 0
for i,v in pairs(AAA) do
length = length + 1
end
return length
end
local location = Options.location or library.flags;
local flagName = Options.flag or "";
local Dropdown_Type = Options.Type or 'Normal'
location[flagName] = (Options.Default) or (Dropdown_Type == 'Toggle' and {}) or ("")
local Dropdown_List = Options.list or {}
local Dropdown_List_Type = ( #Dropdown_List ~= 0 and "Table" ) or "Directory"
local CurrentState = false
local NewSize = 0
local tweeeeeeeeeeeeening = false
local function ToggleDropdown(state)
if not tweeeeeeeeeeeeening then
CurrentState = state or not CurrentState
if CurrentState then
tweeeeeeeeeeeeening = true
local ListLength =( Dropdown_List_Type == 'Table' and #Dropdown_List ) or ( GetLengthOfDirectory(Dropdown_List) )
NewSize = ( ListLength > 3 and 113 ) or (32 * #Dropdown_List + 27)