-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGuiLibrary.lua
1352 lines (1161 loc) · 50.2 KB
/
GuiLibrary.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
--[[
Credits to anyones code i used or looked at
]]
repeat task.wait() until game:IsLoaded()
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local HttpService = game:GetService("HttpService")
local TextService = game:GetService("TextService")
local StarterGui = game:GetService("StarterGui")
local CoreGui = game:GetService("CoreGui")
local Players = game:GetService("Players")
local Debris = game:GetService("Debris")
local getasset = getsynasset or getcustomasset
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local configsaving = true
local LastPress = 0
local OnMobile
local TabsFrame
local Tabs = {}
local Fonts = {}
local Keybinds = {}
local Library = {
Device = "None",
Scale = 1,
MobileScale = 0.45,
Sounds = true,
GuiKeybind = "N",
Font = Enum.Font.Arial,
Notifications = true,
ChatNotifications = true,
ArrayListObject = {},
Objects = {},
UpdateHud = {},
Functions = {},
ColorSystem = { -- idk how i will do it
Type = "Normal", -- Normal or Custom
ColorR = 20,
ColorG = 20,
ColorB = 20
}
}
-- Main thing
local ScreenGui = Instance.new("ScreenGui", CoreGui)
ScreenGui.Name = "Mana"
ScreenGui.DisplayOrder = 999
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
ScreenGui.OnTopOfCoreBlur = true
local ClickGui = Instance.new("Frame", ScreenGui)
ClickGui.Name = "ClickGui"
local NotificationGui = Instance.new("Frame", ScreenGui)
NotificationGui.Name = "NotificationGui"
NotificationGui.BackgroundTransparency = 1
NotificationGui.Size = UDim2.new(0, 100, 0, 10)
NotificationGui.Position = UDim2.new(0, 1735, 0, 820)
--NotificationGui.Active = true
--NotificationGui.Draggable = true
Library.ScreenGui = ScreenGui
Library.ClickGui = ClickGui
Library.NotificationGui = NotificationGui
if UserInputService.TouchEnabled then
Library.Device = "Mobile"
end
for i,v in pairs(Enum.Font:GetEnumItems()) do
if v.Name ~= "Arial" then
table.insert(Fonts, v.Name)
end
end
Library.FontsList = Fonts
-- Config System
if isfolder("Mana") == false then
makefolder("Mana")
end
if isfolder("Mana/Assets") == false then
makefolder("Mana/Assets")
end
if isfolder("Mana/Config") == false then
makefolder("Mana/Config")
end
if isfolder("Mana/Scripts") == false then
makefolder("Mana/Scripts")
end
if isfolder("Mana/Modules") == false then
makefolder("Mana/Modules")
end
if isfolder("Mana/Libraries") == false then
makefolder("Mana/Libraries")
end
local foldername = "Mana/Config"
local conf = {
file = foldername .. "/" .. game.PlaceId .. ".json",
functions = {}
}
function conf.functions:MakeFile()
if isfile("Mana/Config/" .. game.PlaceId .. ".json") then return end
if not isfolder(foldername) then
makefolder(foldername)
end
writefile("Mana/Config/ ".. game.PlaceId .. ".json", "{}")
end
function conf.functions:LoadConfigs()
if not isfile("Mana/Config/" .. game.PlaceId .. ".json") then
conf.functions:MakeFile()
end
wait(0.5)
local success, data = pcall(function()
return HttpService:JSONDecode(readfile("Mana/Config/" .. game.PlaceId .. ".json"))
end)
if success then
warn("[ManaV2ForRoblox]: successfully decoded JSON.")
return data
else
warn("[ManaV2ForRoblox]: error in decoding JSON:", data, ".")
return {}
end
end
function conf.functions:WriteConfigs(tab)
conf.functions:MakeFile()
writefile("Mana/Config/" .. game.PlaceId .. ".json", HttpService:JSONEncode((tab or {})))
end
local configtable = (conf.functions:LoadConfigs() or {})
Library.ConfigSystem = conf
Library.ConfigTable = configtable
--[[ no
spawn(function()
repeat
conf.functions:WriteConfigs(configtable)
task.wait(30)
until (not configsaving)
end)
]]
local requestfunc = syn and syn.request or http and http.request or http_request or fluxus and fluxus.request or request or function(tab)
if tab.Method == "GET" then
return {
Body = game:HttpGet(tab.Url, true),
Headers = {},
StatusCode = 200
}
else
return {
Body = "bad exploit",
Headers = {},
StatusCode = 404
}
end
end
local betterisfile = function(file)
local suc, res = pcall(function() return readfile(file) end)
return suc and res ~= nil
end
local cachedassets = {}
local function GetCustomAsset(path)
if not betterisfile(path) then
spawn(function()
local textlabel = Instance.new("TextLabel")
textlabel.Size = UDim2.new(1, 0, 0, 36)
textlabel.Text = "Downloading "..path
textlabel.BackgroundTransparency = 1
textlabel.TextStrokeTransparency = 0
textlabel.TextSize = 30
textlabel.Font = Library.Font
textlabel.TextColor3 = Color3.new(1, 1, 1)
textlabel.Position = UDim2.new(0, 0, 0, -36)
textlabel.Parent = ScreenGui
repeat wait() until betterisfile(path)
textlabel:Remove()
end)
local req = requestfunc({
Url = "https://raw.githubusercontent.com/Maan04ka/NewManaV2ForRoblox/main/" .. path:gsub("Mana/Assets", "Assets"),
Method = "GET"
})
writefile(path, req.Body)
end
if cachedassets[path] == nil then
cachedassets[path] = getasset(path)
end
return cachedassets[path]
end
function dragGUI(gui)
task.spawn(function()
local dragging
local dragInput
local dragStart = Vector3.new(0,0,0)
local startPos
local function update(input)
local delta = input.Position - dragStart
local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
TweenService:Create(gui, TweenInfo.new(.20), {Position = Position}):Play()
end
gui.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragging = true
dragStart = input.Position
startPos = gui.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
end
end)
end
end)
gui.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
dragInput = input
end
end)
UserInputService.InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
end)
end
local ColorBox
function Library.Functions:MakeRainbowText(Text, Bool)
local Text = Text or Instance.new("TextLabel")
spawn(function()
ColorBox = Color3.fromRGB(170, 0, 170)
local x = 0
while wait() do
ColorBox = Color3.fromHSV(x, 1, 1)
x = x + 4.5 / 255
if x >= 1 then
x = 0
end
end
end)
spawn(function()
repeat
wait()
if Bool then
Text.TextColor3 = ColorBox
end
until true == false
end)
end
function Library.Functions:MakeRainbowObjectBackground(Object, Bool)
spawn(function()
repeat
wait()
if Bool then
Object.BackgroundColor3 = ColorBox
end
until true == false
end)
end
local function bettertween(obj, newpos, dir, style, tim, override)
spawn(function()
local frame = Instance.new("Frame")
frame.Visible = false
frame.Position = obj.Position
frame.Parent = ScreenGui
frame:GetPropertyChangedSignal("Position"):Connect(function()
obj.Position = UDim2.new(obj.Position.X.Scale, obj.Position.X.Offset, frame.Position.Y.Scale, frame.Position.Y.Offset)
end)
pcall(function()
frame:TweenPosition(newpos, dir, style, tim, override)
end)
frame.Parent = nil
task.wait(tim)
frame:Remove()
end)
end
local function bettertween2(obj, newpos, dir, style, tim, override)
spawn(function()
local frame = Instance.new("Frame")
frame.Visible = false
frame.Position = obj.Position
frame.Parent = ScreenGui
frame:GetPropertyChangedSignal("Position"):Connect(function()
obj.Position = UDim2.new(frame.Position.X.Scale, frame.Position.X.Offset, obj.Position.Y.Scale, obj.Position.Y.Offset)
end)
pcall(function()
frame:TweenPosition(newpos, dir, style, tim, override)
end)
frame.Parent = nil
task.wait(tim)
frame:Remove()
end)
end
function Library:CreateGuiNotification(title, text, delay2, toggled)
spawn(function()
if NotificationGui:FindFirstChild("Background") then NotificationGui:FindFirstChild("Background"):Destroy() end
if Library.Notifications == true then
local frame = Instance.new("Frame")
local frameborder = Instance.new("Frame")
local frametitle = Instance.new("TextLabel")
local frametext = Instance.new("TextLabel")
frame.Size = UDim2.new(0, 100, 0, 115)
frame.Position = UDim2.new(0.5, 0, 0, -115)
frame.BorderSizePixel = 0
frame.AnchorPoint = Vector2.new(0.5, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.new(0, 0, 0)
frame.Name = "Background"
frame.Parent = NotificationGui
frameborder.Size = UDim2.new(1, 0, 0, 8)
frameborder.BorderSizePixel = 0
frameborder.BackgroundColor3 = (toggled and Color3.fromRGB(102, 205, 67) or Color3.fromRGB(205, 64, 78))
frameborder.Parent = frame
frametitle.Font = Enum.Font.SourceSansLight
frametitle.BackgroundTransparency = 1
frametitle.Position = UDim2.new(0, 0, 0, 30)
frametitle.TextColor3 = (toggled and Color3.fromRGB(102, 205, 67) or Color3.fromRGB(205, 64, 78))
frametitle.Size = UDim2.new(1, 0, 0, 28)
frametitle.Text = " " .. title
frametitle.TextSize = 24
frametitle.TextXAlignment = Enum.TextXAlignment.Left
frametitle.TextYAlignment = Enum.TextYAlignment.Top
frametitle.Parent = frame
frametext.Font = Enum.Font.SourceSansLight
frametext.BackgroundTransparency = 1
frametext.Position = UDim2.new(0, 0, 0, 68)
frametext.TextColor3 = Color3.new(1, 1, 1)
frametext.Size = UDim2.new(1, 0, 0, 28)
frametext.Text = " " .. text
frametext.TextSize = 24
frametext.TextXAlignment = Enum.TextXAlignment.Left
frametext.TextYAlignment = Enum.TextYAlignment.Top
frametext.Parent = frame
local textsize = TextService:GetTextSize(frametitle.Text, frametitle.TextSize, frametitle.Font, Vector2.new(100000, 100000))
local textsize2 = TextService:GetTextSize(frametext.Text, frametext.TextSize, frametext.Font, Vector2.new(100000, 100000))
if textsize2.X > textsize.X then textsize = textsize2 end
frame.Size = UDim2.new(0, textsize.X + 38, 0, 115)
pcall(function()
frame:TweenPosition(UDim2.new(0.5, 0, 0, 20), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.15)
Debris:AddItem(frame, delay2 + 0.15)
end)
end
end)
end
function Library:CreateChatNotification(NotificationText, NotificationType) -- type: warning, error, print
local Text = NotificationText or "nil"
local NotificationType = NotificationType or "print"
local NewText
if NotificationType == "print" then
NewText = Text
else
NewText = "[" .. NotificationType .. "]: " .. Text
end
StarterGui:SetCore("ChatMakeSystemMessage", {
Font = Library.Font,
Text = NewText,
})
end
function Library:CreateNotification(NotificationTitle, NotificationText, Delay, Toggled, NotificationType)
if Library.Notifications then
Library:CreateGuiNotification(NotificationTitle, NotificationText, Delay, Toggled)
end
if Library.ChatNotifications then
Library:CreateChatNotification(NotificationText, NotificationType)
end
end
function Library:CreateSessionInfo()
local SessionInfoTable = {
Rainbow = false,
Objects = {}
}
local SessionInfo = Instance.new("Frame")
local UIListLayout = Instance.new("UIListLayout")
local RainbowTop = Instance.new("Frame")
local UICorner = Instance.new("UICorner")
local RainbowTopFix = Instance.new("Frame")
local UICorner_2 = Instance.new("UICorner")
local SessionInfoTitle = Instance.new("TextLabel")
SessionInfo.Name = "SessionInfo"
SessionInfo.Parent = ScreenGui
SessionInfo.BackgroundColor3 = Color3.fromRGB(14, 14, 23)
SessionInfo.BorderColor3 = Color3.fromRGB(0, 0, 0)
SessionInfo.BorderSizePixel = 0
SessionInfo.Position = UDim2.new(0, 0, 0.318777293, 0)
SessionInfo.Size = UDim2.new(0, 150, 0, 25)
dragGUI(SessionInfo)
UIListLayout.Parent = SessionInfo
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
RainbowTop.Name = "RainbowTop"
RainbowTop.Parent = SessionInfo
RainbowTop.BackgroundColor3 = Color3.fromRGB(215, 255, 140)
RainbowTop.BorderColor3 = Color3.fromRGB(0, 0, 0)
RainbowTop.BorderSizePixel = 0
RainbowTop.Size = UDim2.new(0, 150, 0, 10)
UICorner.CornerRadius = UDim.new(0, 4)
UICorner.Parent = RainbowTop
RainbowTopFix.Name = "RainbowTopFix"
RainbowTopFix.Parent = RainbowTop
RainbowTopFix.BackgroundColor3 = Color3.fromRGB(215, 255, 140)
RainbowTopFix.BorderColor3 = Color3.fromRGB(0, 0, 0)
RainbowTopFix.BorderSizePixel = 0
RainbowTopFix.Position = UDim2.new(0, 0, 0.670000017, 0)
RainbowTopFix.Size = UDim2.new(0, 150, 0, 4)
UICorner_2.CornerRadius = UDim.new(0, 4)
UICorner_2.Parent = SessionInfo
SessionInfoTitle.Name = "SessionInfoLabel"
SessionInfoTitle.Parent = SessionInfo
SessionInfoTitle.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
SessionInfoTitle.BorderColor3 = Color3.fromRGB(0, 0, 0)
SessionInfoTitle.BorderSizePixel = 0
SessionInfoTitle.LayoutOrder = 1
SessionInfoTitle.Position = UDim2.new(0, 0, 0.200000003, 0)
SessionInfoTitle.Size = UDim2.new(0, 150, 0, 15)
SessionInfoTitle.Font = Enum.Font.Arial
SessionInfoTitle.Text = " SessionInfo"
SessionInfoTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
SessionInfoTitle.TextSize = 14.000
SessionInfoTitle.TextXAlignment = Enum.TextXAlignment.Left
function SessionInfoTable:CreateStatisticLabel(Name)
local Name = Name or "Hello"
local LabelTable = {
Name = Name
}
local Label = Instance.new("TextLabel")
Label.Name = Name
Label.Parent = SessionInfo
Label.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
Label.BorderColor3 = Color3.fromRGB(0, 0, 0)
Label.BorderSizePixel = 0
Label.LayoutOrder = 1
Label.Position = UDim2.new(0, 0, 0.200000003, 0)
Label.Size = UDim2.new(0, 150, 0, 15)
Label.Font = Enum.Font.Arial
Label.Text = " " .. Name .. ": "
Label.TextColor3 = Color3.fromRGB(255, 255, 255)
Label.TextSize = 14.000
Label.TextXAlignment = Enum.TextXAlignment.Left
LabelTable.TextLabel = Label
table.insert(SessionInfoTable.Objects, Label)
return LabelTable
end
function SessionInfoTable:RemoveStatisticLabel(Name)
if SessionInfo:FindFirstChild(Name) then
SessionInfo:FindFirstChild(Name):Destroy()
end
end
function SessionInfoTable:Rainbow(Bool)
Library.Functions:MakeRainbowObjectBackground(RainbowTop, Bool)
Library.Functions:MakeRainbowObjectBackground(RainbowTopFix, Bool)
end
function SessionInfoTable:RemoveSessionInfo()
if SessionInfo then
SessionInfo:Destroy()
end
end
return SessionInfoTable
end
-- Hud functions
function Library.UpdateHud:UpdateFont(NewFont)
local font = "Enum.Font." .. NewFont
for i, v in pairs(ScreenGui:GetChildren()) do
if v:IsA("TextButton") or v:IsA("TextLabel") then
v.Font = font
end
end
end
-- Functions functions
function Library:RandomString() -- from vape
local randomlength = math.random(10,100)
local array = {}
for i = 1, randomlength do
array[i] = string.char(math.random(32, 126))
end
return table.concat(array)
end
-- Library functions
function Library:ToggleLibrary()
if UserInputService:GetFocusedTextBox() == nil then
if ClickGui.Visible then
ClickGui.Visible = false
else
ClickGui.Visible = true
end
end
end
function Library:RemoveObject(ObjectName)
pcall(function()
if Library.Objects[ObjectName] and Library.Objects[ObjectName].Type == "Toggle" then
Library.Objects[ObjectName].Instance:Destroy()
Library.Objects[ObjectName].OptionFrame:Destroy()
Library.Objects[ObjectName] = nil
end
end)
end
function Library:playsound(id, volume)
if Library.Sounds == true then
local sound = Instance.new("Sound")
sound.Parent = workspace
sound.SoundId = id
if volume then
sound.Volume = volume
end
sound:Play()
wait(sound.TimeLength + 2)
sound:Destroy()
end
end
--[[
ToDo:
Make tabs scrollable
Make tabs dragable
]]
function Library:CreateWindow()
ScreenGui.Name = Library:RandomString()
local TabsFrame = Instance.new("Frame")
local uilistthingy = Instance.new("UIListLayout")
local UIScale = Instance.new("UIScale")
local HoverText = Instance.new("TextLabel")
TabsFrame.Name = "Tabs"
TabsFrame.Parent = ClickGui
TabsFrame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TabsFrame.BackgroundTransparency = 1.000
TabsFrame.BorderSizePixel = 0
TabsFrame.Position = UDim2.new(0.010, 0, 0.010, 0)
TabsFrame.Size = UDim2.new(0, 207, 0, 40)
TabsFrame.AutomaticSize = "X"
uilistthingy.Parent = TabsFrame
uilistthingy.FillDirection = Enum.FillDirection.Horizontal
uilistthingy.SortOrder = Enum.SortOrder.LayoutOrder
uilistthingy.Padding = UDim.new(0, 40)
UIScale.Parent = TabsFrame
UIScale.Scale = Library.Scale
HoverText.Text = " "
HoverText.ZIndex = 1
HoverText.TextColor3 = Color3.fromRGB(160, 160, 160)
HoverText.TextXAlignment = Enum.TextXAlignment.Left
HoverText.TextSize = 14
HoverText.Visible = false
HoverText.Parent = TabsFrame
HoverText.AnchorPoint = Vector2.new(0.5, 0.5)
Library.TabsFrame = TabsFrame
Library.UIScale = UIScale
if Library.Device == "Mobile" then
UIScale.Scale = Library.MobileScale
Library.Scale = 0.45
end
function Library:CreateTab(TabData)
local TabName = TabData.Name
local Color = TabData.Color or Color3.fromRGB(83, 214, 110)
--local TabIcon = TabData.TabIcon
local Callback = TabData.Callback or function() end
table.insert(Tabs, #Tabs)
local tab = Instance.new("TextButton")
local tabname = Instance.new("TextLabel")
local assetthing = Instance.new("ImageLabel")
local uilistlayout = Instance.new("UIListLayout")
local tabtable = {
Name = TabName,
Color = Color,
Visible = true,
Callback = (TabData.Callback or function() end),
Toggles = {}
}
--[[
-- W - Width, H - Height
local TabPositionX = 0
local TabPositionY = 247 * #Tabs
local TabPositionW = 0
local TabPositionH = 0
local TabPositionTable = {
X = TabPositionX,
Y = TabPositionY,
W = TabPositionW,
H = TabPositionH,
}
if configtable[title] == nil and configtable[title.Position] == nil or configtable[title] == nil or configtable[title.Position] == nil then
configtable[title] = title
configtable[title.Position] = TabPositionTable
end
]]
tab.Modal = true
tab.Name = TabName
tab.Selectable = true
tab.ZIndex = 1
tab.Parent = TabsFrame
tab.BackgroundColor3 = Color3.fromRGB(14, 14, 23)
tab.BorderSizePixel = 0
tab.Position = configtable[TabName.Position] or UDim2.new(TabPositionX, TabPositionY, TabPositionW, TabPositionH)
tab.Size = UDim2.new(0, 207, 0, 40)
tab.Active = true
tab.LayoutOrder = 1 + #Tabs
tab.AutoButtonColor = false
tab.Text = ""
tabname.Name = TabName
tabname.Parent = tab
tabname.ZIndex = tab.ZIndex + 1
tabname.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
tabname.BackgroundTransparency = 1.000
tabname.BorderSizePixel = 0
tabname.Position = UDim2.new(0, 199,0, 40)
tabname.Size = UDim2.new(0, 199,0, 40)
tabname.Font = Enum.Font.SourceSansLight
tabname.Text = " " .. TabName
tabname.TextColor3 = Color
tabname.TextSize = 22.000
tabname.TextWrapped = true
tabname.TextXAlignment = Enum.TextXAlignment.Left
tabname.Selectable = true
assetthing.Parent = tabname
assetthing.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
assetthing.BackgroundTransparency = 1
assetthing.Position = UDim2.new(0.86, 0,0.154, 0)
assetthing.Size = UDim2.new(0, 30, 0, 30)
uilistlayout.Parent = tab
uilistlayout.SortOrder = Enum.SortOrder.LayoutOrder
tabtable.MainObject = tab
function tabtable:ChangeVisibility(bool)
bool = bool or not tab.Visible
tab.Visible = bool
Callback(bool)
end
--dragGUI(tab, tabname)
function tabtable:CreateDivider(DividerText)
local DividerFrame = Instance.new("Frame")
local Divider = Instance.new("TextLabel")
local DividerFrame2 = Instance.new("Frame")
DividerFrame.Name = title .. "_FrameDivider"
DividerFrame.Parent = tab
DividerFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
DividerFrame.BorderSizePixel = 0
DividerFrame.Position = UDim2.new(0.0827946085, -17, 0.133742347, 33)
DividerFrame.Size = UDim2.new(0, 207, 0, 2)
Divider.Name = title .. "_TextLabelDivider"
Divider.Parent = tab
Divider.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
Divider.BorderSizePixel = 0
Divider.Position = UDim2.new(0.0827946085, -17, 0.133742347, 33)
Divider.Size = UDim2.new(0, 207, 0, 20)
Divider.Font = Enum.Font.SourceSansLight --Library.Font
Divider.Text = DividerText
Divider.TextColor3 = Color3.fromRGB(255, 255, 255)
Divider.TextSize = 18
Divider.TextXAlignment = Enum.TextXAlignment.Center
DividerFrame2.Name = title .. "_FrameDivider"
DividerFrame2.Parent = tab
DividerFrame2.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
DividerFrame2.BorderSizePixel = 0
DividerFrame2.Position = UDim2.new(0.0827946085, -17, 0.133742347, 33)
DividerFrame2.Size = UDim2.new(0, 207, 0, 2)
return Divider
end
function tabtable:CreateToggle(data)
local info = {
Name = data.Name,
HoverText = data.HoverText,
Keybind = (configtable[data.Name.Keybind] or data.Keybind),
Callback = (data.Callback or function() end)
}
configtable[info.Name] = {
Keybind = ((configtable[info.Name] and configtable[info.Name].Keybind) or "none"),
IsToggled = ((configtable[info.Name] and configtable[info.Name].IsToggled) or false)
}
local title = info.Name
local ToolTip = info.HoverText
local keybind = info.Keybind
local Callback = info.Callback
keybind = (keybind or {Name = nil})
Keybinds[(keybind.Name or "%*")] = (keybind.Name == nil and false or true)
local focus = {
Elements = {}
}
local ToggleTable = {
Name = data.Name or "",
Enabled = false,
Visible = true,
Callback = data.Callback or function() end
}
Library.Objects[title] = ToggleTable
table.insert(tabtable.Toggles, #tabtable.Toggles)
oldkey = keybind.Name
local toggle = Instance.new("TextButton")
local BindText = Instance.new("TextButton")
local optionsframebutton = Instance.new("TextButton")
local togname = Instance.new("TextLabel")
local optionframe = Instance.new("Frame")
local UIListLayout = Instance.new("UIListLayout")
toggle.Name = title
toggle.Parent = tab
toggle.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
toggle.BorderSizePixel = 0
toggle.Position = UDim2.new(0.0827946085, -17, 0.133742347, 33)
toggle.Size = UDim2.new(0, 207, 0, 40)
toggle.Text = ""
togname.Parent = toggle
togname.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
togname.BackgroundTransparency = 1.000
togname.BorderSizePixel = 0
togname.Position = UDim2.new(0.0338164233, 0, 0.163378686, 0)
togname.Size = UDim2.new(0, 192, 0, 26)
togname.Font = Enum.Font.SourceSansLight
togname.Text = title
togname.TextColor3 = Color3.fromRGB(255, 255, 255)
togname.TextSize = 22.000
togname.TextWrapped = true
togname.TextXAlignment = Enum.TextXAlignment.Left
optionsframebutton.Parent = toggle
optionsframebutton.Position = UDim2.new(0, 170, 0, 0)
optionsframebutton.Size = UDim2.new(0, 37, 0, 39)
optionsframebutton.BackgroundTransparency = 1
optionsframebutton.Text = "."
optionsframebutton.TextSize = "30"
optionframe.Name = "OptionFrame" .. info.Name
optionframe.Parent = tab
optionframe.BackgroundColor3 = Color3.fromRGB(47, 48, 64)
optionframe.Position = UDim2.new(0.102424242, 0, 0.237059206, 0)
optionframe.Size = UDim2.new(0, 207, 0, 0)
optionframe.AutomaticSize = "Y"
optionframe.Visible = false
UIListLayout.Parent = optionframe
UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0, 8)
BindText.Name = "BindText"
BindText.Parent = optionframe
BindText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
BindText.BackgroundTransparency = 1.000
BindText.Position = UDim2.new(0.0989583358, 0, 0, 0)
BindText.Size = UDim2.new(0, 175, 0, 33)
BindText.Font = Enum.Font.SourceSansLight
BindText.Text = "Bind: none"
BindText.TextColor3 = Color3.fromRGB(255, 255, 255)
BindText.TextSize = 22.000
BindText.TextXAlignment = Enum.TextXAlignment.Left
BindText.TextYAlignment = Enum.TextYAlignment.Center
ToggleTable.MainObject = toggle
BindText.MouseEnter:Connect(function()
focus.Elements["toggle_" .. title] = true
end)
BindText.MouseLeave:Connect(function()
focus.Elements["toggle_" .. title] = false
end)
conf.functions:WriteConfigs(configtable)
local configData = HttpService:JSONDecode(readfile(conf.file))
if isfile(conf.file) and configData[title].Keybind and configData[title].Keybind ~= "none" then
local keybind = configData[title].Keybind
if Keybinds[keybind] then
BindText.Text = "Bind: " .. keybind
isclicked = false
return
end
if oldkey then
Keybinds[oldkey] = nil
end
oldkey = keybind
BindText.Text = "Bind: " .. keybind
configtable[title].Keybind = keybind
isclicked = false
cooldown = true
wait(0.5)
cooldown = false
end
BindText.MouseButton1Click:Connect(function()
if not focus.Elements["toggle_" .. title] or isclicked then return end
isclicked = true
BindText.Text = "Bind: ..."
UserInputService.InputBegan:Connect(function(input)
local inputName = input.KeyCode.Name
if inputName == "Unknown" and input.UserInputType == Enum.UserInputType.MouseButton2 then
isclicked = true
BindText.Text = "Bind: " .. configtable[title].Keybind or "none"
print("Binding canceled.")
elseif inputName ~= "Unknown" and inputName ~= oldkey then
if not isclicked then return end
if Keybinds[inputName] then
BindText.Text = "Bind: " .. oldkey
isclicked = false
return
end
if oldkey then
Keybinds[oldkey] = nil
end
print("Pressed keybind: " .. inputName)
oldkey = inputName
BindText.Text = "Bind: " .. oldkey
configtable[title].Keybind = oldkey
isclicked = false
cooldown = true
wait(0.5)
cooldown = false
end
end)
end)
toggle.MouseButton2Click:Connect(function()
optionframe.Visible = not optionframe.Visible
end)
optionsframebutton.MouseButton1Click:Connect(function()
optionframe.Visible = not optionframe.Visible
end)
toggle.MouseButton1Click:Connect(function()
local currentTime = tick()
if currentTime - LastPress < 0.5 and OnMobile then
optionframe.Visible = not optionframe.Visible
end
LastPress = currentTime
end)
if not isfile(conf.file) then
configtable[title].IsToggled = false
end
function ToggleTable:Toggle(silent, bool)
bool = bool or (not ToggleTable.Enabled)
silent = silent or false
ToggleTable.Enabled = bool
if not bool then
spawn(function()
Callback(false)
end)
spawn(function()
Library:CreateNotification(title, "Disabled " .. title, 4, false)
configtable[title].IsToggled = false
end)
toggle.BackgroundColor3 = Color3.fromRGB(14, 20, 14)
if not silent then
Library:playsound("rbxassetid://421058925", 1)
end
else
spawn(function()
Callback(true)
end)
spawn(function()
Library:CreateNotification(title, "Enabled " .. title, 4, true)
configtable[title].IsToggled = true
end)
toggle.BackgroundColor3 = tabname.TextColor3
if not silent then
Library:playsound("rbxassetid://421058925", 1)
end
end
end
toggle.MouseButton1Click:Connect(function()
ToggleTable:Toggle()
end)
UserInputService.InputBegan:Connect(function(input)
if oldkey and not cooldown and not isclicked and input.KeyCode.Name == oldkey and not UserInputService:GetFocusedTextBox() then
ToggleTable:Toggle()
end
end)
if configtable[title].IsToggled then
ToggleTable:Toggle(true)
end
function ToggleTable:ChangeVisibility(Bool)
bool = bool or not toggle.Visible
toggle.Visible = bool
Callback(bool)
end
function ToggleTable:CreateSlider(argstable)
local sliderapi = {Value = (configtable[argstable.Name .. ToggleTable.Name] and configtable[argstable.Name .. ToggleTable.Name].Value or argstable.Default or argstable.Min)}
local min = argstable.Min
local max = argstable.Max
local round = argstable.Round or 2
local slider = Instance.new("TextButton")
local slidertext = Instance.new("TextLabel")
local slider_2 = Instance.new("Frame")
slider.Name = "Slider"
slider.Parent = optionframe
slider.BackgroundColor3 = Color3.fromRGB(47, 48, 64)
slider.BorderSizePixel = 0
slider.Position = UDim2.new(0.0833333358, 0, 0.109391868, 0)
slider.Size = UDim2.new(0, 180, 0, 34)
slider.Text = ""
slider.AutoButtonColor = false
slidertext.Name = "SliderText"
slidertext.Parent = slider
slidertext.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
slidertext.BackgroundTransparency = 1.000
slidertext.BorderSizePixel = 0
slidertext.Position = UDim2.new(0.0188679248, 0, 0, 0)
slidertext.Size = UDim2.new(0, 180, 0, 33)