forked from WetCheezit/UI-Libs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uwuware.lua
1713 lines (1543 loc) · 58.3 KB
/
uwuware.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 library = {flags = {}, windows = {}, open = true}
--Services
local runService = game:GetService"RunService"
local tweenService = game:GetService"TweenService"
local textService = game:GetService"TextService"
local inputService = game:GetService"UserInputService"
--Locals
local dragging, dragInput, dragStart, startPos, dragObject
local blacklistedKeys = { --add or remove keys if you find the need to
Enum.KeyCode.Unknown,Enum.KeyCode.W,Enum.KeyCode.A,Enum.KeyCode.S,Enum.KeyCode.D,Enum.KeyCode.Slash,Enum.KeyCode.Tab,Enum.KeyCode.Backspace,Enum.KeyCode.Escape
}
local whitelistedMouseinputs = { --add or remove mouse inputs if you find the need to
Enum.UserInputType.MouseButton1,Enum.UserInputType.MouseButton2,Enum.UserInputType.MouseButton3
}
--Functions
local function round(num, bracket)
bracket = bracket or 1
local a = math.floor(num/bracket + (math.sign(num) * 0.5)) * bracket
if a < 0 then
a = a + bracket
end
return a
end
local function keyCheck(x,x1)
for _,v in next, x1 do
if v == x then
return true
end
end
end
local function update(input)
local delta = input.Position - dragStart
local yPos = (startPos.Y.Offset + delta.Y) < -36 and -36 or startPos.Y.Offset + delta.Y
dragObject:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, yPos), "Out", "Quint", 0.1, true)
end
--From: https://devforum.roblox.com/t/how-to-create-a-simple-rainbow-effect-using-tweenService/221849/2
local chromaColor
local rainbowTime = 5
spawn(function()
while wait() do
chromaColor = Color3.fromHSV(tick() % rainbowTime / rainbowTime, 1, 1)
end
end)
function library:Create(class, properties)
properties = typeof(properties) == "table" and properties or {}
local inst = Instance.new(class)
for property, value in next, properties do
inst[property] = value
end
return inst
end
local function createOptionHolder(holderTitle, parent, parentTable, subHolder)
local size = subHolder and 34 or 40
parentTable.main = library:Create("ImageButton", {
LayoutOrder = subHolder and parentTable.position or 0,
Position = UDim2.new(0, 20 + (250 * (parentTable.position or 0)), 0, 20),
Size = UDim2.new(0, 230, 0, size),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(20, 20, 20),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.04,
ClipsDescendants = true,
Parent = parent
})
local round
if not subHolder then
round = library:Create("ImageLabel", {
Size = UDim2.new(1, 0, 0, size),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = parentTable.open and (subHolder and Color3.fromRGB(16, 16, 16) or Color3.fromRGB(10, 10, 10)) or (subHolder and Color3.fromRGB(10, 10, 10) or Color3.fromRGB(6, 6, 6)),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.04,
Parent = parentTable.main
})
end
local title = library:Create("TextLabel", {
Size = UDim2.new(1, 0, 0, size),
BackgroundTransparency = subHolder and 0 or 1,
BackgroundColor3 = Color3.fromRGB(10, 10, 10),
BorderSizePixel = 0,
Text = holderTitle,
TextSize = subHolder and 16 or 17,
Font = Enum.Font.GothamBold,
TextColor3 = Color3.fromRGB(255, 255, 255),
Parent = parentTable.main
})
local closeHolder = library:Create("Frame", {
Position = UDim2.new(1, 0, 0, 0),
Size = UDim2.new(-1, 0, 1, 0),
SizeConstraint = Enum.SizeConstraint.RelativeYY,
BackgroundTransparency = 1,
Parent = title
})
local close = library:Create("ImageLabel", {
AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.new(0.5, 0, 0.5, 0),
Size = UDim2.new(1, -size - 10, 1, -size - 10),
Rotation = parentTable.open and 90 or 180,
BackgroundTransparency = 1,
Image = "rbxassetid://4918373417",
ImageColor3 = parentTable.open and Color3.fromRGB(50, 50, 50) or Color3.fromRGB(30, 30, 30),
ScaleType = Enum.ScaleType.Fit,
Parent = closeHolder
})
parentTable.content = library:Create("Frame", {
Position = UDim2.new(0, 0, 0, size),
Size = UDim2.new(1, 0, 1, -size),
BackgroundTransparency = 1,
Parent = parentTable.main
})
local layout = library:Create("UIListLayout", {
SortOrder = Enum.SortOrder.LayoutOrder,
Parent = parentTable.content
})
layout.Changed:connect(function()
parentTable.content.Size = UDim2.new(1, 0, 0, layout.AbsoluteContentSize.Y)
parentTable.main.Size = #parentTable.options > 0 and parentTable.open and UDim2.new(0, 230, 0, layout.AbsoluteContentSize.Y + size) or UDim2.new(0, 230, 0, size)
end)
if not subHolder then
library:Create("UIPadding", {
Parent = parentTable.content
})
title.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragObject = parentTable.main
dragging = true
dragStart = input.Position
startPos = dragObject.Position
end
end)
title.InputChanged:connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
dragInput = input
end
end)
title.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = false
end
end)
end
closeHolder.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
parentTable.open = not parentTable.open
tweenService:Create(close, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = parentTable.open and 90 or 180, ImageColor3 = parentTable.open and Color3.fromRGB(50, 50, 50) or Color3.fromRGB(30, 30, 30)}):Play()
if subHolder then
tweenService:Create(title, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = parentTable.open and Color3.fromRGB(16, 16, 16) or Color3.fromRGB(10, 10, 10)}):Play()
else
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = parentTable.open and Color3.fromRGB(10, 10, 10) or Color3.fromRGB(6, 6, 6)}):Play()
end
parentTable.main:TweenSize(#parentTable.options > 0 and parentTable.open and UDim2.new(0, 230, 0, layout.AbsoluteContentSize.Y + size) or UDim2.new(0, 230, 0, size), "Out", "Quad", 0.2, true)
end
end)
function parentTable:SetTitle(newTitle)
title.Text = tostring(newTitle)
end
return parentTable
end
local function createLabel(option, parent)
local main = library:Create("TextLabel", {
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 26),
BackgroundTransparency = 1,
Text = " " .. option.text,
TextSize = 17,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = parent.content
})
setmetatable(option, {__newindex = function(t, i, v)
if i == "Text" then
main.Text = " " .. tostring(v)
end
end})
end
function createToggle(option, parent)
local main = library:Create("TextLabel", {
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 31),
BackgroundTransparency = 1,
Text = " " .. option.text,
TextSize = 17,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = parent.content
})
local tickboxOutline = library:Create("ImageLabel", {
Position = UDim2.new(1, -6, 0, 4),
Size = UDim2.new(-1, 10, 1, -10),
SizeConstraint = Enum.SizeConstraint.RelativeYY,
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = option.state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(100, 100, 100),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local tickboxInner = library:Create("ImageLabel", {
Position = UDim2.new(0, 2, 0, 2),
Size = UDim2.new(1, -4, 1, -4),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = option.state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(20, 20, 20),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = tickboxOutline
})
local checkmarkHolder = library:Create("Frame", {
Position = UDim2.new(0, 4, 0, 4),
Size = option.state and UDim2.new(1, -8, 1, -8) or UDim2.new(0, 0, 1, -8),
BackgroundTransparency = 1,
ClipsDescendants = true,
Parent = tickboxOutline
})
local checkmark = library:Create("ImageLabel", {
Size = UDim2.new(1, 0, 1, 0),
SizeConstraint = Enum.SizeConstraint.RelativeYY,
BackgroundTransparency = 1,
Image = "rbxassetid://4919148038",
ImageColor3 = Color3.fromRGB(20, 20, 20),
Parent = checkmarkHolder
})
local inContact
main.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
option:SetState(not option.state)
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not option.state then
tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
end
end
end)
main.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not option.state then
tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
end
end
end)
function option:SetState(state)
library.flags[self.flag] = state
self.state = state
checkmarkHolder:TweenSize(option.state and UDim2.new(1, -8, 1, -8) or UDim2.new(0, 0, 1, -8), "Out", "Quad", 0.2, true)
tweenService:Create(tickboxInner, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = state and Color3.fromRGB(255, 65, 65) or Color3.fromRGB(20, 20, 20)}):Play()
if state then
tweenService:Create(tickboxOutline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
else
if inContact then
tweenService:Create(tickboxOutline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(140, 140, 140)}):Play()
else
tweenService:Create(tickboxOutline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
end
end
self.callback(state)
end
if option.state then
delay(1, function() option.callback(true) end)
end
setmetatable(option, {__newindex = function(t, i, v)
if i == "Text" then
main.Text = " " .. tostring(v)
end
end})
end
function createButton(option, parent)
local main = library:Create("TextLabel", {
ZIndex = 2,
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 34),
BackgroundTransparency = 1,
Text = " " .. option.text,
TextSize = 17,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
Parent = parent.content
})
local round = library:Create("ImageLabel", {
AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.new(0.5, 0, 0.5, 0),
Size = UDim2.new(1, -12, 1, -10),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(40, 40, 40),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local inContact
local clicking
main.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
library.flags[option.flag] = true
clicking = true
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
option.callback()
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
end
end)
main.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
clicking = false
if inContact then
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
else
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
end
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = false
if not clicking then
tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
end
end
end)
end
local function createBind(option, parent)
local binding
local holding
local loop
local text = string.match(option.key, "Mouse") and string.sub(option.key, 1, 5) .. string.sub(option.key, 12, 13) or option.key
local main = library:Create("TextLabel", {
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 33),
BackgroundTransparency = 1,
Text = " " .. option.text,
TextSize = 17,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = parent.content
})
local round = library:Create("ImageLabel", {
Position = UDim2.new(1, -6, 0, 4),
Size = UDim2.new(0, -textService:GetTextSize(text, 16, Enum.Font.Gotham, Vector2.new(9e9, 9e9)).X - 16, 1, -10),
SizeConstraint = Enum.SizeConstraint.RelativeYY,
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(40, 40, 40),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local bindinput = library:Create("TextLabel", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
Text = text,
TextSize = 16,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
Parent = round
})
local inContact
main.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not binding then
tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
end
end
end)
main.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
binding = true
bindinput.Text = "..."
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = false
if not binding then
tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
end
end
end)
inputService.InputBegan:connect(function(input)
if inputService:GetFocusedTextBox() then return end
if (input.KeyCode.Name == option.key or input.UserInputType.Name == option.key) and not binding then
if option.hold then
loop = runService.Heartbeat:connect(function()
if binding then
option.callback(true)
loop:Disconnect()
loop = nil
else
option.callback()
end
end)
else
option.callback()
end
elseif binding then
local key
pcall(function()
if not keyCheck(input.KeyCode, blacklistedKeys) then
key = input.KeyCode
end
end)
pcall(function()
if keyCheck(input.UserInputType, whitelistedMouseinputs) and not key then
key = input.UserInputType
end
end)
key = key or option.key
option:SetKey(key)
end
end)
inputService.InputEnded:connect(function(input)
if input.KeyCode.Name == option.key or input.UserInputType.Name == option.key or input.UserInputType.Name == "MouseMovement" then
if loop then
loop:Disconnect()
loop = nil
option.callback(true)
end
end
end)
function option:SetKey(key)
binding = false
if loop then
loop:Disconnect()
loop = nil
end
self.key = key or self.key
self.key = self.key.Name or self.key
library.flags[self.flag] = self.key
if string.match(self.key, "Mouse") then
bindinput.Text = string.sub(self.key, 1, 5) .. string.sub(self.key, 12, 13)
else
bindinput.Text = self.key
end
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = inContact and Color3.fromRGB(60, 60, 60) or Color3.fromRGB(40, 40, 40)}):Play()
round.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 15, Enum.Font.Gotham, Vector2.new(9e9, 9e9)).X - 16, 1, -10)
end
end
local function createSlider(option, parent)
local main = library:Create("Frame", {
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 50),
BackgroundTransparency = 1,
Parent = parent.content
})
local title = library:Create("TextLabel", {
Position = UDim2.new(0, 0, 0, 4),
Size = UDim2.new(1, 0, 0, 20),
BackgroundTransparency = 1,
Text = " " .. option.text,
TextSize = 17,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = main
})
local slider = library:Create("ImageLabel", {
Position = UDim2.new(0, 10, 0, 34),
Size = UDim2.new(1, -20, 0, 5),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(30, 30, 30),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local fill = library:Create("ImageLabel", {
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(60, 60, 60),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = slider
})
local circle = library:Create("ImageLabel", {
AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 0.5, 0),
SizeConstraint = Enum.SizeConstraint.RelativeYY,
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(60, 60, 60),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 1,
Parent = slider
})
local valueRound = library:Create("ImageLabel", {
Position = UDim2.new(1, -6, 0, 4),
Size = UDim2.new(0, -60, 0, 18),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(40, 40, 40),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local inputvalue = library:Create("TextBox", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
Text = option.value,
TextColor3 = Color3.fromRGB(235, 235, 235),
TextSize = 15,
TextWrapped = true,
Font = Enum.Font.Gotham,
Parent = valueRound
})
if option.min >= 0 then
fill.Size = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 1, 0)
else
fill.Position = UDim2.new((0 - option.min) / (option.max - option.min), 0, 0, 0)
fill.Size = UDim2.new(option.value / (option.max - option.min), 0, 1, 0)
end
local sliding
local inContact
main.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(3.5, 0, 3.5, 0), ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
sliding = true
option:SetValue(option.min + ((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X) * (option.max - option.min))
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not sliding then
tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(2.8, 0, 2.8, 0), ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
end
end
end)
inputService.InputChanged:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement and sliding then
option:SetValue(option.min + ((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X) * (option.max - option.min))
end
end)
main.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
sliding = false
if inContact then
tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(2.8, 0, 2.8, 0), ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
else
tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
end
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = false
inputvalue:ReleaseFocus()
if not sliding then
tweenService:Create(fill, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
end
end
end)
inputvalue.FocusLost:connect(function()
tweenService:Create(circle, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 0, 0, 0), ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
option:SetValue(tonumber(inputvalue.Text) or option.value)
end)
function option:SetValue(value)
value = round(value, option.float)
value = math.clamp(value, self.min, self.max)
circle:TweenPosition(UDim2.new((value - self.min) / (self.max - self.min), 0, 0.5, 0), "Out", "Quad", 0.1, true)
if self.min >= 0 then
fill:TweenSize(UDim2.new((value - self.min) / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
else
fill:TweenPosition(UDim2.new((0 - self.min) / (self.max - self.min), 0, 0, 0), "Out", "Quad", 0.1, true)
fill:TweenSize(UDim2.new(value / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
end
library.flags[self.flag] = value
self.value = value
inputvalue.Text = value
self.callback(value)
end
end
local function createList(option, parent, holder)
local valueCount = 0
local main = library:Create("Frame", {
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 52),
BackgroundTransparency = 1,
Parent = parent.content
})
local round = library:Create("ImageLabel", {
Position = UDim2.new(0, 6, 0, 4),
Size = UDim2.new(1, -12, 1, -10),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(40, 40, 40),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local title = library:Create("TextLabel", {
Position = UDim2.new(0, 12, 0, 8),
Size = UDim2.new(1, -24, 0, 14),
BackgroundTransparency = 1,
Text = option.text,
TextSize = 14,
Font = Enum.Font.GothamBold,
TextColor3 = Color3.fromRGB(140, 140, 140),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = main
})
local listvalue = library:Create("TextLabel", {
Position = UDim2.new(0, 12, 0, 20),
Size = UDim2.new(1, -24, 0, 24),
BackgroundTransparency = 1,
Text = option.value,
TextSize = 18,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = main
})
library:Create("ImageLabel", {
Position = UDim2.new(1, -16, 0, 16),
Size = UDim2.new(-1, 32, 1, -32),
SizeConstraint = Enum.SizeConstraint.RelativeYY,
Rotation = 90,
BackgroundTransparency = 1,
Image = "rbxassetid://4918373417",
ImageColor3 = Color3.fromRGB(140, 140, 140),
ScaleType = Enum.ScaleType.Fit,
Parent = round
})
option.mainHolder = library:Create("ImageButton", {
ZIndex = 3,
Size = UDim2.new(0, 240, 0, 52),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageTransparency = 1,
ImageColor3 = Color3.fromRGB(30, 30, 30),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Visible = false,
Parent = library.base
})
local content = library:Create("ScrollingFrame", {
ZIndex = 3,
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
BorderSizePixel = 0,
ScrollBarImageColor3 = Color3.fromRGB(),
ScrollBarThickness = 0,
ScrollingDirection = Enum.ScrollingDirection.Y,
Parent = option.mainHolder
})
library:Create("UIPadding", {
PaddingTop = UDim.new(0, 6),
Parent = content
})
local layout = library:Create("UIListLayout", {
Parent = content
})
layout.Changed:connect(function()
option.mainHolder.Size = UDim2.new(0, 240, 0, (valueCount > 4 and (4 * 40) or layout.AbsoluteContentSize.Y) + 12)
content.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 12)
end)
local inContact
round.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if library.activePopup then
library.activePopup:Close()
end
local position = main.AbsolutePosition
option.mainHolder.Position = UDim2.new(0, position.X - 5, 0, position.Y - 10)
option.open = true
option.mainHolder.Visible = true
library.activePopup = option
content.ScrollBarThickness = 6
tweenService:Create(option.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {ImageTransparency = 0, Position = UDim2.new(0, position.X - 5, 0, position.Y - 4)}):Play()
tweenService:Create(option.mainHolder, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0.1), {Position = UDim2.new(0, position.X - 5, 0, position.Y + 1)}):Play()
for _,label in next, content:GetChildren() do
if label:IsA"TextLabel" then
tweenService:Create(label, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 0, TextTransparency = 0}):Play()
end
end
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not option.open then
tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
end
end
end)
round.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = false
if not option.open then
tweenService:Create(round, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(40, 40, 40)}):Play()
end
end
end)
function option:AddValue(value)
valueCount = valueCount + 1
local label = library:Create("TextLabel", {
ZIndex = 3,
Size = UDim2.new(1, 0, 0, 40),
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
BorderSizePixel = 0,
Text = " " .. value,
TextSize = 14,
TextTransparency = self.open and 0 or 1,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = content
})
local inContact
local clicking
label.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
clicking = true
tweenService:Create(label, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(10, 10, 10)}):Play()
self:SetValue(value)
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not clicking then
tweenService:Create(label, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(20, 20, 20)}):Play()
end
end
end)
label.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
clicking = false
tweenService:Create(label, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = inContact and Color3.fromRGB(20, 20, 20) or Color3.fromRGB(30, 30, 30)}):Play()
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = false
if not clicking then
tweenService:Create(label, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
end
end
end)
end
if not table.find(option.values, option.value) then
option:AddValue(option.value)
end
for _, value in next, option.values do
option:AddValue(tostring(value))
end
function option:RemoveValue(value)
for _,label in next, content:GetChildren() do
if label:IsA"TextLabel" and label.Text == " " .. value then
label:Destroy()
valueCount = valueCount - 1
break
end
end
if self.value == value then
self:SetValue("")
end
end
function option:SetValue(value)
library.flags[self.flag] = tostring(value)
self.value = tostring(value)
listvalue.Text = self.value
self.callback(value)
end
function option:Close()
library.activePopup = nil
self.open = false
content.ScrollBarThickness = 0
local position = main.AbsolutePosition
tweenService:Create(round, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = inContact and Color3.fromRGB(60, 60, 60) or Color3.fromRGB(40, 40, 40)}):Play()
tweenService:Create(self.mainHolder, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageTransparency = 1, Position = UDim2.new(0, position.X - 5, 0, position.Y -10)}):Play()
for _,label in next, content:GetChildren() do
if label:IsA"TextLabel" then
tweenService:Create(label, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundTransparency = 1, TextTransparency = 1}):Play()
end
end
wait(0.3)
--delay(0.3, function()
if not self.open then
self.mainHolder.Visible = false
end
--end)
end
return option
end
local function createBox(option, parent)
local main = library:Create("Frame", {
LayoutOrder = option.position,
Size = UDim2.new(1, 0, 0, 52),
BackgroundTransparency = 1,
Parent = parent.content
})
local outline = library:Create("ImageLabel", {
Position = UDim2.new(0, 6, 0, 4),
Size = UDim2.new(1, -12, 1, -10),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(60, 60, 60),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = main
})
local round = library:Create("ImageLabel", {
Position = UDim2.new(0, 8, 0, 6),
Size = UDim2.new(1, -16, 1, -14),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageColor3 = Color3.fromRGB(20, 20, 20),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.01,
Parent = main
})
local title = library:Create("TextLabel", {
Position = UDim2.new(0, 12, 0, 8),
Size = UDim2.new(1, -24, 0, 14),
BackgroundTransparency = 1,
Text = option.text,
TextSize = 14,
Font = Enum.Font.GothamBold,
TextColor3 = Color3.fromRGB(100, 100, 100),
TextXAlignment = Enum.TextXAlignment.Left,
Parent = main
})
local inputvalue = library:Create("TextBox", {
Position = UDim2.new(0, 12, 0, 20),
Size = UDim2.new(1, -24, 0, 24),
BackgroundTransparency = 1,
Text = option.value,
TextSize = 18,
Font = Enum.Font.Gotham,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextXAlignment = Enum.TextXAlignment.Left,
TextWrapped = true,
Parent = main
})
local inContact
local focused
main.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if not focused then inputvalue:CaptureFocus() end
end
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = true
if not focused then
tweenService:Create(outline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)}):Play()
end
end
end)
main.InputEnded:connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement then
inContact = false
if not focused then
tweenService:Create(outline, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
end
end
end)
inputvalue.Focused:connect(function()
focused = true
tweenService:Create(outline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 65, 65)}):Play()
end)
inputvalue.FocusLost:connect(function(enter)
focused = false
tweenService:Create(outline, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(60, 60, 60)}):Play()
option:SetValue(inputvalue.Text, enter)
end)
function option:SetValue(value, enter)
library.flags[self.flag] = tostring(value)
self.value = tostring(value)
inputvalue.Text = self.value
self.callback(value, enter)
end
end
local function createColorPickerWindow(option)
option.mainHolder = library:Create("ImageButton", {
ZIndex = 3,
Size = UDim2.new(0, 240, 0, 180),
BackgroundTransparency = 1,
Image = "rbxassetid://3570695787",
ImageTransparency = 1,
ImageColor3 = Color3.fromRGB(30, 30, 30),
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(100, 100, 100, 100),
SliceScale = 0.02,
Parent = library.base
})
local hue, sat, val = Color3.toHSV(option.color)
hue, sat, val = hue == 0 and 1 or hue, sat + 0.005, val - 0.005
local editinghue
local editingsatval
local currentColor = option.color
local previousColors = {[1] = option.color}
local originalColor = option.color
local rainbowEnabled
local rainbowLoop