-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcat.lua
3658 lines (3206 loc) · 192 KB
/
cat.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
-- insert troll face, memcorruptv2
local library = {
flags = { },
items = { }
}
-- Services
local players = game:GetService("Players")
local uis = game:GetService("UserInputService")
local runservice = game:GetService("RunService")
local tweenservice = game:GetService("TweenService")
local marketplaceservice = game:GetService("MarketplaceService")
local textservice = game:GetService("TextService")
local coregui = game:GetService("CoreGui")
local httpservice = game:GetService("HttpService")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local camera = game.Workspace.CurrentCamera
library.theme = {
fontsize = 15,
titlesize = 18,
font = Enum.Font.Code,
background = "rbxassetid://5553946656",
tilesize = 90,
cursor = true,
cursorimg = "https://t0.rbxcdn.com/42f66da98c40252ee151326a82aab51f",
backgroundcolor = Color3.fromRGB(20, 20, 20),
tabstextcolor = Color3.fromRGB(240, 240, 240),
bordercolor = Color3.fromRGB(60, 60, 60),
accentcolor = Color3.fromRGB(28, 56, 139),
accentcolor2 = Color3.fromRGB(16, 31, 78),
outlinecolor = Color3.fromRGB(60, 60, 60),
outlinecolor2 = Color3.fromRGB(0, 0, 0),
sectorcolor = Color3.fromRGB(30, 30, 30),
toptextcolor = Color3.fromRGB(255, 255, 255),
topheight = 48,
topcolor = Color3.fromRGB(30, 30, 30),
topcolor2 = Color3.fromRGB(30, 30, 30),
buttoncolor = Color3.fromRGB(49, 49, 49),
buttoncolor2 = Color3.fromRGB(39, 39, 39),
itemscolor = Color3.fromRGB(200, 200, 200),
itemscolor2 = Color3.fromRGB(210, 210, 210)
}
if library.theme.cursor and Drawing then
local success = pcall(function()
library.cursor = Drawing.new("Image")
library.cursor.Data = game:HttpGet(library.theme.cursorimg)
library.cursor.Size = Vector2.new(64, 64)
library.cursor.Visible = uis.MouseEnabled
library.cursor.Rounding = 0
library.cursor.Position = Vector2.new(mouse.X - 32, mouse.Y + 6)
end)
if success and library.cursor then
uis.InputChanged:Connect(function(input)
if uis.MouseEnabled then
if input.UserInputType == Enum.UserInputType.MouseMovement then
library.cursor.Position = Vector2.new(input.Position.X - 32, input.Position.Y + 7)
end
end
end)
game:GetService("RunService").RenderStepped:Connect(function()
uis.OverrideMouseIconBehavior = Enum.OverrideMouseIconBehavior.ForceHide
library.cursor.Visible = uis.MouseEnabled and (uis.MouseIconEnabled or game:GetService("GuiService").MenuIsOpen)
end)
elseif not success and library.cursor then
library.cursor:Remove()
end
end
function library:CreateWatermark(name, position)
local gamename = marketplaceservice:GetProductInfo(game.PlaceId).Name
local watermark = { }
watermark.Visible = true
watermark.text = " " .. name:gsub("{game}", gamename):gsub("{fps}", "0 FPS") .. " "
watermark.main = Instance.new("ScreenGui", coregui)
watermark.main.Name = "Watermark"
if syn then
syn.protect_gui(watermark.main)
end
if getgenv().watermark then
getgenv().watermark:Remove()
end
getgenv().watermark = watermark.main
watermark.mainbar = Instance.new("Frame", watermark.main)
watermark.mainbar.Name = "Main"
watermark.mainbar.BorderColor3 = Color3.fromRGB(80, 80, 80)
watermark.mainbar.Visible = watermark.Visible
watermark.mainbar.BorderSizePixel = 0
watermark.mainbar.ZIndex = 5
watermark.mainbar.Position = UDim2.new(0, position and position.X or 10, 0, position and position.Y or 10)
watermark.mainbar.Size = UDim2.new(0, 0, 0, 25)
watermark.Gradient = Instance.new("UIGradient", watermark.mainbar)
watermark.Gradient.Rotation = 90
watermark.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(40, 40, 40)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(10, 10, 10)) })
watermark.Outline = Instance.new("Frame", watermark.mainbar)
watermark.Outline.Name = "outline"
watermark.Outline.ZIndex = 4
watermark.Outline.BorderSizePixel = 0
watermark.Outline.Visible = watermark.Visible
watermark.Outline.BackgroundColor3 = library.theme.outlinecolor
watermark.Outline.Position = UDim2.fromOffset(-1, -1)
watermark.BlackOutline = Instance.new("Frame", watermark.mainbar)
watermark.BlackOutline.Name = "blackline"
watermark.BlackOutline.ZIndex = 3
watermark.BlackOutline.BorderSizePixel = 0
watermark.BlackOutline.BackgroundColor3 = library.theme.outlinecolor2
watermark.BlackOutline.Visible = watermark.Visible
watermark.BlackOutline.Position = UDim2.fromOffset(-2, -2)
watermark.label = Instance.new("TextLabel", watermark.mainbar)
watermark.label.Name = "FPSLabel"
watermark.label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
watermark.label.BackgroundTransparency = 1.000
watermark.label.Position = UDim2.new(0, 0, 0, 0)
watermark.label.Size = UDim2.new(0, 238, 0, 25)
watermark.label.Font = library.theme.font
watermark.label.ZIndex = 6
watermark.label.Visible = watermark.Visible
watermark.label.Text = watermark.text
watermark.label.TextColor3 = Color3.fromRGB(255, 255, 255)
watermark.label.TextSize = 15
watermark.label.TextStrokeTransparency = 0.000
watermark.label.TextXAlignment = Enum.TextXAlignment.Left
watermark.label.Size = UDim2.new(0, watermark.label.TextBounds.X+10, 0, 25)
watermark.topbar = Instance.new("Frame", watermark.mainbar)
watermark.topbar.Name = "TopBar"
watermark.topbar.ZIndex = 6
watermark.topbar.BackgroundColor3 = library.theme.accentcolor
watermark.topbar.BorderSizePixel = 0
watermark.topbar.Visible = watermark.Visible
watermark.topbar.Size = UDim2.new(0, 0, 0, 1)
watermark.mainbar.Size = UDim2.new(0, watermark.label.TextBounds.X, 0, 25)
watermark.topbar.Size = UDim2.new(0, watermark.label.TextBounds.X+6, 0, 1)
watermark.Outline.Size = watermark.mainbar.Size + UDim2.fromOffset(2, 2)
watermark.BlackOutline.Size = watermark.mainbar.Size + UDim2.fromOffset(4, 4)
watermark.mainbar.Size = UDim2.new(0, watermark.label.TextBounds.X+4, 0, 25)
watermark.label.Size = UDim2.new(0, watermark.label.TextBounds.X+4, 0, 25)
watermark.topbar.Size = UDim2.new(0, watermark.label.TextBounds.X+6, 0, 1)
watermark.Outline.Size = watermark.mainbar.Size + UDim2.fromOffset(2, 2)
watermark.BlackOutline.Size = watermark.mainbar.Size + UDim2.fromOffset(4, 4)
local startTime, counter, oldfps = os.clock(), 0, nil
runservice.Heartbeat:Connect(function()
watermark.label.Visible = watermark.Visible
watermark.mainbar.Visible = watermark.Visible
watermark.topbar.Visible = watermark.Visible
watermark.Outline.Visible = watermark.Visible
watermark.BlackOutline.Visible = watermark.Visible
if not name:find("{fps}") then
watermark.label.Text = " " .. name:gsub("{game}", gamename):gsub("{fps}", "0 FPS") .. " "
end
if name:find("{fps}") then
local currentTime = os.clock()
counter = counter + 1
if currentTime - startTime >= 1 then
local fps = math.floor(counter / (currentTime - startTime))
counter = 0
startTime = currentTime
if fps ~= oldfps then
watermark.label.Text = " " .. name:gsub("{game}", gamename):gsub("{fps}", fps .. " FPS") .. " "
watermark.label.Size = UDim2.new(0, watermark.label.TextBounds.X+10, 0, 25)
watermark.mainbar.Size = UDim2.new(0, watermark.label.TextBounds.X, 0, 25)
watermark.topbar.Size = UDim2.new(0, watermark.label.TextBounds.X, 0, 1)
watermark.Outline.Size = watermark.mainbar.Size + UDim2.fromOffset(2, 2)
watermark.BlackOutline.Size = watermark.mainbar.Size + UDim2.fromOffset(4, 4)
end
oldfps = fps
end
end
end)
watermark.mainbar.MouseEnter:Connect(function()
tweenservice:Create(watermark.mainbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play()
tweenservice:Create(watermark.topbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play()
tweenservice:Create(watermark.label, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { TextTransparency = 1, Active = false }):Play()
tweenservice:Create(watermark.Outline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play()
tweenservice:Create(watermark.BlackOutline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 1, Active = false }):Play()
end)
watermark.mainbar.MouseLeave:Connect(function()
tweenservice:Create(watermark.mainbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play()
tweenservice:Create(watermark.topbar, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play()
tweenservice:Create(watermark.label, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { TextTransparency = 0, Active = true }):Play()
tweenservice:Create(watermark.Outline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play()
tweenservice:Create(watermark.BlackOutline, TweenInfo.new(0.1, Enum.EasingStyle.Linear, Enum.EasingDirection.In), { BackgroundTransparency = 0, Active = true }):Play()
end)
function watermark:UpdateTheme(theme)
theme = theme or library.theme
watermark.Outline.BackgroundColor3 = theme.outlinecolor
watermark.BlackOutline.BackgroundColor3 = theme.outlinecolor2
watermark.label.Font = theme.font
watermark.topbar.BackgroundColor3 = theme.accentcolor
end
return watermark
end
function library:CreateWindow(name, size, hidebutton)
local window = { }
window.name = name or ""
window.size = UDim2.fromOffset(size.X, size.Y) or UDim2.fromOffset(492, 598)
window.hidebutton = hidebutton or Enum.KeyCode.RightShift
window.theme = library.theme
local updateevent = Instance.new("BindableEvent")
function window:UpdateTheme(theme)
updateevent:Fire(theme or library.theme)
window.theme = (theme or library.theme)
end
window.Main = Instance.new("ScreenGui", coregui)
window.Main.Name = name
window.Main.DisplayOrder = 15
if syn then
syn.protect_gui(window.Main)
end
if getgenv().uilib then
getgenv().uilib:Remove()
end
getgenv().uilib = window.Main
local dragging, dragInput, dragStart, startPos
uis.InputChanged:Connect(function(input)
if input == dragInput and dragging then
local delta = input.Position - dragStart
window.Frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)
local dragstart = function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = window.Frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end
local dragend = function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end
window.Frame = Instance.new("TextButton", window.Main)
window.Frame.Name = "main"
window.Frame.Position = UDim2.fromScale(0.5, 0.5)
window.Frame.BorderSizePixel = 0
window.Frame.Size = window.size
window.Frame.AutoButtonColor = false
window.Frame.Text = ""
window.Frame.BackgroundColor3 = window.theme.backgroundcolor
window.Frame.AnchorPoint = Vector2.new(0.5, 0.5)
updateevent.Event:Connect(function(theme)
window.Frame.BackgroundColor3 = theme.backgroundcolor
end)
uis.InputBegan:Connect(function(key)
if key.KeyCode == window.hidebutton then
window.Frame.Visible = not window.Frame.Visible
end
end)
local function checkIfGuiInFront(Pos)
local objects = coregui:GetGuiObjectsAtPosition(Pos.X, Pos.Y)
for i,v in pairs(objects) do
if not string.find(v:GetFullName(), window.name) then
table.remove(objects, i)
end
end
return (#objects ~= 0 and objects[1].AbsolutePosition ~= Pos)
end
window.BlackOutline = Instance.new("Frame", window.Frame)
window.BlackOutline.Name = "outline"
window.BlackOutline.ZIndex = 1
window.BlackOutline.Size = window.size + UDim2.fromOffset(2, 2)
window.BlackOutline.BorderSizePixel = 0
window.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2
window.BlackOutline.Position = UDim2.fromOffset(-1, -1)
updateevent.Event:Connect(function(theme)
window.BlackOutline.BackgroundColor3 = theme.outlinecolor2
end)
window.Outline = Instance.new("Frame", window.Frame)
window.Outline.Name = "outline"
window.Outline.ZIndex = 0
window.Outline.Size = window.size + UDim2.fromOffset(4, 4)
window.Outline.BorderSizePixel = 0
window.Outline.BackgroundColor3 = window.theme.outlinecolor
window.Outline.Position = UDim2.fromOffset(-2, -2)
updateevent.Event:Connect(function(theme)
window.Outline.BackgroundColor3 = theme.outlinecolor
end)
window.BlackOutline2 = Instance.new("Frame", window.Frame)
window.BlackOutline2.Name = "outline"
window.BlackOutline2.ZIndex = -1
window.BlackOutline2.Size = window.size + UDim2.fromOffset(6, 6)
window.BlackOutline2.BorderSizePixel = 0
window.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2
window.BlackOutline2.Position = UDim2.fromOffset(-3, -3)
updateevent.Event:Connect(function(theme)
window.BlackOutline2.BackgroundColor3 = theme.outlinecolor2
end)
window.TopBar = Instance.new("Frame", window.Frame)
window.TopBar.Name = "top"
window.TopBar.Size = UDim2.fromOffset(window.size.X.Offset, window.theme.topheight)
window.TopBar.BorderSizePixel = 0
window.TopBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
window.TopBar.InputBegan:Connect(dragstart)
window.TopBar.InputChanged:Connect(dragend)
updateevent.Event:Connect(function(theme)
window.TopBar.Size = UDim2.fromOffset(window.size.X.Offset, theme.topheight)
end)
window.TopGradient = Instance.new("UIGradient", window.TopBar)
window.TopGradient.Rotation = 90
window.TopGradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.topcolor), ColorSequenceKeypoint.new(1.00, window.theme.topcolor2) })
updateevent.Event:Connect(function(theme)
window.TopGradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.topcolor), ColorSequenceKeypoint.new(1.00, theme.topcolor2) })
end)
window.NameLabel = Instance.new("TextLabel", window.TopBar)
window.NameLabel.TextColor3 = window.theme.toptextcolor
window.NameLabel.Text = window.name
window.NameLabel.TextXAlignment = Enum.TextXAlignment.Left
window.NameLabel.Font = window.theme.font
window.NameLabel.Name = "title"
window.NameLabel.Position = UDim2.fromOffset(4, -2)
window.NameLabel.BackgroundTransparency = 1
window.NameLabel.Size = UDim2.fromOffset(190, window.TopBar.AbsoluteSize.Y / 2 - 2)
window.NameLabel.TextSize = window.theme.titlesize
updateevent.Event:Connect(function(theme)
window.NameLabel.TextColor3 = theme.toptextcolor
window.NameLabel.Font = theme.font
window.NameLabel.TextSize = theme.titlesize
end)
window.Line2 = Instance.new("Frame", window.TopBar)
window.Line2.Name = "line"
window.Line2.Position = UDim2.fromOffset(0, window.TopBar.AbsoluteSize.Y / 2.1)
window.Line2.Size = UDim2.fromOffset(window.size.X.Offset, 1)
window.Line2.BorderSizePixel = 0
window.Line2.BackgroundColor3 = window.theme.accentcolor
updateevent.Event:Connect(function(theme)
window.Line2.BackgroundColor3 = theme.accentcolor
end)
window.TabList = Instance.new("Frame", window.TopBar)
window.TabList.Name = "tablist"
window.TabList.BackgroundTransparency = 1
window.TabList.Position = UDim2.fromOffset(0, window.TopBar.AbsoluteSize.Y / 2 + 1)
window.TabList.Size = UDim2.fromOffset(window.size.X.Offset, window.TopBar.AbsoluteSize.Y / 2)
window.TabList.BorderSizePixel = 0
window.TabList.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
window.TabList.InputBegan:Connect(dragstart)
window.TabList.InputChanged:Connect(dragend)
window.BlackLine = Instance.new("Frame", window.Frame)
window.BlackLine.Name = "blackline"
window.BlackLine.Size = UDim2.fromOffset(window.size.X.Offset, 1)
window.BlackLine.BorderSizePixel = 0
window.BlackLine.ZIndex = 9
window.BlackLine.BackgroundColor3 = window.theme.outlinecolor2
window.BlackLine.Position = UDim2.fromOffset(0, window.TopBar.AbsoluteSize.Y)
updateevent.Event:Connect(function(theme)
window.BlackLine.BackgroundColor3 = theme.outlinecolor2
end)
window.BackgroundImage = Instance.new("ImageLabel", window.Frame)
window.BackgroundImage.Name = "background"
window.BackgroundImage.BorderSizePixel = 0
window.BackgroundImage.ScaleType = Enum.ScaleType.Tile
window.BackgroundImage.Position = window.BlackLine.Position + UDim2.fromOffset(0, 1)
window.BackgroundImage.Size = UDim2.fromOffset(window.size.X.Offset, window.size.Y.Offset - window.TopBar.AbsoluteSize.Y - 1)
window.BackgroundImage.Image = window.theme.background or ""
window.BackgroundImage.ImageTransparency = window.BackgroundImage.Image ~= "" and 0 or 1
window.BackgroundImage.ImageColor3 = Color3.new()
window.BackgroundImage.BackgroundColor3 = window.theme.backgroundcolor
window.BackgroundImage.TileSize = UDim2.new(0, window.theme.tilesize, 0, window.theme.tilesize)
updateevent.Event:Connect(function(theme)
window.BackgroundImage.Image = theme.background or ""
window.BackgroundImage.ImageTransparency = window.BackgroundImage.Image ~= "" and 0 or 1
window.BackgroundImage.BackgroundColor3 = theme.backgroundcolor
window.BackgroundImage.TileSize = UDim2.new(0, theme.tilesize, 0, theme.tilesize)
end)
window.Line = Instance.new("Frame", window.Frame)
window.Line.Name = "line"
window.Line.Position = UDim2.fromOffset(0, 0)
window.Line.Size = UDim2.fromOffset(60, 1)
window.Line.BorderSizePixel = 0
window.Line.BackgroundColor3 = window.theme.accentcolor
updateevent.Event:Connect(function(theme)
window.Line.BackgroundColor3 = theme.accentcolor
end)
window.ListLayout = Instance.new("UIListLayout", window.TabList)
window.ListLayout.FillDirection = Enum.FillDirection.Horizontal
window.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
window.OpenedColorPickers = { }
window.Tabs = { }
function window:CreateTab(name)
local tab = { }
tab.name = name or ""
local textservice = game:GetService("TextService")
local size = textservice:GetTextSize(tab.name, window.theme.fontsize, window.theme.font, Vector2.new(200,300))
tab.TabButton = Instance.new("TextButton", window.TabList)
tab.TabButton.TextColor3 = window.theme.tabstextcolor
tab.TabButton.Text = tab.name
tab.TabButton.AutoButtonColor = false
tab.TabButton.Font = window.theme.font
tab.TabButton.TextYAlignment = Enum.TextYAlignment.Center
tab.TabButton.BackgroundTransparency = 1
tab.TabButton.BorderSizePixel = 0
tab.TabButton.Size = UDim2.fromOffset(size.X + 15, window.TabList.AbsoluteSize.Y - 1)
tab.TabButton.Name = tab.name
tab.TabButton.TextSize = window.theme.fontsize
updateevent.Event:Connect(function(theme)
local size = textservice:GetTextSize(tab.name, theme.fontsize, theme.font, Vector2.new(200,300))
tab.TabButton.TextColor3 = tab.TabButton.Name == "SelectedTab" and theme.accentcolor or theme.tabstextcolor
tab.TabButton.Font = theme.font
tab.TabButton.Size = UDim2.fromOffset(size.X + 15, window.TabList.AbsoluteSize.Y - 1)
tab.TabButton.TextSize = theme.fontsize
end)
tab.Left = Instance.new("ScrollingFrame", window.Frame)
tab.Left.Name = "leftside"
tab.Left.BorderSizePixel = 0
tab.Left.Size = UDim2.fromOffset(window.size.X.Offset / 2, window.size.Y.Offset - (window.TopBar.AbsoluteSize.Y + 1))
tab.Left.BackgroundTransparency = 1
tab.Left.Visible = false
tab.Left.ScrollBarThickness = 0
tab.Left.ScrollingDirection = "Y"
tab.Left.Position = window.BlackLine.Position + UDim2.fromOffset(0, 1)
tab.LeftListLayout = Instance.new("UIListLayout", tab.Left)
tab.LeftListLayout.FillDirection = Enum.FillDirection.Vertical
tab.LeftListLayout.SortOrder = Enum.SortOrder.LayoutOrder
tab.LeftListLayout.Padding = UDim.new(0, 12)
tab.LeftListPadding = Instance.new("UIPadding", tab.Left)
tab.LeftListPadding.PaddingTop = UDim.new(0, 12)
tab.LeftListPadding.PaddingLeft = UDim.new(0, 12)
tab.LeftListPadding.PaddingRight = UDim.new(0, 12)
tab.Right = Instance.new("ScrollingFrame", window.Frame)
tab.Right.Name = "rightside"
tab.Right.ScrollBarThickness = 0
tab.Right.ScrollingDirection = "Y"
tab.Right.Visible = false
tab.Right.BorderSizePixel = 0
tab.Right.Size = UDim2.fromOffset(window.size.X.Offset / 2, window.size.Y.Offset - (window.TopBar.AbsoluteSize.Y + 1))
tab.Right.BackgroundTransparency = 1
tab.Right.Position = tab.Left.Position + UDim2.fromOffset(tab.Left.AbsoluteSize.X, 0)
tab.RightListLayout = Instance.new("UIListLayout", tab.Right)
tab.RightListLayout.FillDirection = Enum.FillDirection.Vertical
tab.RightListLayout.SortOrder = Enum.SortOrder.LayoutOrder
tab.RightListLayout.Padding = UDim.new(0, 12)
tab.RightListPadding = Instance.new("UIPadding", tab.Right)
tab.RightListPadding.PaddingTop = UDim.new(0, 12)
tab.RightListPadding.PaddingLeft = UDim.new(0, 6)
tab.RightListPadding.PaddingRight = UDim.new(0, 12)
local block = false
function tab:SelectTab()
repeat
wait()
until block == false
block = true
for i,v in pairs(window.Tabs) do
if v ~= tab then
v.TabButton.TextColor3 = Color3.fromRGB(230, 230, 230)
v.TabButton.Name = "Tab"
v.Left.Visible = false
v.Right.Visible = false
end
end
tab.TabButton.TextColor3 = window.theme.accentcolor
tab.TabButton.Name = "SelectedTab"
tab.Right.Visible = true
tab.Left.Visible = true
window.Line:TweenSizeAndPosition(UDim2.fromOffset(size.X + 15, 1), UDim2.new(0, (tab.TabButton.AbsolutePosition.X - window.Frame.AbsolutePosition.X), 0, 0) + (window.BlackLine.Position - UDim2.fromOffset(0, 1)), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.15)
wait(0.2)
block = false
end
if #window.Tabs == 0 then
tab:SelectTab()
end
tab.TabButton.MouseButton1Down:Connect(function()
tab:SelectTab()
end)
tab.SectorsLeft = { }
tab.SectorsRight = { }
function tab:CreateSector(name,side)
local sector = { }
sector.name = name or ""
sector.side = side:lower() or "left"
sector.Main = Instance.new("Frame", sector.side == "left" and tab.Left or tab.Right)
sector.Main.Name = sector.name:gsub(" ", "") .. "Sector"
sector.Main.BorderSizePixel = 0
sector.Main.ZIndex = 4
sector.Main.Size = UDim2.fromOffset(window.size.X.Offset / 2 - 17, 20)
sector.Main.BackgroundColor3 = window.theme.sectorcolor
--sector.Main.Position = sector.side == "left" and UDim2.new(0, 11, 0, 12) or UDim2.new(0, window.size.X.Offset - sector.Main.AbsoluteSize.X - 11, 0, 12)
updateevent.Event:Connect(function(theme)
sector.Main.BackgroundColor3 = theme.sectorcolor
end)
sector.Line = Instance.new("Frame", sector.Main)
sector.Line.Name = "line"
sector.Line.ZIndex = 4
sector.Line.Size = UDim2.fromOffset(sector.Main.Size.X.Offset + 4, 1)
sector.Line.BorderSizePixel = 0
sector.Line.Position = UDim2.fromOffset(-2, -2)
sector.Line.BackgroundColor3 = window.theme.accentcolor
updateevent.Event:Connect(function(theme)
sector.Line.BackgroundColor3 = theme.accentcolor
end)
sector.BlackOutline = Instance.new("Frame", sector.Main)
sector.BlackOutline.Name = "outline"
sector.BlackOutline.ZIndex = 3
sector.BlackOutline.Size = sector.Main.Size + UDim2.fromOffset(2, 2)
sector.BlackOutline.BorderSizePixel = 0
sector.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2
sector.BlackOutline.Position = UDim2.fromOffset(-1, -1)
sector.Main:GetPropertyChangedSignal("Size"):Connect(function()
sector.BlackOutline.Size = sector.Main.Size + UDim2.fromOffset(2, 2)
end)
updateevent.Event:Connect(function(theme)
sector.BlackOutline.BackgroundColor3 = theme.outlinecolor2
end)
sector.Outline = Instance.new("Frame", sector.Main)
sector.Outline.Name = "outline"
sector.Outline.ZIndex = 2
sector.Outline.Size = sector.Main.Size + UDim2.fromOffset(4, 4)
sector.Outline.BorderSizePixel = 0
sector.Outline.BackgroundColor3 = window.theme.outlinecolor
sector.Outline.Position = UDim2.fromOffset(-2, -2)
sector.Main:GetPropertyChangedSignal("Size"):Connect(function()
sector.Outline.Size = sector.Main.Size + UDim2.fromOffset(4, 4)
end)
updateevent.Event:Connect(function(theme)
sector.Outline.BackgroundColor3 = theme.outlinecolor
end)
sector.BlackOutline2 = Instance.new("Frame", sector.Main)
sector.BlackOutline2.Name = "outline"
sector.BlackOutline2.ZIndex = 1
sector.BlackOutline2.Size = sector.Main.Size + UDim2.fromOffset(6, 6)
sector.BlackOutline2.BorderSizePixel = 0
sector.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2
sector.BlackOutline2.Position = UDim2.fromOffset(-3, -3)
sector.Main:GetPropertyChangedSignal("Size"):Connect(function()
sector.BlackOutline2.Size = sector.Main.Size + UDim2.fromOffset(6, 6)
end)
updateevent.Event:Connect(function(theme)
sector.BlackOutline2.BackgroundColor3 = theme.outlinecolor2
end)
local size = textservice:GetTextSize(sector.name, 15, window.theme.font, Vector2.new(2000, 2000))
sector.Label = Instance.new("TextLabel", sector.Main)
sector.Label.AnchorPoint = Vector2.new(0,0.5)
sector.Label.Position = UDim2.fromOffset(12, -1)
sector.Label.Size = UDim2.fromOffset(math.clamp(textservice:GetTextSize(sector.name, 15, window.theme.font, Vector2.new(200,300)).X + 13, 0, sector.Main.Size.X.Offset), size.Y)
sector.Label.BackgroundTransparency = 1
sector.Label.BorderSizePixel = 0
sector.Label.ZIndex = 6
sector.Label.Text = sector.name
sector.Label.TextColor3 = Color3.new(1,1,2552/255)
sector.Label.TextStrokeTransparency = 1
sector.Label.Font = window.theme.font
sector.Label.TextSize = 15
updateevent.Event:Connect(function(theme)
local size = textservice:GetTextSize(sector.name, 15, theme.font, Vector2.new(2000, 2000))
sector.Label.Size = UDim2.fromOffset(math.clamp(textservice:GetTextSize(sector.name, 15, theme.font, Vector2.new(200,300)).X + 13, 0, sector.Main.Size.X.Offset), size.Y)
sector.Label.Font = theme.font
end)
sector.LabelBackFrame = Instance.new("Frame", sector.Main)
sector.LabelBackFrame.Name = "labelframe"
sector.LabelBackFrame.ZIndex = 5
sector.LabelBackFrame.Size = UDim2.fromOffset(sector.Label.Size.X.Offset, 10)
sector.LabelBackFrame.BorderSizePixel = 0
sector.LabelBackFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
sector.LabelBackFrame.Position = UDim2.fromOffset(sector.Label.Position.X.Offset, sector.BlackOutline2.Position.Y.Offset)
sector.Items = Instance.new("Frame", sector.Main)
sector.Items.Name = "items"
sector.Items.ZIndex = 2
sector.Items.BackgroundTransparency = 1
sector.Items.Size = UDim2.fromOffset(170, 140)
sector.Items.AutomaticSize = Enum.AutomaticSize.Y
sector.Items.BorderSizePixel = 0
sector.ListLayout = Instance.new("UIListLayout", sector.Items)
sector.ListLayout.FillDirection = Enum.FillDirection.Vertical
sector.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
sector.ListLayout.Padding = UDim.new(0, 12)
sector.ListPadding = Instance.new("UIPadding", sector.Items)
sector.ListPadding.PaddingTop = UDim.new(0, 15)
sector.ListPadding.PaddingLeft = UDim.new(0, 6)
sector.ListPadding.PaddingRight = UDim.new(0, 6)
table.insert(sector.side:lower() == "left" and tab.SectorsLeft or tab.SectorsRight, sector)
function sector:FixSize()
sector.Main.Size = UDim2.fromOffset(window.size.X.Offset / 2 - 17, sector.ListLayout.AbsoluteContentSize.Y + 22)
local sizeleft, sizeright = 0, 0
for i,v in pairs(tab.SectorsLeft) do
sizeleft = sizeleft + v.Main.AbsoluteSize.Y
end
for i,v in pairs(tab.SectorsRight) do
sizeright = sizeright + v.Main.AbsoluteSize.Y
end
tab.Left.CanvasSize = UDim2.fromOffset(tab.Left.AbsoluteSize.X, sizeleft + ((#tab.SectorsLeft - 1) * tab.LeftListPadding.PaddingTop.Offset) + 20)
tab.Right.CanvasSize = UDim2.fromOffset(tab.Right.AbsoluteSize.X, sizeright + ((#tab.SectorsRight - 1) * tab.RightListPadding.PaddingTop.Offset) + 20)
end
function sector:AddButton(text, callback)
local button = { }
button.text = text or ""
button.callback = callback or function() end
button.Main = Instance.new("TextButton", sector.Items)
button.Main.BorderSizePixel = 0
button.Main.Text = ""
button.Main.AutoButtonColor = false
button.Main.Name = "button"
button.Main.ZIndex = 5
button.Main.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 12, 14)
button.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
button.Gradient = Instance.new("UIGradient", button.Main)
button.Gradient.Rotation = 90
button.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.buttoncolor), ColorSequenceKeypoint.new(1.00, window.theme.buttoncolor2) })
updateevent.Event:Connect(function(theme)
button.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.buttoncolor), ColorSequenceKeypoint.new(1.00, theme.buttoncolor2) })
end)
button.BlackOutline2 = Instance.new("Frame", button.Main)
button.BlackOutline2.Name = "blackline"
button.BlackOutline2.ZIndex = 4
button.BlackOutline2.Size = button.Main.Size + UDim2.fromOffset(6, 6)
button.BlackOutline2.BorderSizePixel = 0
button.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2
button.BlackOutline2.Position = UDim2.fromOffset(-3, -3)
updateevent.Event:Connect(function(theme)
button.BlackOutline2.BackgroundColor3 = theme.outlinecolor2
end)
button.Outline = Instance.new("Frame", button.Main)
button.Outline.Name = "blackline"
button.Outline.ZIndex = 4
button.Outline.Size = button.Main.Size + UDim2.fromOffset(4, 4)
button.Outline.BorderSizePixel = 0
button.Outline.BackgroundColor3 = window.theme.outlinecolor
button.Outline.Position = UDim2.fromOffset(-2, -2)
updateevent.Event:Connect(function(theme)
button.Outline.BackgroundColor3 = theme.outlinecolor
end)
button.BlackOutline = Instance.new("Frame", button.Main)
button.BlackOutline.Name = "blackline"
button.BlackOutline.ZIndex = 4
button.BlackOutline.Size = button.Main.Size + UDim2.fromOffset(2, 2)
button.BlackOutline.BorderSizePixel = 0
button.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2
button.BlackOutline.Position = UDim2.fromOffset(-1, -1)
updateevent.Event:Connect(function(theme)
button.BlackOutline.BackgroundColor3 = theme.outlinecolor2
end)
button.Label = Instance.new("TextLabel", button.Main)
button.Label.Name = "Label"
button.Label.BackgroundTransparency = 1
button.Label.Position = UDim2.new(0, -1, 0, 0)
button.Label.ZIndex = 5
button.Label.Size = button.Main.Size
button.Label.Font = window.theme.font
button.Label.Text = button.text
button.Label.TextColor3 = window.theme.itemscolor2
button.Label.TextSize = 15
button.Label.TextStrokeTransparency = 1
button.Label.TextXAlignment = Enum.TextXAlignment.Center
button.Main.MouseButton1Down:Connect(button.callback)
updateevent.Event:Connect(function(theme)
button.Label.Font = theme.font
button.Label.TextColor3 = theme.itemscolor
end)
button.BlackOutline2.MouseEnter:Connect(function()
button.BlackOutline2.BackgroundColor3 = window.theme.accentcolor
end)
button.BlackOutline2.MouseLeave:Connect(function()
button.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2
end)
sector:FixSize()
return button
end
function sector:AddLabel(text)
local label = { }
label.Main = Instance.new("TextLabel", sector.Items)
label.Main.Name = "Label"
label.Main.BackgroundTransparency = 1
label.Main.Position = UDim2.new(0, -1, 0, 0)
label.Main.ZIndex = 4
label.Main.AutomaticSize = Enum.AutomaticSize.XY
label.Main.Font = window.theme.font
label.Main.Text = text
label.Main.TextColor3 = window.theme.itemscolor
label.Main.TextSize = 15
label.Main.TextStrokeTransparency = 1
label.Main.TextXAlignment = Enum.TextXAlignment.Left
updateevent.Event:Connect(function(theme)
label.Main.Font = theme.font
label.Main.TextColor3 = theme.itemscolor
end)
function label:Set(value)
label.Main.Text = value
end
sector:FixSize()
return label
end
function sector:AddToggle(text, default, callback, flag)
local toggle = { }
toggle.text = text or ""
toggle.default = default or false
toggle.callback = callback or function(value) end
toggle.flag = flag or text or ""
toggle.value = toggle.default
toggle.Main = Instance.new("TextButton", sector.Items)
toggle.Main.Name = "toggle"
toggle.Main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
toggle.Main.BorderColor3 = window.theme.outlinecolor
toggle.Main.BorderSizePixel = 0
toggle.Main.Size = UDim2.fromOffset(8, 8)
toggle.Main.AutoButtonColor = false
toggle.Main.ZIndex = 5
toggle.Main.Font = Enum.Font.SourceSans
toggle.Main.Text = ""
toggle.Main.TextColor3 = Color3.fromRGB(0, 0, 0)
toggle.Main.TextSize = 15
updateevent.Event:Connect(function(theme)
toggle.Main.BorderColor3 = theme.outlinecolor
end)
toggle.BlackOutline2 = Instance.new("Frame", toggle.Main)
toggle.BlackOutline2.Name = "blackline"
toggle.BlackOutline2.ZIndex = 4
toggle.BlackOutline2.Size = toggle.Main.Size + UDim2.fromOffset(6, 6)
toggle.BlackOutline2.BorderSizePixel = 0
toggle.BlackOutline2.BackgroundColor3 = window.theme.outlinecolor2
toggle.BlackOutline2.Position = UDim2.fromOffset(-3, -3)
updateevent.Event:Connect(function(theme)
toggle.BlackOutline2.BackgroundColor3 = theme.outlinecolor2
end)
toggle.Outline = Instance.new("Frame", toggle.Main)
toggle.Outline.Name = "blackline"
toggle.Outline.ZIndex = 4
toggle.Outline.Size = toggle.Main.Size + UDim2.fromOffset(4, 4)
toggle.Outline.BorderSizePixel = 0
toggle.Outline.BackgroundColor3 = window.theme.outlinecolor
toggle.Outline.Position = UDim2.fromOffset(-2, -2)
updateevent.Event:Connect(function(theme)
toggle.Outline.BackgroundColor3 = theme.outlinecolor
end)
toggle.BlackOutline = Instance.new("Frame", toggle.Main)
toggle.BlackOutline.Name = "blackline"
toggle.BlackOutline.ZIndex = 4
toggle.BlackOutline.Size = toggle.Main.Size + UDim2.fromOffset(2, 2)
toggle.BlackOutline.BorderSizePixel = 0
toggle.BlackOutline.BackgroundColor3 = window.theme.outlinecolor2
toggle.BlackOutline.Position = UDim2.fromOffset(-1, -1)
updateevent.Event:Connect(function(theme)
toggle.BlackOutline.BackgroundColor3 = theme.outlinecolor2
end)
toggle.Gradient = Instance.new("UIGradient", toggle.Main)
toggle.Gradient.Rotation = (22.5 * 13)
toggle.Gradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, Color3.fromRGB(30, 30, 30)), ColorSequenceKeypoint.new(1.00, Color3.fromRGB(45, 45, 45)) })
toggle.Label = Instance.new("TextButton", toggle.Main)
toggle.Label.Name = "Label"
toggle.Label.AutoButtonColor = false
toggle.Label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
toggle.Label.BackgroundTransparency = 1
toggle.Label.Position = UDim2.fromOffset(toggle.Main.AbsoluteSize.X + 10, -2)
toggle.Label.Size = UDim2.fromOffset(sector.Main.Size.X.Offset - 71, toggle.BlackOutline.Size.Y.Offset)
toggle.Label.Font = window.theme.font
toggle.Label.ZIndex = 5
toggle.Label.Text = toggle.text
toggle.Label.TextColor3 = window.theme.itemscolor
toggle.Label.TextSize = 15
toggle.Label.TextStrokeTransparency = 1
toggle.Label.TextXAlignment = Enum.TextXAlignment.Left
updateevent.Event:Connect(function(theme)
toggle.Label.Font = theme.font
toggle.Label.TextColor3 = toggle.value and window.theme.itemscolor2 or theme.itemscolor
end)
toggle.CheckedFrame = Instance.new("Frame", toggle.Main)
toggle.CheckedFrame.ZIndex = 5
toggle.CheckedFrame.BorderSizePixel = 0
toggle.CheckedFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- Color3.fromRGB(204, 0, 102)
toggle.CheckedFrame.Size = toggle.Main.Size
toggle.Gradient2 = Instance.new("UIGradient", toggle.CheckedFrame)
toggle.Gradient2.Rotation = (22.5 * 13)
toggle.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, window.theme.accentcolor2), ColorSequenceKeypoint.new(1.00, window.theme.accentcolor) })
updateevent.Event:Connect(function(theme)
toggle.Gradient2.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.00, theme.accentcolor2), ColorSequenceKeypoint.new(1.00, theme.accentcolor) })
end)
toggle.Items = Instance.new("Frame", toggle.Main)
toggle.Items.Name = "\n"
toggle.Items.ZIndex = 4
toggle.Items.Size = UDim2.fromOffset(60, toggle.BlackOutline.AbsoluteSize.Y)
toggle.Items.BorderSizePixel = 0
toggle.Items.BackgroundTransparency = 1
toggle.Items.BackgroundColor3 = Color3.new(0, 0, 0)
toggle.Items.Position = UDim2.fromOffset(sector.Main.Size.X.Offset - 71, 0)
toggle.ListLayout = Instance.new("UIListLayout", toggle.Items)
toggle.ListLayout.FillDirection = Enum.FillDirection.Horizontal
toggle.ListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Right
toggle.ListLayout.SortOrder = Enum.SortOrder.LayoutOrder
toggle.ListLayout.Padding = UDim.new(0.04, 6)
if toggle.flag and toggle.flag ~= "" then
library.flags[toggle.flag] = toggle.default or false
end
function toggle:Set(value)
if value then
toggle.Label.TextColor3 = window.theme.itemscolor2
else
toggle.Label.TextColor3 = window.theme.itemscolor
end
toggle.value = value
toggle.CheckedFrame.Visible = value
if toggle.flag and toggle.flag ~= "" then
library.flags[toggle.flag] = toggle.value
end
pcall(toggle.callback, value)
end
function toggle:Get()
return toggle.value
end
toggle:Set(toggle.default)
function toggle:AddKeybind(default, flag)
local keybind = { }
keybind.default = default or "None"
keybind.value = keybind.default
keybind.flag = flag or ( (toggle.text or "") .. tostring(#toggle.Items:GetChildren()))
local shorter_keycodes = {
["LeftShift"] = "LSHIFT",
["RightShift"] = "RSHIFT",
["LeftControl"] = "LCTRL",
["RightControl"] = "RCTRL",
["LeftAlt"] = "LALT",
["RightAlt"] = "RALT"
}
local text = keybind.default == "None" and "[None]" or "[" .. (shorter_keycodes[keybind.default.Name] or keybind.default.Name) .. "]"
local size = textservice:GetTextSize(text, 15, window.theme.font, Vector2.new(2000, 2000))
keybind.Main = Instance.new("TextButton", toggle.Items)
keybind.Main.Name = "keybind"
keybind.Main.BackgroundTransparency = 1
keybind.Main.BorderSizePixel = 0
keybind.Main.ZIndex = 5
keybind.Main.Size = UDim2.fromOffset(size.X + 2, size.Y - 7)
keybind.Main.Text = text
keybind.Main.Font = window.theme.font
keybind.Main.TextColor3 = Color3.fromRGB(136, 136, 136)
keybind.Main.TextSize = 15
keybind.Main.TextXAlignment = Enum.TextXAlignment.Right
keybind.Main.MouseButton1Down:Connect(function()
keybind.Main.Text = "[...]"
keybind.Main.TextColor3 = window.theme.accentcolor
end)
updateevent.Event:Connect(function(theme)
keybind.Main.Font = theme.font
if keybind.Main.Text == "[...]" then
keybind.Main.TextColor3 = theme.accentcolor
else
keybind.Main.TextColor3 = Color3.fromRGB(136, 136, 136)
end
end)
if keybind.flag and keybind.flag ~= "" then
library.flags[keybind.flag] = keybind.default
end
function keybind:Set(key)
if key == "None" then
keybind.Main.Text = "[" .. key .. "]"
keybind.value = key
if keybind.flag and keybind.flag ~= "" then
library.flags[keybind.flag] = key
end
end
keybind.Main.Text = "[" .. (shorter_keycodes[key.Name] or key.Name) .. "]"
keybind.value = key
if keybind.flag and keybind.flag ~= "" then
library.flags[keybind.flag] = keybind.value
end
end
function keybind:Get()
return keybind.value
end
uis.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed then
if keybind.Main.Text == "[...]" then
keybind.Main.TextColor3 = Color3.fromRGB(136, 136, 136)
if input.UserInputType == Enum.UserInputType.Keyboard then
keybind:Set(input.KeyCode)
else
keybind:Set("None")
end
else
if keybind.value ~= "None" and input.KeyCode == keybind.value then
toggle:Set(not toggle.CheckedFrame.Visible)
end
end
end
end)
table.insert(library.items, keybind)
return keybind
end
function toggle:AddDropdown(items, default, multichoice, callback, flag)
local dropdown = { }
dropdown.defaultitems = items or { }