forked from 0W0Pumpkin/VapeV4ForRoblox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOldGuiLibrary.lua
1873 lines (1805 loc) · 70.2 KB
/
OldGuiLibrary.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
local VERSION = "v4.00"
local rainbowvalue = 0
local cam = game:GetService("Workspace").CurrentCamera
local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local api = {
["Settings"] = {["GUIObject"] = {["Type"] = "Custom", ["GUIKeybind"] = "RightShift", ["BlatantMode"] = false, ["Color"] = 0.44}, ["SearchObject"] = {["Type"] = "Custom", ["List"] = {}}},
["FriendsObject"] = {["Color"] = 0.44, ["Friends"] = {}, ["MiddleClickFriends"] = false, ["MiddleClickFunc"] = function(plr) end},
["ObjectsThatCanBeSaved"] = {},
}
coroutine.resume(coroutine.create(function()
repeat
for i = 0, 1, 0.01 do
wait(0.01)
rainbowvalue = i
end
until true == false
end))
local holdingshift = false
local captured = false
local pressedkey = ""
local capturedslider = nil
local function randomString()
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
api["findObjectInTable"] = function(temp, object)
for i,v in pairs(temp) do
if i == object or v == object then
return true
end
end
return false
end
local function RelativeXY(GuiObject, location)
local x, y = location.X - GuiObject.AbsolutePosition.X, location.Y - GuiObject.AbsolutePosition.Y
local xm, ym = GuiObject.AbsoluteSize.X, GuiObject.AbsoluteSize.Y
x = math.clamp(x, 0, xm)
y = math.clamp(y, 0, ym)
return x, y, x/xm, y/ym
end
local function dragGUI(gui)
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)
game:GetService("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 and dragging == false 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)
game:GetService("UserInputService").InputChanged:Connect(function(input)
if input == dragInput and dragging then
update(input)
end
end)
end)
end
if not game:IsLoaded() then
game.Loaded:Wait()
end
if not is_sirhurt_closure and syn and syn.protect_gui then
local gui = Instance.new("ScreenGui")
gui.Name = randomString()
gui.DisplayOrder = 999
syn.protect_gui(gui)
gui.Parent = game:GetService("CoreGui")
api["MainGui"] = gui
shared.gui = gui
elseif PROTOSMASHER_LOADED and get_hidden_gui then
local gui = Instance.new("ScreenGui")
gui.Name = randomString()
gui.DisplayOrder = 999
gui.Parent = get_hidden_gui()
api["MainGui"] = gui
elseif elysianexecute and gethui then
local gui = Instance.new("ScreenGui")
gui.Name = randomString()
gui.DisplayOrder = 999
gui.Parent = gethui()
api["MainGui"] = gui
elseif game:GetService("CoreGui"):FindFirstChild('RobloxGui') then
api["MainGui"] = game:GetService("CoreGui").RobloxGui
else
local gui = Instance.new("ScreenGui")
gui.Name = randomString()
gui.DisplayOrder = 999
gui.Parent = game:GetService("ScreenGui")
api["MainGui"] = gui
end
api["UpdateHudEvent"] = Instance.new("BindableEvent")
local clickgui = Instance.new("Frame")
clickgui.Name = "ClickGui"
clickgui.Size = UDim2.new(1, 0, 1, 0)
clickgui.BackgroundTransparency = 1
clickgui.Visible = false
clickgui.Parent = api["MainGui"]
local vertext = Instance.new("TextLabel")
vertext.Name = "Version"
vertext.Size = UDim2.new(0, 100, 0, 20)
vertext.Font = Enum.Font.SourceSans
vertext.TextColor3 = Color3.new(1, 1, 1)
vertext.Active = false
vertext.TextSize = 25
vertext.BackgroundTransparency = 1
vertext.Text = VERSION
vertext.TextXAlignment = Enum.TextXAlignment.Right
vertext.TextYAlignment = Enum.TextYAlignment.Bottom
vertext.Position = UDim2.new(1, -105, 1, -25)
vertext.Parent = clickgui
local vertext2 = vertext:Clone()
vertext2.Position = UDim2.new(0, 1, 0, 1)
vertext2.TextColor3 = Color3.new(0.42, 0.42, 0.42)
vertext2.ZIndex = 0
vertext2.Parent = vertext
local modal = Instance.new("TextButton")
modal.Size = UDim2.new(0, 0, 0, 0)
modal.BorderSizePixel = 0
modal.Text = ""
modal.Modal = true
modal.Parent = clickgui
local topbar = Instance.new("Frame")
topbar.Size = UDim2.new(0, 180, 0, 40)
topbar.Position = UDim2.new(0.5, -90, 0, -36)
topbar.BackgroundColor3 = Color3.fromRGB(36, 39, 43)
topbar.BorderSizePixel = 0
topbar.ZIndex = -1
topbar.Name = "TopBar"
topbar.Parent = clickgui
local vapelogoL = Instance.new("ImageLabel")
vapelogoL.Size = UDim2.new(0, 46, 0, 25)
vapelogoL.Position = UDim2.new(0, 11, 0, 8)
vapelogoL.BackgroundTransparency = 1
vapelogoL.Image = "http://www.roblox.com/asset/?id=6083846452"
vapelogoL.Name = "VapeLogoLeft"
vapelogoL.Parent = topbar
local vapelogoR = Instance.new("ImageLabel")
vapelogoR.Size = UDim2.new(0, 46, 0, 25)
vapelogoR.Position = UDim2.new(0, 57, 0, 8)
vapelogoR.BackgroundTransparency = 1
vapelogoR.Image = "http://www.roblox.com/asset/?id=6083888864"
vapelogoR.Name = "VapeLogoRight"
vapelogoR.Parent = topbar
local vapelogoC = Instance.new("Frame")
vapelogoC.Size = UDim2.new(0, 4, 0, 12)
vapelogoC.Position = UDim2.new(0, 57, 0, 8)
vapelogoC.BackgroundColor3 = Color3.fromRGB(36, 39, 43)
vapelogoC.BorderSizePixel = 0
vapelogoC.Name = "VapeLogoCoverup"
vapelogoC.ZIndex = 2
vapelogoC.Parent = topbar
local vapeoptionsbutton = Instance.new("TextButton")
vapeoptionsbutton.AutoButtonColor = false
vapeoptionsbutton.BorderSizePixel = 0
vapeoptionsbutton.Position = UDim2.new(0, 108, 0, 4)
vapeoptionsbutton.BackgroundColor3 = Color3.fromRGB(15, 20, 26)
vapeoptionsbutton.TextSize = 26
vapeoptionsbutton.Font = Enum.Font.SourceSans
vapeoptionsbutton.Text = "⚙"
vapeoptionsbutton.Size = UDim2.new(0, 32, 0, 32)
vapeoptionsbutton.Name = "OptionsButton"
vapeoptionsbutton.Parent = topbar
local vapeoptionsframe = Instance.new("Frame")
vapeoptionsframe.ZIndex = 10
vapeoptionsframe.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
vapeoptionsframe.Size = UDim2.new(0, 181, 0, 338)
vapeoptionsframe.Position = UDim2.new(0, 109, 1, 0)
vapeoptionsframe.BorderSizePixel = 0
vapeoptionsframe.Visible = false
vapeoptionsframe.Parent = topbar
local uilistlayout = Instance.new("UIListLayout")
uilistlayout.SortOrder = Enum.SortOrder.LayoutOrder
uilistlayout.Parent = vapeoptionsframe
uilistlayout:GetPropertyChangedSignal("AbsoluteContentSize"):connect(function()
vapeoptionsframe.Size = UDim2.new(0, 181, 0, uilistlayout.AbsoluteContentSize.Y)
end)
local vapesearchbutton = vapeoptionsbutton:Clone()
vapesearchbutton.Text = "🔍"
vapesearchbutton.Name = "SearchButton"
vapesearchbutton.Position = UDim2.new(0, 144, 0, 4)
vapesearchbutton.Parent = topbar
local hudgui = Instance.new("Frame")
hudgui.Name = "HudGui"
hudgui.Size = UDim2.new(1, 0, 1, 0)
hudgui.BackgroundTransparency = 1
hudgui.Visible = true
hudgui.Parent = api["MainGui"]
local function CreateTopBarOption(typeval, name, ...)
local args = {...}
if typeval == "Toggle" then
local buttonapi = {}
local amount = #vapeoptionsframe:GetChildren()
local frame = Instance.new("Frame")
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 1
frame.LayoutOrder = amount
frame.Size = UDim2.new(0, 181, 0, 22)
frame.Name = name
frame.Visible = true
frame.Parent = vapeoptionsframe
local button = Instance.new("TextButton")
button.Name = "Toggle"
button.AutoButtonColor = false
button.Text = ""
button.BackgroundColor3 = (args[3] and Color3.fromHSV(api["Settings"]["GUIObject"]["Color"], 1, 1)) or Color3.fromRGB(89, 89, 89)
button.BorderSizePixel = 0
button.Size = UDim2.new(0, 22, 0, 15)
button.Position = UDim2.new(0, 5, 0, 3)
button.ZIndex = 12
button.Parent = frame
local uicorner = Instance.new("UICorner")
uicorner.CornerRadius = UDim.new(0, 32)
uicorner.Parent = button
local frame2 = Instance.new("Frame")
frame2.Active = false
frame2.Size = UDim2.new(0, 12, 0, 11)
frame2.Position = (args[3] and UDim2.new(0, 8, 0, 2)) or UDim2.new(0, 3, 0, 2)
frame2.BackgroundColor3 = Color3.fromRGB(48, 48, 48)
frame2.BorderSizePixel = 0
frame2.ZIndex = 13
frame2.Parent = button
local uicorner2 = Instance.new("UICorner")
uicorner2.CornerRadius = UDim.new(0, 32)
uicorner2.Parent = frame2
local textlabel = Instance.new("TextLabel")
textlabel.BackgroundTransparency = 1
textlabel.Font = Enum.Font.SourceSans
textlabel.Active = false
textlabel.TextSize = 14
textlabel.TextColor3 = Color3.new(1, 1, 1)
textlabel.Size = UDim2.new(0, 140, 0, 19)
textlabel.TextXAlignment = Enum.TextXAlignment.Left
textlabel.Name = name
textlabel.Text = " "..name
textlabel.ZIndex = 13
textlabel.Parent = frame
buttonapi["Enabled"] = false
buttonapi["Keybind"] = ""
buttonapi["Default"] = args[3]
buttonapi["ToggleButton"] = function(toggle)
buttonapi["Enabled"] = toggle
if buttonapi["Enabled"] then
button.BackgroundColor3 = Color3.fromHSV(api["Settings"]["GUIObject"]["Color"], 1, 1)
frame2.Position = UDim2.new(0, 8, 0, 2)
args[1]()
else
button.BackgroundColor3 = Color3.fromRGB(89, 89, 89)
frame2.Position = UDim2.new(0, 3, 0, 2)
frame2.BackgroundColor3 = Color3.fromRGB(48, 48, 48)
args[2]()
end
end
buttonapi["ToggleButton"](args[3])
button.MouseButton1Click:connect(function() buttonapi["ToggleButton"](not buttonapi["Enabled"]) end)
api["ObjectsThatCanBeSaved"]["VapeOptions"..name.."Toggle"] = {["Type"] = "NewToggle", ["Object"] = button, ["Api"] = buttonapi}
return buttonapi
end
if typeval == "GUIButton" then
local buttonapi = {}
local amount = #vapeoptionsframe:GetChildren()
local frame = Instance.new("Frame")
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 1
frame.LayoutOrder = amount
frame.Size = UDim2.new(0, 181, 0, 25)
frame.Name = name
frame.Visible = true
frame.Parent = vapeoptionsframe
local textbutton = Instance.new("TextButton")
textbutton.Size = UDim2.new(0, 173, 0, 20)
textbutton.AutoButtonColor = false
textbutton.BorderSizePixel = 0
textbutton.Position = UDim2.new(0, 4, 0, 1)
textbutton.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
textbutton.Font = Enum.Font.SourceSans
textbutton.TextSize = 18
textbutton.TextColor3 = Color3.new(1, 1, 1)
textbutton.Name = name
textbutton.Text = name
textbutton.ZIndex = 13
textbutton.Parent = frame
buttonapi["Object"] = textbutton
textbutton.MouseButton1Click:connect(function() args[1]() end)
api["ObjectsThatCanBeSaved"]["VapeOptions"..name.."Button"] = {["Type"] = "NewButton", ["Object"] = textbutton, ["Api"] = buttonapi}
return buttonapi
end
if typeval == "Button" then
local buttonapi = {}
local amount = #vapeoptionsframe:GetChildren()
local frame = Instance.new("Frame")
frame.BorderSizePixel = 0
frame.BackgroundTransparency = 1
frame.LayoutOrder = amount
frame.Size = UDim2.new(0, 181, 0, 22)
frame.Name = name
frame.Visible = true
frame.Parent = vapeoptionsframe
local textbutton = Instance.new("TextButton")
textbutton.Size = UDim2.new(0, 162, 0, 18)
textbutton.AutoButtonColor = false
textbutton.TextXAlignment = Enum.TextXAlignment.Left
textbutton.BorderSizePixel = 0
textbutton.Position = UDim2.new(0, 5, 0, 2)
textbutton.BackgroundColor3 = Color3.fromRGB(55, 55, 55)
textbutton.Font = Enum.Font.SourceSans
textbutton.TextSize = 14
textbutton.TextColor3 = Color3.new(1, 1, 1)
textbutton.Name = name
textbutton.Text = " "..name
textbutton.ZIndex = 13
textbutton.Parent = frame
buttonapi["Object"] = textbutton
textbutton.MouseButton1Click:connect(function() args[1]() end)
api["ObjectsThatCanBeSaved"]["VapeOptions"..name.."Button"] = {["Type"] = "NewButton", ["Object"] = textbutton, ["Api"] = buttonapi}
return buttonapi
end
end
vapeoptionsbutton.MouseButton1Click:connect(function()
vapeoptionsframe.Visible = not vapeoptionsframe.Visible
end)
api["SaveFriends"] = function()
writefile("vape/Profiles/friends.vapefriends", game:GetService("HttpService"):JSONEncode(api["FriendsObject"]["Friends"]))
end
api["LoadFriends"] = function()
local success, result = pcall(function()
return game:GetService("HttpService"):JSONDecode(readfile("vape/Profiles/friends.vapefriends"))
end)
if success and type(result) == "table" then
api["FriendsObject"]["Friends"] = result
end
end
api["SaveSettings"] = function()
for i,v in pairs(api["ObjectsThatCanBeSaved"]) do
if v["Type"] == "Window" then
api["Settings"][i] = {["Type"] = "Window", ["Visible"] = v["Object"].Visible, ["Expanded"] = v["ChildrenObject"].Visible, ["Position"] = {v["Object"].Position.X.Scale, v["Object"].Position.X.Offset, v["Object"].Position.Y.Scale, v["Object"].Position.Y.Offset}}
end
if v["Type"] == "CustomWindow" then
api["Settings"][i] = {["Type"] = "CustomWindow", ["Visible"] = v["Object"].Visible, ["Pinned"] = v["Api"]["Pinned"], ["Position"] = {v["Object"].Position.X.Scale, v["Object"].Position.X.Offset, v["Object"].Position.Y.Scale, v["Object"].Position.Y.Offset}}
end
if (v["Type"] == "Button" or v["Type"] == "Toggle") then
api["Settings"][i] = {["Type"] = "Button", ["Enabled"] = v["Api"]["Enabled"], ["Keybind"] = v["Api"]["Keybind"]}
end
if v["Type"] == "NewToggle" then
api["Settings"][i] = {["Type"] = "NewToggle", ["Enabled"] = v["Api"]["Enabled"], ["Keybind"] = v["Api"]["Keybind"]}
end
if v["Type"] == "Dropdown" then
api["Settings"][i] = {["Type"] = "Dropdown", ["Value"] = v["Api"]["Value"]}
end
if v["Type"] == "OptionsButton" then
api["Settings"][i] = {["Type"] = "OptionsButton", ["Enabled"] = v["Api"]["Enabled"], ["Expanded"] = v["Api"]["Expanded"], ["Keybind"] = v["Api"]["Keybind"]}
end
if v["Type"] == "Slider" then
api["Settings"][i] = {["Type"] = "Slider", ["Value"] = v["Api"]["Value"]}
end
if v["Type"] == "ColorSlider" then
api["Settings"][i] = {["Type"] = "ColorSlider", ["Value"] = v["Api"]["Value"], ["RainbowValue"] = v["Api"]["RainbowValue"]}
end
end
writefile("vape/Profiles/"..game.PlaceId..".vapeprofile", game:GetService("HttpService"):JSONEncode(api["Settings"]))
end
api["LoadSettings"] = function()
local success, result = pcall(function()
return game:GetService("HttpService"):JSONDecode(readfile("vape/Profiles/"..game.PlaceId..".vapeprofile"))
end)
if success and type(result) == "table" then
api["Settings"]["GUIObject"]["BlatantMode"] = result["GUIObject"]["BlatantMode"]
for i,v in pairs(result) do
if v["Type"] == "Window" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Object"].Position = UDim2.new(v["Position"][1], v["Position"][2], v["Position"][3], v["Position"][4])
api["ObjectsThatCanBeSaved"][i]["Object"].Visible = v["Visible"]
api["ObjectsThatCanBeSaved"][i]["Api"]["RealVis"] = v["Visible"]
if v["Expanded"] then
api["ObjectsThatCanBeSaved"][i]["Api"]["ExpandToggle"]()
end
end
if v["Type"] == "Custom" and api["findObjectInTable"](api["Settings"], i) then
api["Settings"][i] = v
end
if v["Type"] == "CustomWindow" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Object"].Position = UDim2.new(v["Position"][1], v["Position"][2], v["Position"][3], v["Position"][4])
api["ObjectsThatCanBeSaved"][i]["Object"].Visible = v["Visible"]
if v["Pinned"] then
api["ObjectsThatCanBeSaved"][i]["Api"]["PinnedToggle"]()
end
api["ObjectsThatCanBeSaved"][i]["Api"]["CheckVis"]()
end
if v["Type"] == "Button" and i:match("VapeOptions") and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
v["Type"] = "NewToggle"
end
if (v["Type"] == "Button" or v["Type"] == "Toggle") and v["Enabled"] and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Api"]["ToggleButton"](false)
if v["Keybind"] ~= "" then
api["ObjectsThatCanBeSaved"][i]["Api"]["Keybind"] = v["Keybind"]
end
end
if v["Type"] == "NewToggle" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Api"]["ToggleButton"](v["Enabled"])
end
if v["Type"] == "Dropdown" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Api"]["SetValue"](v["Value"])
end
if v["Type"] == "OptionsButton" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
if v["Enabled"] then
api["ObjectsThatCanBeSaved"][i]["Api"]["ToggleButton"](false)
end
if v["Expanded"] then
api["ObjectsThatCanBeSaved"][i]["Api"]["ToggleExpanded"]()
end
if v["Keybind"] ~= "" then
api["ObjectsThatCanBeSaved"][i]["Api"]["Keybind"] = v["Keybind"]
end
end
if v["Type"] == "Slider" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Api"]["SetValue"](v["Value"] < api["ObjectsThatCanBeSaved"][i]["Api"]["Max"] and v["Value"] or api["ObjectsThatCanBeSaved"][i]["Api"]["Max"])
api["ObjectsThatCanBeSaved"][i]["Object"].Slider.FillSlider.Size = UDim2.new((v["Value"] < api["ObjectsThatCanBeSaved"][i]["Api"]["Max"] and v["Value"] or api["ObjectsThatCanBeSaved"][i]["Api"]["Max"]) / api["ObjectsThatCanBeSaved"][i]["Api"]["Max"], 0, 1, 0)
end
if v["Type"] == "ColorSlider" and api["findObjectInTable"](api["ObjectsThatCanBeSaved"], i) then
api["ObjectsThatCanBeSaved"][i]["Api"]["SetValue"](v["Value"])
api["ObjectsThatCanBeSaved"][i]["Api"]["SetRainbow"](v["RainbowValue"])
api["ObjectsThatCanBeSaved"][i]["Object"].Slider.ButtonSlider.Position = UDim2.new(v["Value"], -1, 0, 0)
end
end
end
end
api["CreateCustomWindow"] = function(name, icon, position, visible)
local windowapi = {}
local windowtitle = Instance.new("TextButton")
windowtitle.AutoButtonColor = false
windowtitle.BackgroundColor3 = Color3.fromRGB(34, 35, 38)
windowtitle.BorderSizePixel = 0
windowtitle.BackgroundTransparency = 0.1
windowtitle.TextSize = 20
windowtitle.Font = Enum.Font.SourceSans
windowtitle.Size = UDim2.new(0, 165, 0, 40)
windowtitle.Visible = false
windowtitle.Position = position
windowtitle.Text = name
windowtitle.TextColor3 = Color3.fromRGB(255, 255, 255)
windowtitle.Name = name
windowtitle.Visible = visible
windowtitle.Parent = hudgui
local iconlabel = Instance.new("TextLabel")
iconlabel.Active = false
iconlabel.Font = Enum.Font.SourceSans
iconlabel.Size = UDim2.new(0, 36, 0, 39)
iconlabel.TextSize = 24
iconlabel.Text = icon
iconlabel.Name = "IconLabel"
iconlabel.BackgroundTransparency = 1
iconlabel.TextColor3 = Color3.new(1, 1, 1)
iconlabel.Parent = windowtitle
local expandbutton = Instance.new("TextButton")
expandbutton.Active = true
expandbutton.AutoButtonColor = false
expandbutton.Font = Enum.Font.SourceSans
expandbutton.TextSize = 20
expandbutton.Size = UDim2.new(0, 25, 0, 40)
expandbutton.Position = UDim2.new(1, -25, 0, 0)
expandbutton.Text = "📍"
expandbutton.Name = "PinButton"
expandbutton.BackgroundTransparency = 1
expandbutton.TextTransparency = 0.3
expandbutton.TextColor3 = Color3.new(1, 1, 1)
expandbutton.Parent = windowtitle
dragGUI(windowtitle)
local children = Instance.new("Frame")
children.Name = "Children"
children.Size = UDim2.new(0, 165, 0, 300)
children.Position = UDim2.new(0, 0, 1, 0)
children.BackgroundTransparency = 1
children.Visible = true
children.BorderSizePixel = 0
children.ClipsDescendants = false
children.Parent = windowtitle
windowapi["Pinned"] = false
windowapi["RealVis"] = false
windowapi["CheckVis"] = function()
if windowapi["RealVis"] then
if clickgui.Visible then
windowtitle.Visible = true
windowtitle.Text = name
windowtitle.Size = UDim2.new(0, 165, 0, 40)
iconlabel.Visible = true
expandbutton.Visible = true
else
if windowapi["Pinned"] then
windowtitle.Visible = true
windowtitle.Text = ""
windowtitle.Size = UDim2.new(0, 165, 0, 0)
iconlabel.Visible = false
expandbutton.Visible = false
else
windowtitle.Visible = false
end
end
else
windowtitle.Visible = false
end
end
windowapi["SetVisible"] = function(value)
windowapi["RealVis"] = value
windowapi["CheckVis"]()
end
windowapi["PinnedToggle"] = function()
windowapi["Pinned"] = not windowapi["Pinned"]
if windowapi["Pinned"] then
expandbutton.TextTransparency = 0
else
expandbutton.TextTransparency = 0.3
end
end
clickgui:GetPropertyChangedSignal("Visible"):connect(windowapi["CheckVis"])
windowapi["CheckVis"]()
windowapi["GetCustomChildren"] = function()
return children
end
expandbutton.MouseButton1Click:connect(windowapi["PinnedToggle"])
api["ObjectsThatCanBeSaved"][name.."CustomWindow"] = {["Object"] = windowtitle, ["ChildrenObject"] = children, ["Type"] = "CustomWindow", ["Api"] = windowapi}
return windowapi
end
api["CreateWindow"] = function(name, icon, position, visible)
local windowapi = {}
local windowtitle = Instance.new("TextButton")
windowtitle.AutoButtonColor = false
windowtitle.BackgroundColor3 = Color3.fromRGB(34, 35, 38)
windowtitle.BorderSizePixel = 0
windowtitle.BackgroundTransparency = 0.1
windowtitle.TextSize = 20
windowtitle.Font = Enum.Font.SourceSans
windowtitle.Size = UDim2.new(0, 165, 0, 40)
windowtitle.Position = position
windowtitle.Text = name
windowtitle.TextColor3 = Color3.fromRGB(255, 255, 255)
windowtitle.Name = name
windowtitle.Visible = visible
windowtitle.Parent = clickgui
local iconlabel = Instance.new("TextLabel")
iconlabel.Active = false
iconlabel.Font = Enum.Font.SourceSans
iconlabel.Size = UDim2.new(0, 36, 0, 39)
iconlabel.TextSize = 24
iconlabel.Text = icon
iconlabel.Name = "IconLabel"
iconlabel.BackgroundTransparency = 1
iconlabel.TextColor3 = Color3.new(1, 1, 1)
iconlabel.Parent = windowtitle
local expandbutton = Instance.new("TextButton")
expandbutton.Active = true
expandbutton.AutoButtonColor = false
expandbutton.Font = Enum.Font.SourceSans
expandbutton.TextSize = 20
expandbutton.Size = UDim2.new(0, 25, 0, 40)
expandbutton.Position = UDim2.new(1, -25, 0, 0)
expandbutton.Text = "+"
expandbutton.Name = "ExpandButton"
expandbutton.BackgroundTransparency = 1
expandbutton.TextColor3 = Color3.new(1, 1, 1)
expandbutton.Parent = windowtitle
dragGUI(windowtitle)
local children = Instance.new("ScrollingFrame")
children.Name = "Children"
children.Size = UDim2.new(0, 165, 0, 420)
children.Position = UDim2.new(0, 0, 1, 0)
children.BackgroundTransparency = 1
children.Visible = false
children.BorderSizePixel = 0
children.ScrollBarThickness = 10
children.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
children.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
children.ScrollBarImageTransparency = 0
children.ScrollBarImageColor3 = Color3.new(0, 0, 0)
children.Parent = windowtitle
children.ZIndex = 2
local childrenscrollbarbkg = Instance.new("Frame")
childrenscrollbarbkg.Position = UDim2.new(0, 165, 0, 40)
childrenscrollbarbkg.Size = UDim2.new(0, 10, 0, 420)
childrenscrollbarbkg.BackgroundColor3 = Color3.fromRGB(42, 45, 46)
childrenscrollbarbkg.BackgroundTransparency = 0.1
childrenscrollbarbkg.BorderSizePixel = 0
childrenscrollbarbkg.ZIndex = 1
childrenscrollbarbkg.Visible = false
childrenscrollbarbkg.Parent = windowtitle
api["ObjectsThatCanBeSaved"][name.."Window"] = {["Object"] = windowtitle, ["ChildrenObject"] = children, ["Type"] = "Window", ["Api"] = windowapi}
local uilistlayout = Instance.new("UIListLayout")
uilistlayout.SortOrder = Enum.SortOrder.LayoutOrder
uilistlayout.Parent = children
children.CanvasSize = UDim2.new(0, 0, 0, uilistlayout.AbsoluteContentSize.Y)
uilistlayout:GetPropertyChangedSignal("AbsoluteContentSize"):connect(function()
children.CanvasSize = UDim2.new(0, 0, 0, uilistlayout.AbsoluteContentSize.Y)
if uilistlayout.AbsoluteContentSize.Y >= 420 then
windowtitle.Size = UDim2.new(0, 175, 0, 40)
children.Size = UDim2.new(0, 175, 0, 420)
childrenscrollbarbkg.Visible = true
else
windowtitle.Size = UDim2.new(0, 165, 0, 40)
childrenscrollbarbkg.Visible = false
end
end)
windowapi["SetVisible"] = function(value)
windowtitle.Visible = value
end
windowapi["ExpandToggle"] = function()
children.Visible = not children.Visible
if children.Visible then
expandbutton.Text = "-"
if uilistlayout.AbsoluteContentSize.Y >= 420 then
childrenscrollbarbkg.Visible = true
else
childrenscrollbarbkg.Visible = false
end
else
expandbutton.Text = "+"
childrenscrollbarbkg.Visible = false
end
end
windowtitle.MouseButton2Click:connect(windowapi["ExpandToggle"])
expandbutton.MouseButton1Click:connect(windowapi["ExpandToggle"])
expandbutton.MouseButton2Click:connect(windowapi["ExpandToggle"])
windowapi["CreateButton"] = function(name, temporaryfunction, temporaryfunction2)
local buttonapi = {}
local amount = #children:GetChildren()
local button = Instance.new("TextButton")
button.AutoButtonColor = false
button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
button.BorderSizePixel = 0
button.BackgroundTransparency = 0.275
button.TextSize = 20
button.LayoutOrder = amount
button.Font = Enum.Font.SourceSans
button.Size = UDim2.new(0, 165, 0, 30)
button.Text = name
button.TextColor3 = Color3.fromRGB(255, 255, 255)
button.Name = name
button.Visible = true
button.Parent = children
buttonapi["Enabled"] = false
buttonapi["Keybind"] = ""
buttonapi["ToggleButton"] = function(clicked)
if clicked and holdingshift then
if captured == false then
captured = true
spawn(function()
if buttonapi["Keybind"] ~= "" then
button.Text = "Unbound"
buttonapi["Keybind"] = ""
captured = false
wait(1)
button.Text = name
else
button.Text = "Press a key"
repeat wait() until pressedkey ~= ""
buttonapi["Keybind"] = pressedkey
pressedkey = ""
button.Text = "Bound to "..buttonapi["Keybind"]
captured = false
wait(1)
button.Text = name
end
end)
end
else
buttonapi["Enabled"] = not buttonapi["Enabled"]
if buttonapi["Enabled"] then
button.BackgroundColor3 = Color3.fromHSV(api["Settings"]["GUIObject"]["Color"], 1, 1)
button.BackgroundTransparency = 0
button.TextColor3 = Color3.new(0, 0, 0)
temporaryfunction()
else
button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
button.BackgroundTransparency = 0.275
button.TextColor3 = Color3.new(1, 1, 1)
temporaryfunction2()
end
api["UpdateHudEvent"]:Fire()
end
end
button.MouseButton1Click:connect(function() buttonapi["ToggleButton"](true) end)
api["ObjectsThatCanBeSaved"][name.."Button"] = {["Type"] = "Button", ["Object"] = button, ["Api"] = buttonapi}
return buttonapi
end
windowapi["CreateOptionsButton"] = function(naame, temporaryfunction, temporaryfunction2, expandedmenu, temporaryfunction3, blatantmode)
local buttonapi = {}
local amount = #children:GetChildren()
local button = Instance.new("TextButton")
button.AutoButtonColor = false
button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
button.BorderSizePixel = 0
button.BackgroundTransparency = 0.275
button.TextSize = 20
button.LayoutOrder = amount
button.Font = Enum.Font.SourceSans
button.Size = UDim2.new(0, 145, 0, 30)
button.Text = naame
button.TextColor3 = (blatantmode and Color3.fromRGB(128, 128, 128) or Color3.fromRGB(255, 255, 255))
button.Name = naame
button.Visible = true
button.Parent = children
local button2 = Instance.new("TextButton")
button2.AutoButtonColor = false
button2.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
button2.BorderSizePixel = 0
button2.BackgroundTransparency = 0.275
button2.TextSize = 6
button2.TextColor3 = Color3.new(1, 1, 1)
button2.Size = UDim2.new(0, 20, 0, 30)
button2.Position = UDim2.new(1, 0, 0, 0)
button2.Name = "OptionsButton"
button2.Font = Enum.Font.GothamBold
button2.Parent = button
local visual1 = Instance.new("Frame")
visual1.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
visual1.BorderSizePixel = 0
visual1.BackgroundTransparency = 0.275
visual1.Size = UDim2.new(0, 3, 0, 0)
visual1.Visible = false
visual1.Name = naame.."Children2"
visual1.LayoutOrder = amount
visual1.Parent = children
local visual2 = Instance.new("Frame")
visual2.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
visual2.BorderSizePixel = 0
visual2.BackgroundTransparency = 0.275
visual2.Size = UDim2.new(0, 3, 1, 0)
visual2.Position = UDim2.new(0, 163, 0, 0)
visual2.Visible = true
visual2.LayoutOrder = amount
visual2.Parent = visual1
local children2 = Instance.new("Frame")
children2.BackgroundColor3 = Color3.new(0, 0, 0)
children2.BorderSizePixel = 0
children2.Visible = true
children2.Name = "Children2"
children2.BackgroundTransparency = 0.1
children2.Size = UDim2.new(0, 161, 1, 0)
children2.Position = UDim2.new(0, 2, 0, 0)
children2.Parent = visual1
local uilistlayout2 = Instance.new("UIListLayout")
uilistlayout2.SortOrder = Enum.SortOrder.LayoutOrder
uilistlayout2.Parent = children2
uilistlayout2:GetPropertyChangedSignal("AbsoluteContentSize"):connect(function()
visual1.Size = UDim2.new(0, 4, 0, uilistlayout2.AbsoluteContentSize.Y)
end)
buttonapi["Enabled"] = false
buttonapi["Keybind"] = ""
buttonapi["Bindable"] = true
buttonapi["Name"] = naame
buttonapi["Expanded"] = false
buttonapi["Blatant"] = blatantmode
buttonapi["HasExtraText"] = type(temporaryfunction3) == "function"
buttonapi["GetExtraText"] = (buttonapi["HasExtraText"] and temporaryfunction3 or function() return "" end)
buttonapi["ToggleButton"] = function(clicked, force)
if ((blatantmode and api["Settings"]["GUIObject"]["BlatantMode"] or force) or (not blatantmode)) then
if clicked and holdingshift and buttonapi["Bindable"] then
if captured == false then
captured = true
spawn(function()
if buttonapi["Keybind"] ~= "" then
button.Text = "Unbound"
buttonapi["Keybind"] = ""
captured = false
wait(1)
button.Text = naame
else
button.Text = "Press a key"
repeat wait() until pressedkey ~= ""
buttonapi["Keybind"] = pressedkey
pressedkey = ""
button.Text = "Bound to "..buttonapi["Keybind"]
captured = false
wait(1)
button.Text = naame
end
end)
end
else
buttonapi["Enabled"] = not buttonapi["Enabled"]
api["UpdateHudEvent"]:Fire()
if buttonapi["Enabled"] then
button.BackgroundColor3 = Color3.fromHSV(api["Settings"]["GUIObject"]["Color"], 1, 1)
button.BackgroundTransparency = 0
button.TextColor3 = Color3.new(0, 0, 0)
temporaryfunction()
else
button.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
button.BackgroundTransparency = 0.275
button.TextColor3 = Color3.new(1, 1, 1)
temporaryfunction2()
end
end
end
end
buttonapi["ToggleExpanded"] = function()
buttonapi["Expanded"] = not buttonapi["Expanded"]
visual1.Visible = buttonapi["Expanded"]
if buttonapi["Expanded"] then
button2.BackgroundColor3 = Color3.new(0, 0, 0)
else
button2.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
end
end
if expandedmenu then
button2.Text = "·\n·\n·"
else
button2.Text = ""
buttonapi["ToggleExpanded"] = function() end
end
button.MouseButton1Click:connect(function() buttonapi["ToggleButton"](true) end)
button.MouseButton2Click:connect(buttonapi["ToggleExpanded"])
button2.MouseButton1Click:connect(buttonapi["ToggleExpanded"])
buttonapi["CreateColorSlider"] = function(name, temporaryfunction)
local min, max = 0, 1
local def = math.floor((min + max) / 2)
local defsca = (def - min)/(max - min)
local click = false
local sliderapi = {}
local amount = #children:GetChildren()
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 161, 0, 30)
frame.BackgroundTransparency = 1
frame.LayoutOrder = amount2
frame.BorderSizePixel = 0
frame.Name = name
frame.Parent = children2
local textlabel = Instance.new("TextLabel")
textlabel.Size = UDim2.new(0, 161, 0, 15)
textlabel.BackgroundTransparency = 1
textlabel.Font = Enum.Font.SourceSans
textlabel.TextSize = 16
textlabel.TextColor3 = Color3.new(1, 1, 1)
textlabel.Text = name
textlabel.Parent = frame
local slider1 = Instance.new("TextButton")
slider1.Size = UDim2.new(0, 156, 0, 14)
slider1.BackgroundColor3 = Color3.new(1, 1, 1)
slider1.AutoButtonColor = false
slider1.Text = ""
slider1.BorderSizePixel = 0
slider1.Position = UDim2.new(0, 3, 0, 16)
slider1.Name = "Slider"
slider1.Parent = frame
local uigradient = Instance.new("UIGradient")
uigradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromHSV(0, 1, 1)), ColorSequenceKeypoint.new(0.1, Color3.fromHSV(0.1, 1, 1)), ColorSequenceKeypoint.new(0.2, Color3.fromHSV(0.2, 1, 1)), ColorSequenceKeypoint.new(0.3, Color3.fromHSV(0.3, 1, 1)), ColorSequenceKeypoint.new(0.4, Color3.fromHSV(0.4, 1, 1)), ColorSequenceKeypoint.new(0.5, Color3.fromHSV(0.5, 1, 1)), ColorSequenceKeypoint.new(0.6, Color3.fromHSV(0.6, 1, 1)), ColorSequenceKeypoint.new(0.7, Color3.fromHSV(0.7, 1, 1)), ColorSequenceKeypoint.new(0.8, Color3.fromHSV(0.8, 1, 1)), ColorSequenceKeypoint.new(0.9, Color3.fromHSV(0.9, 1, 1)), ColorSequenceKeypoint.new(1, Color3.fromHSV(1, 1, 1))})
uigradient.Parent = slider1
local slider3 = Instance.new("Frame")
slider3.Size = UDim2.new(0, 2, 0, 14)
slider3.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
slider3.Position = UDim2.new(0.44,-1,0,0)
slider3.Parent = slider1
slider3.BorderSizePixel = 0
slider3.Name = "ButtonSlider"
sliderapi["Value"] = 0.44
sliderapi["RainbowValue"] = false
sliderapi["SetValue"] = function(val)
val = math.clamp(val, min, max)
sliderapi["Value"] = val
slider3.Position = UDim2.new(val, -1, 0, 0)
temporaryfunction(val)
end
sliderapi["SetRainbow"] = function(val)
sliderapi["RainbowValue"] = val
if sliderapi["RainbowValue"] then
local heh
heh = coroutine.resume(coroutine.create(function()
repeat
wait()
if sliderapi["RainbowValue"] then
sliderapi["SetValue"](rainbowvalue)
else
coroutine.yield(heh)
end
until sliderapi["RainbowValue"] == false
end))
end
end
slider1.MouseButton1Down:Connect(function()
spawn(function()
click = true
wait(0.3)
click = false
end)
if click then
sliderapi["SetRainbow"](not sliderapi["RainbowValue"])
end
local x,y,xscale,yscale = RelativeXY(slider1, game:GetService("UserInputService"):GetMouseLocation())
sliderapi["SetValue"](min + ((max - min) * xscale))
slider3.Position = UDim2.new(xscale, -1, 0, 0)
local move
local kill
move = game:GetService("UserInputService").InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
local x,y,xscale,yscale = RelativeXY(slider1, game:GetService("UserInputService"):GetMouseLocation())
sliderapi["SetValue"](min + ((max - min) * xscale))
end
end)
kill = game:GetService("UserInputService").InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
capturedslider = {["Type"] = "ColorSlider", ["Object"] = frame, ["Api"] = sliderapi}
move:Disconnect()
kill:Disconnect()
end
end)
end)
api["ObjectsThatCanBeSaved"][naame..name.."SliderColor"] = {["Type"] = "ColorSlider", ["Object"] = frame, ["Api"] = sliderapi}
return sliderapi
end
buttonapi["CreateSlider"] = function(name, min, max, temporaryfunction, defaultvalue)
local def = math.floor((min + max) / 2)
local defsca = (def - min)/(max - min)
local sliderapi = {}
local amount2 = #children2:GetChildren()
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0, 161, 0, 30)
frame.BackgroundTransparency = 1
frame.LayoutOrder = amount2
frame.BorderSizePixel = 0
frame.Name = name
frame.Parent = children2
local textlabel = Instance.new("TextLabel")
textlabel.Size = UDim2.new(0, 161, 0, 15)
textlabel.BackgroundTransparency = 1
textlabel.Font = Enum.Font.SourceSans
textlabel.TextSize = 16
textlabel.TextColor3 = Color3.new(1, 1, 1)
textlabel.Text = " "..name
textlabel.TextXAlignment = Enum.TextXAlignment.Left
textlabel.Parent = frame
local textlabel2 = Instance.new("TextLabel")
textlabel2.Size = UDim2.new(0, 161, 0, 15)
textlabel2.BackgroundTransparency = 1
textlabel2.Font = Enum.Font.SourceSans
textlabel2.TextSize = 16
textlabel2.TextColor3 = Color3.new(1, 1, 1)
textlabel2.Text = tostring((defaultvalue or min)) .. " "
textlabel2.TextXAlignment = Enum.TextXAlignment.Right
textlabel2.Parent = frame
local slider1 = Instance.new("Frame")