forked from meobeo8/Library
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSolixUI.lua
More file actions
6862 lines (5691 loc) · 195 KB
/
Copy pathSolixUI.lua
File metadata and controls
6862 lines (5691 loc) · 195 KB
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
if getgenv().Library then
getgenv().Library:Unload()
end
if not isfolder("eclipse") then
makefolder("eclipse")
end
if not isfolder("eclipse/Assets") then
makefolder("eclipse/Assets")
end
if not isfolder("eclipse/Configs") then
makefolder("eclipse/Configs")
end
if not isfolder("eclipse/Themes") then
makefolder("eclipse/Themes")
end
local Library do
local Workspace = game:GetService("Workspace")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
local CoreGui = cloneref and cloneref(game:GetService("CoreGui")) or game:GetService("CoreGui")
local TweenService = game:GetService("TweenService")
local Stats = game:GetService("Stats")
gethui = gethui or function()
return CoreGui
end
local LocalPlayer = Players.LocalPlayer
local Camera = Workspace.CurrentCamera
local Mouse = LocalPlayer:GetMouse()
local FromRGB = Color3.fromRGB
local FromHSV = Color3.fromHSV
local FromHex = Color3.fromHex
local RGBSequence = ColorSequence.new
local RGBSequenceKeypoint = ColorSequenceKeypoint.new
local NumSequence = NumberSequence.new
local NumSequenceKeypoint = NumberSequenceKeypoint.new
local UDim2New = UDim2.new
local UDimNew = UDim.new
local Vector2New = Vector2.new
local MathClamp = math.clamp
local MathFloor = math.floor
local MathAbs = math.abs
local MathSin = math.sin
local TableInsert = table.insert
local TableFind = table.find
local TableRemove = table.remove
local TableConcat = table.concat
local TableClone = table.clone
local TableUnpack = table.unpack
local StringFormat = string.format
local StringFind = string.find
local StringGSub = string.gsub
local StringLower = string.lower
local InstanceNew = Instance.new
local MathMax = math.max
local MathRad = math.rad
local Vector3New = Vector3.new
local CFrameNew = CFrame.new
local CFrameAngles = CFrame.Angles
local RectNew = Rect.new
local IsMobile = false
if UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled and not UserInputService.MouseEnabled then
IsMobile = true
elseif not UserInputService.TouchEnabled and UserInputService.KeyboardEnabled and UserInputService.MouseEnabled then
IsMobile = false
elseif UserInputService.TouchEnabled and UserInputService.KeyboardEnabled and UserInputService.MouseEnabled then
IsMobile = false
end
Library = {
Theme = { },
Themes = { },
MenuKeybind = tostring(Enum.KeyCode.RightControl),
Flags = { },
Tween = {
Time = 0.25,
Style = Enum.EasingStyle.Quart,
Direction = Enum.EasingDirection.Out
},
Folders = {
Directory = "eclipse",
Configs = "eclipse/Configs",
Assets = "eclipse/Assets",
Themes = "eclipse/Themes"
},
Images = {
["Saturation"] = {"Saturation.png", "https://github.com/sametexe001/images/blob/main/saturation.png?raw=true" },
["Value"] = { "Value.png", "https://github.com/sametexe001/images/blob/main/value.png?raw=true" },
["Hue"] = { "Hue.png", "https://github.com/sametexe001/images/blob/main/horizontalhue.png?raw=true" },
["Checkers"] = { "Checkers.png", "https://github.com/sametexe001/images/blob/main/checkers.png?raw=true" },
},
-- Ignore below
Pages = { },
Sections = { },
Connections = { },
Threads = { },
ThemeMap = { },
ThemeItems = { },
OpenFrames = { },
CurrentPage = nil,
SearchItems = { },
ThemeColorpickers = { },
SetFlags = { },
UnnamedConnections = 0,
UnnamedFlags = 0,
Holder = nil,
NotifHolder = nil,
UnusedHolder = nil,
Font = nil,
KeyList = nil
}
Library.__index = Library
Library.Sections.__index = Library.Sections
Library.Pages.__index = Library.Pages
local Keys = {
["Unknown"] = "Unknown",
["Backspace"] = "Back",
["Tab"] = "Tab",
["Clear"] = "Clear",
["Return"] = "Return",
["Pause"] = "Pause",
["Escape"] = "Escape",
["Space"] = "Space",
["QuotedDouble"] = '"',
["Hash"] = "#",
["Dollar"] = "$",
["Percent"] = "%",
["Ampersand"] = "&",
["Quote"] = "'",
["LeftParenthesis"] = "(",
["RightParenthesis"] = " )",
["Asterisk"] = "*",
["Plus"] = "+",
["Comma"] = ",",
["Minus"] = "-",
["Period"] = ".",
["Slash"] = "`",
["Three"] = "3",
["Seven"] = "7",
["Eight"] = "8",
["Colon"] = ":",
["Semicolon"] = ";",
["LessThan"] = "<",
["GreaterThan"] = ">",
["Question"] = "?",
["Equals"] = "=",
["At"] = "@",
["LeftBracket"] = "LeftBracket",
["RightBracket"] = "RightBracked",
["BackSlash"] = "BackSlash",
["Caret"] = "^",
["Underscore"] = "_",
["Backquote"] = "`",
["LeftCurly"] = "{",
["Pipe"] = "|",
["RightCurly"] = "}",
["Tilde"] = "~",
["Delete"] = "Delete",
["End"] = "End",
["KeypadZero"] = "Keypad0",
["KeypadOne"] = "Keypad1",
["KeypadTwo"] = "Keypad2",
["KeypadThree"] = "Keypad3",
["KeypadFour"] = "Keypad4",
["KeypadFive"] = "Keypad5",
["KeypadSix"] = "Keypad6",
["KeypadSeven"] = "Keypad7",
["KeypadEight"] = "Keypad8",
["KeypadNine"] = "Keypad9",
["KeypadPeriod"] = "KeypadP",
["KeypadDivide"] = "KeypadD",
["KeypadMultiply"] = "KeypadM",
["KeypadMinus"] = "KeypadM",
["KeypadPlus"] = "KeypadP",
["KeypadEnter"] = "KeypadE",
["KeypadEquals"] = "KeypadE",
["Insert"] = "Insert",
["Home"] = "Home",
["PageUp"] = "PageUp",
["PageDown"] = "PageDown",
["RightShift"] = "RightShift",
["LeftShift"] = "LeftShift",
["RightControl"] = "RightControl",
["LeftControl"] = "LeftControl",
["LeftAlt"] = "LeftAlt",
["RightAlt"] = "RightAlt"
}
local Themes = { -- edit this to change the theme
["Default"] = {
["Background"] = FromRGB(15, 12, 16),
["Inline"] = FromRGB(22, 20, 24),
["Border"] = FromRGB(41, 37, 45),
["Shadow"] = FromRGB(0, 0, 0),
["Text"] = FromRGB(255, 255, 255),
["Inactive Text"] = FromRGB(185, 185, 185),
["Accent"] = FromRGB(232, 186, 248),
["Element"] = FromRGB(36, 32, 39),
["Gradient"] = FromRGB(216, 216, 216)
},
["Halloween"] = {
["Background"] = FromRGB(48, 24, 7),
["Inline"] = FromRGB(34, 14, 8),
["Border"] = FromRGB(79, 40, 16),
["Shadow"] = FromRGB(255, 98, 0),
["Text"] = FromRGB(195, 195, 195),
["Inactive Text"] = FromRGB(116, 116, 116),
["Accent"] = FromRGB(255, 98, 0),
["Element"] = FromRGB(68, 28, 0),
["Gradient"] = FromRGB(150, 150, 150)
},
["Aqua"] = {
["Background"] = FromRGB(19, 21, 23),
["Inline"] = FromRGB(31, 35, 39),
["Border"] = FromRGB(48, 56, 63),
["Shadow"] = FromRGB(0, 0, 0),
["Text"] = FromRGB(245, 245, 245),
["Inactive Text"] = FromRGB(185, 185, 185),
["Accent"] = FromRGB(31, 106, 181),
["Element"] = FromRGB(58, 66, 77),
["Gradient"] = FromRGB(211, 211, 211)
},
["Onetap"] = {
["Background"] = FromRGB(51, 51, 51),
["Inline"] = FromRGB(30, 30, 30),
["Border"] = FromRGB(0, 0, 0),
["Shadow"] = FromRGB(0, 0, 0),
["Text"] = FromRGB(255, 255, 255),
["Inactive Text"] = FromRGB(185, 185, 185),
["Accent"] = FromRGB(237, 170, 0),
["Element"] = FromRGB(45, 45, 45),
["Gradient"] = FromRGB(211, 211, 211)
},
["Bitchbot"] = {
["Background"] = FromRGB(33, 33, 33),
["Inline"] = FromRGB(14, 14, 14),
["Border"] = FromRGB(0, 0, 0),
["Shadow"] = FromRGB(0, 0, 0),
["Text"] = FromRGB(255, 255, 255),
["Inactive Text"] = FromRGB(185, 185, 185),
["Accent"] = FromRGB(158, 79, 249),
["Element"] = FromRGB(22, 20, 20),
["Gradient"] = FromRGB(211, 211, 211)
},
["Gamesense"] = {
["Background"] = FromRGB(22, 22, 22),
["Inline"] = FromRGB(17, 17, 17),
["Border"] = FromRGB(37, 37, 37),
["Shadow"] = FromRGB(34, 34, 34),
["Text"] = FromRGB(255, 255, 255),
["Inactive Text"] = FromRGB(185, 185, 185),
["Accent"] = FromRGB(211, 255, 53),
["Element"] = FromRGB(53, 53, 53),
["Gradient"] = FromRGB(156, 156, 156)
}
}
Library.Theme = TableClone(Themes["Default"])
Library.Themes = Themes
-- Folders
for Index, Value in Library.Folders do
if not isfolder(Value) then
makefolder(Value)
end
end
if not isfile(Library.Folders.Directory .. "/autoload.json") then
writefile(Library.Folders.Directory .. "/autoload.json", "")
end
-- Images
for Index, Value in Library.Images do
local ImageData = Value
local ImageName = ImageData[1]
local ImageLink = ImageData[2]
if not isfile(Library.Folders.Assets .. "/" .. ImageName) then
writefile(Library.Folders.Assets .. "/" .. ImageName, game:HttpGet(ImageLink))
end
end
-- Tweening
local Tween = { } do
Tween.__index = Tween
Tween.Create = function(self, Item, Info, Goal, IsRawItem)
Item = IsRawItem and Item or Item.Instance
Info = Info or TweenInfo.new(Library.Tween.Time, Library.Tween.Style, Library.Tween.Direction)
local NewTween = {
Tween = TweenService:Create(Item, Info, Goal),
Info = Info,
Goal = Goal,
Item = Item
}
NewTween.Tween:Play()
setmetatable(NewTween, Tween)
return NewTween
end
Tween.GetProperty = function(self, Item)
Item = Item or self.Item
if Item:IsA("Frame") then
return { "BackgroundTransparency" }
elseif Item:IsA("TextLabel") or Item:IsA("TextButton") then
return { "TextTransparency", "BackgroundTransparency" }
elseif Item:IsA("ImageLabel") or Item:IsA("ImageButton") then
return { "BackgroundTransparency", "ImageTransparency" }
elseif Item:IsA("ScrollingFrame") then
return { "BackgroundTransparency", "ScrollBarImageTransparency" }
elseif Item:IsA("TextBox") then
return { "TextTransparency", "BackgroundTransparency" }
elseif Item:IsA("UIStroke") then
return { "Transparency" }
end
end
Tween.FadeItem = function(self, Item, Property, Visibility, Speed)
local Item = Item or self.Item
local OldTransparency = Item[Property]
Item[Property] = Visibility and 1 or OldTransparency
local NewTween = Tween:Create(Item, TweenInfo.new(Speed or Library.Tween.Time, Library.Tween.Style, Library.Tween.Direction), {
[Property] = Visibility and OldTransparency or 1
}, true)
Library:Connect(NewTween.Tween.Completed, function()
if not Visibility then
task.wait()
Item[Property] = OldTransparency
end
end)
return NewTween
end
Tween.Get = function(self)
if not self.Tween then
return
end
return self.Tween, self.Info, self.Goal
end
Tween.Pause = function(self)
if not self.Tween then
return
end
self.Tween:Pause()
end
Tween.Play = function(self)
if not self.Tween then
return
end
self.Tween:Play()
end
Tween.Clean = function(self)
if not self.Tween then
return
end
Tween:Pause()
self = nil
end
end
-- Instances
local Instances = { } do
Instances.__index = Instances
Instances.Create = function(self, Class, Properties)
local NewItem = {
Instance = InstanceNew(Class),
Properties = Properties,
Class = Class
}
setmetatable(NewItem, Instances)
for Property, Value in NewItem.Properties do
NewItem.Instance[Property] = Value
end
return NewItem
end
Instances.Border = function(self)
if not self.Instance then
return
end
local Item = self.Instance
local UIStroke = Instances:Create("UIStroke", {
Parent = Item,
Color = Library.Theme.Border,
Thickness = 1,
LineJoinMode = Enum.LineJoinMode.Miter
})
UIStroke:AddToTheme({Color = "Border"})
return UIStroke
end
Instances.Tooltip = function(self, Text)
if not self.Instance then
return
end
if Text == nil then
return
end
local Gui = self.Instance
local MouseLocation = UserInputService:GetMouseLocation()
local RenderStepped
local Items = { } do
Items["Tooltip"] = Instances:Create("Frame", {
Parent = Library.Holder.Instance,
Name = "\0",
BackgroundColor3 = FromRGB(15, 12, 16),
BorderSizePixel = 0,
Position = UDim2New(0, MouseLocation.X, 0, MouseLocation.Y - 22),
Size = UDim2New(0, 0, 0, 0),
BackgroundTransparency = 1,
Visible = true,
AutomaticSize = Enum.AutomaticSize.XY,
ZIndex = 99
}) Items["Tooltip"]:AddToTheme({BackgroundColor3 = "Background"})
Items["Text"] = Instances:Create("TextLabel", {
Parent = Items["Tooltip"].Instance,
Name = "\0",
FontFace = Library.Font,
TextColor3 = FromRGB(255, 255, 255),
BorderColor3 = FromRGB(0, 0, 0),
Text = Text,
BorderSizePixel = 0,
BackgroundTransparency = 1,
Size = UDim2New(1, 0, 1, 0),
ClipsDescendants = true,
ZIndex = 99,
TextTransparency = 1,
AutomaticSize = Enum.AutomaticSize.XY,
TextXAlignment = Enum.TextXAlignment.Left,
TextSize = 14,
BackgroundColor3 = FromRGB(15, 12, 16)
}) Items["Text"]:AddToTheme({TextColor3 = "Text"})
Instances:Create("UIPadding", {
Parent = Items["Text"].Instance,
Name = "\0",
PaddingBottom = UDimNew(0, 8),
PaddingLeft = UDimNew(0, 8),
PaddingRight = UDimNew(0, 8),
PaddingTop = UDimNew(0, 8),
})
Instances:Create("UICorner", {
Parent = Items["Tooltip"].Instance,
Name = "\0",
CornerRadius = UDimNew(0, 5)
})
end
Library:Connect(Gui.MouseEnter, function()
Items["Tooltip"].Instance.Position = UDim2New(0, MouseLocation.X, 0, MouseLocation.Y - 42)
Items["Tooltip"]:Tween(nil, {BackgroundTransparency = 0})
Items["Text"]:Tween(nil, {TextTransparency = 0})
RenderStepped = RunService.RenderStepped:Connect(function()
MouseLocation = UserInputService:GetMouseLocation()
Items["Tooltip"]:Tween(nil, {Position = UDim2New(0, MouseLocation.X, 0, MouseLocation.Y - 42)})
end)
end)
Library:Connect(Gui.MouseLeave, function()
Items["Tooltip"]:Tween(nil, {BackgroundTransparency = 1})
Items["Text"]:Tween(nil, {TextTransparency = 1})
if RenderStepped then
RenderStepped:Disconnect()
RenderStepped = nil
end
end)
end
Instances.FadeItem = function(self, Visibility, Speed)
local Item = self.Instance
if Visibility == true then
Item.Visible = true
end
local Descendants = Item:GetDescendants()
TableInsert(Descendants, Item)
local NewTween
for Index, Value in Descendants do
local TransparencyProperty = Tween:GetProperty(Value)
if not TransparencyProperty then
continue
end
if type(TransparencyProperty) == "table" then
for _, Property in TransparencyProperty do
NewTween = Tween:FadeItem(Value, Property, not Visibility, Speed)
end
else
NewTween = Tween:FadeItem(Value, TransparencyProperty, not Visibility, Speed)
end
end
end
Instances.AddToTheme = function(self, Properties)
if not self.Instance then
return
end
Library:AddToTheme(self, Properties)
end
Instances.ChangeItemTheme = function(self, Properties)
if not self.Instance then
return
end
Library:ChangeItemTheme(self, Properties)
end
Instances.Connect = function(self, Event, Callback, Name)
if not self.Instance then
return
end
if not self.Instance[Event] then
return
end
if Event == "MouseButton1Down" or Event == "MouseButton1Click" then
if IsMobile then
Event = "TouchTap"
end
elseif Event == "MouseButton2Down" or Event == "MouseButton2Click" then
if IsMobile then
Event = "TouchLongPress"
end
end
return Library:Connect(self.Instance[Event], Callback, Name)
end
Instances.Tween = function(self, Info, Goal)
if not self.Instance then
return
end
return Tween:Create(self, Info, Goal)
end
Instances.Disconnect = function(self, Name)
if not self.Instance then
return
end
return Library:Disconnect(Name)
end
Instances.Clean = function(self)
if not self.Instance then
return
end
self.Instance:Destroy()
self = nil
end
Instances.MakeDraggable = function(self)
if not self.Instance then
return
end
local Gui = self.Instance
local Dragging = false
local DragStart
local StartPosition
local Set = function(Input)
local DragDelta = Input.Position - DragStart
self:Tween(TweenInfo.new(0.16, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(StartPosition.X.Scale, StartPosition.X.Offset + DragDelta.X, StartPosition.Y.Scale, StartPosition.Y.Offset + DragDelta.Y)})
end
self:Connect("InputBegan", function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
Dragging = true
DragStart = Input.Position
StartPosition = Gui.Position
Input.Changed:Connect(function()
if Input.UserInputState == Enum.UserInputState.End then
Dragging = false
end
end)
end
end)
Library:Connect(UserInputService.InputChanged, function(Input)
if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
if Dragging then
Set(Input)
end
end
end)
return Dragging
end
Instances.MakeResizeable = function(self, Minimum, Maximum)
if not self.Instance then
return
end
local Gui = self.Instance
local Resizing = false
local Start = UDim2New()
local Delta = UDim2New()
local ResizeMax = Gui.Parent.AbsoluteSize - Gui.AbsoluteSize
local ResizeButton = Instances:Create("ImageButton", {
Parent = Gui,
Image = "rbxassetid://7368471234",
AnchorPoint = Vector2New(1, 1),
BorderColor3 = FromRGB(0, 0, 0),
Size = UDim2New(0, 6, 0, 6),
Position = UDim2New(1, -4, 1, -4),
Name = "\0",
BorderSizePixel = 0,
BackgroundTransparency = 1,
ZIndex = 5,
AutoButtonColor = false,
Visible = true,
}) ResizeButton:AddToTheme({ImageColor3 = "Accent"})
ResizeButton:Connect("InputBegan", function(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
Resizing = true
Start = Gui.Size - UDim2New(0, Input.Position.X, 0, Input.Position.Y)
Input.Changed:Connect(function()
if Input.UserInputState == Enum.UserInputState.End then
Resizing = false
end
end)
end
end)
Library:Connect(UserInputService.InputChanged, function(Input)
if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
if Resizing then
ResizeMax = Maximum or Gui.Parent.AbsoluteSize - Gui.AbsoluteSize
Delta = Start + UDim2New(0, Input.Position.X, 0, Input.Position.Y)
Delta = UDim2New(0, math.clamp(Delta.X.Offset, Minimum.X, ResizeMax.X), 0, math.clamp(Delta.Y.Offset, Minimum.Y, ResizeMax.Y))
Tween:Create(Gui, TweenInfo.new(0.17, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = Delta}, true)
end
end
end)
return Resizing
end
Instances.OnHover = function(self, Function)
if not self.Instance then
return
end
return Library:Connect(self.Instance.MouseEnter, Function)
end
Instances.OnHoverLeave = function(self, Function)
if not self.Instance then
return
end
return Library:Connect(self.Instance.MouseLeave, Function)
end
end
-- Custom font
local CustomFont = { } do
function CustomFont:New(Name, Weight, Style, Data)
if isfile(Library.Folders.Assets .. "/" .. Name .. ".json") then
return Font.new(getcustomasset(Library.Folders.Assets .. "/" .. Name .. ".json"))
end
if not isfile(Library.Folders.Assets .. "/" .. Name .. ".ttf") then
writefile(Library.Folders.Assets .. "/" .. Name .. ".ttf", game:HttpGet(Data.Url))
end
local FontData = {
name = Name,
faces = { {
name = "Regular",
weight = Weight,
style = Style,
assetId = getcustomasset(Library.Folders.Assets .. "/" .. Name .. ".ttf")
} }
}
writefile(Library.Folders.Assets .. "/" .. Name .. ".json", HttpService:JSONEncode(FontData))
return Font.new(getcustomasset(Library.Folders.Assets .. "/" .. Name .. ".json"))
end
function CustomFont:Get(Name)
if isfile(Library.Folders.Assets .. "/" .. Name .. ".json") then
return Font.new(getcustomasset(Library.Folders.Assets .. "/" .. Name .. ".json"))
end
end
CustomFont:New("Inter", 200, "Regular", {
Url = "https://github.com/sametexe001/luas/raw/refs/heads/main/fonts/InterSemibold.ttf"
})
Library.Font = CustomFont:Get("Inter")
end
Library.Holder = Instances:Create("ScreenGui", {
Parent = gethui(),
Name = "\0",
ZIndexBehavior = Enum.ZIndexBehavior.Global,
DisplayOrder = 2,
ResetOnSpawn = false
})
Library.UnusedHolder = Instances:Create("ScreenGui", {
Parent = gethui(),
Name = "\0",
ZIndexBehavior = Enum.ZIndexBehavior.Global,
Enabled = false,
ResetOnSpawn = false
})
Library.NotifHolder = Instances:Create("Frame", {
Parent = Library.Holder.Instance,
Name = "\0",
BorderColor3 = FromRGB(0, 0, 0),
AnchorPoint = Vector2New(1, 0),
BackgroundTransparency = 1,
Position = UDim2New(1, 0, 0, 0),
Size = UDim2New(0, 0, 1, 0),
BorderSizePixel = 0,
AutomaticSize = Enum.AutomaticSize.X,
BackgroundColor3 = FromRGB(255, 255, 255)
})
Instances:Create("UIListLayout", {
Parent = Library.NotifHolder.Instance,
Name = "\0",
Padding = UDimNew(0, 12),
SortOrder = Enum.SortOrder.LayoutOrder
})
Instances:Create("UIPadding", {
Parent = Library.NotifHolder.Instance,
Name = "\0",
PaddingTop = UDimNew(0, 12),
PaddingBottom = UDimNew(0, 12),
PaddingRight = UDimNew(0, 12),
PaddingLeft = UDimNew(0, 12)
})
Library.Unload = function(self)
for Index, Value in self.Connections do
Value.Connection:Disconnect()
end
for Index, Value in self.Threads do
coroutine.close(Value)
end
if self.Holder then
self.Holder:Clean()
end
Library = nil
getgenv().Library = nil
UserInputService.MouseIconEnabled = true
end
Library.GetImage = function(self, Image)
local ImageData = self.Images[Image]
if not ImageData then
return
end
return getcustomasset(self.Folders.Assets .. "/" .. ImageData[1])
end
Library.Round = function(self, Number, Float)
local Multiplier = 1 / (Float or 1)
return MathFloor(Number * Multiplier) / Multiplier
end
Library.Thread = function(self, Function)
local NewThread = coroutine.create(Function)
coroutine.wrap(function()
coroutine.resume(NewThread)
end)()
TableInsert(self.Threads, NewThread)
return NewThread
end
Library.SafeCall = function(self, Function, ...)
local Arguements = { ... }
local Success, Result = pcall(Function, TableUnpack(Arguements))
if not Success then
warn(Result)
return false
end
return Success
end
Library.Connect = function(self, Event, Callback, Name)
Name = Name or StringFormat("Connection%s%s", self.UnnamedConnections + 1, HttpService:GenerateGUID(false))
local NewConnection = {
Event = Event,
Callback = Callback,
Name = Name,
Connection = nil
}
Library:Thread(function()
NewConnection.Connection = Event:Connect(Callback)
end)
TableInsert(self.Connections, NewConnection)
return NewConnection
end
Library.Disconnect = function(self, Name)
for _, Connection in self.Connections do
if Connection.Name == Name then
Connection.Connection:Disconnect()
break
end
end
end
Library.NextFlag = function(self)
local FlagNumber = self.UnnamedFlags + 1
return StringFormat("flag_number_%s_%s", FlagNumber, HttpService:GenerateGUID(false))
end
Library.AddToTheme = function(self, Item, Properties)
Item = Item.Instance or Item
local ThemeData = {
Item = Item,
Properties = Properties,
}
for Property, Value in ThemeData.Properties do
if type(Value) == "string" then
Item[Property] = self.Theme[Value]
else
Item[Property] = Value()
end
end
TableInsert(self.ThemeItems, ThemeData)
self.ThemeMap[Item] = ThemeData
end
Library.RemoveFromTheme = function(self, Item)
Item = Item.Instance or Item
if not self.ThemeMap[Item] then
return
end
self.ThemeMap[Item].Properties = nil
self.ThemeMap[Item] = nil
end
Library.GetConfig = function(self)
local Config = { }
local Success, Result = Library:SafeCall(function()
for Index, Value in Library.Flags do
if type(Value) == "table" and Value.Key then
Config[Index] = {Key = tostring(Value.Key), Mode = Value.Mode}
elseif type(Value) == "table" and Value.Color then
Config[Index] = {Color = "#" .. Value.Color, Alpha = Value.Alpha}
else
Config[Index] = Value
end
end
end)
return HttpService:JSONEncode(Config)
end
Library.LoadConfig = function(self, Config)
local Decoded = HttpService:JSONDecode(Config)
local Success, Result = Library:SafeCall(function()
for Index, Value in Decoded do
local SetFunction = Library.SetFlags[Index]
if not SetFunction then
continue
end
if type(Value) == "table" and Value.Key then
SetFunction(Value)
elseif type(Value) == "table" and Value.Color then
SetFunction(Value.Color, Value.Alpha)
else
SetFunction(Value)
end
end
end)
return Success, Result
end
Library.DeleteConfig = function(self, Config)
if isfile(Library.Folders.Configs .. "/" .. Config) then
delfile(Library.Folders.Configs .. "/" .. Config)
end