R

uwuware lib

public
rrixh Apr 04, 2024 Never 57
Clone
Lua uwuware.uiLib 2868 lines (2571 loc) | 93.37 KB
1
-- source: https://v3rmillion.net/showthread.php?tid=1164653
2
3
--LIBRARY START
4
--Services
5
getgenv().runService = game:GetService"RunService"
6
getgenv().textService = game:GetService"TextService"
7
getgenv().inputService = game:GetService"UserInputService"
8
getgenv().tweenService = game:GetService"TweenService"
9
10
if getgenv().library then
11
getgenv().library:Unload()
12
end
13
14
local library = {design = getgenv().design == "kali" and "kali" or "uwuware", tabs = {}, draggable = true, flags = {}, title = "uwuware", open = false, mousestate = inputService.MouseIconEnabled, popup = nil, instances = {}, connections = {}, options = {}, notifications = {}, tabSize = 0, theme = {}, foldername = "uw_configs", fileext = ".uw"}
15
getgenv().library = library
16
17
--Locals
18
local dragging, dragInput, dragStart, startPos, dragObject
19
20
local blacklistedKeys = { --add or remove keys if you find the need to
21
Enum.KeyCode.Unknown,Enum.KeyCode.W,Enum.KeyCode.A,Enum.KeyCode.S,Enum.KeyCode.D,Enum.KeyCode.Slash,Enum.KeyCode.Tab,Enum.KeyCode.Escape
22
}
23
local whitelistedMouseinputs = { --add or remove mouse inputs if you find the need to
24
Enum.UserInputType.MouseButton1,Enum.UserInputType.MouseButton2,Enum.UserInputType.MouseButton3
25
}
26
27
--Functions
28
library.round = function(num, bracket)
29
if typeof(num) == "Vector2" then
30
return Vector2.new(library.round(num.X), library.round(num.Y))
31
elseif typeof(num) == "Vector3" then
32
return Vector3.new(library.round(num.X), library.round(num.Y), library.round(num.Z))
33
elseif typeof(num) == "Color3" then
34
return library.round(num.r * 255), library.round(num.g * 255), library.round(num.b * 255)
35
else
36
return num - num % (bracket or 1);
37
end
38
end
39
40
--From: https://devforum.roblox.com/t/how-to-create-a-simple-rainbow-effect-using-tweenService/221849/2
41
local chromaColor
42
spawn(function()
43
while library and wait() do
44
chromaColor = Color3.fromHSV(tick() % 6 / 6, 1, 1)
45
end
46
end)
47
48
function library:Create(class, properties)
49
properties = properties or {}
50
if not class then return end
51
local a = class == "Square" or class == "Line" or class == "Text" or class == "Quad" or class == "Circle" or class == "Triangle"
52
local t = a and Drawing or Instance
53
local inst = t.new(class)
54
for property, value in next, properties do
55
inst[property] = value
56
end
57
table.insert(self.instances, {object = inst, method = a})
58
return inst
59
end
60
61
function library:AddConnection(connection, name, callback)
62
callback = type(name) == "function" and name or callback
63
connection = connection:connect(callback)
64
if name ~= callback then
65
self.connections[name] = connection
66
else
67
table.insert(self.connections, connection)
68
end
69
return connection
70
end
71
72
function library:Unload()
73
inputService.MouseIconEnabled = self.mousestate
74
for _, c in next, self.connections do
75
c:Disconnect()
76
end
77
for _, i in next, self.instances do
78
if i.method then
79
pcall(function() i.object:Remove() end)
80
else
81
i.object:Destroy()
82
end
83
end
84
for _, o in next, self.options do
85
if o.type == "toggle" then
86
coroutine.resume(coroutine.create(o.SetState, o))
87
end
88
end
89
library = nil
90
getgenv().library = nil
91
end
92
93
function library:LoadConfig(config)
94
if table.find(self:GetConfigs(), config) then
95
local Read, Config = pcall(function() return game:GetService"HttpService":JSONDecode(readfile(self.foldername .. "/" .. config .. self.fileext)) end)
96
Config = Read and Config or {}
97
for _, option in next, self.options do
98
if option.hasInit then
99
if option.type ~= "button" and option.flag and not option.skipflag then
100
if option.type == "toggle" then
101
spawn(function() option:SetState(Config[option.flag] == 1) end)
102
elseif option.type == "color" then
103
if Config[option.flag] then
104
spawn(function() option:SetColor(Config[option.flag]) end)
105
if option.trans then
106
spawn(function() option:SetTrans(Config[option.flag .. " Transparency"]) end)
107
end
108
end
109
elseif option.type == "bind" then
110
spawn(function() option:SetKey(Config[option.flag]) end)
111
else
112
spawn(function() option:SetValue(Config[option.flag]) end)
113
end
114
end
115
end
116
end
117
end
118
end
119
120
function library:SaveConfig(config)
121
local Config = {}
122
if table.find(self:GetConfigs(), config) then
123
Config = game:GetService"HttpService":JSONDecode(readfile(self.foldername .. "/" .. config .. self.fileext))
124
end
125
for _, option in next, self.options do
126
if option.type ~= "button" and option.flag and not option.skipflag then
127
if option.type == "toggle" then
128
Config[option.flag] = option.state and 1 or 0
129
elseif option.type == "color" then
130
Config[option.flag] = {option.color.r, option.color.g, option.color.b}
131
if option.trans then
132
Config[option.flag .. " Transparency"] = option.trans
133
end
134
elseif option.type == "bind" then
135
if option.key ~= "none" then
136
Config[option.flag] = option.key
137
end
138
elseif option.type == "list" then
139
Config[option.flag] = option.value
140
else
141
Config[option.flag] = option.value
142
end
143
end
144
end
145
writefile(self.foldername .. "/" .. config .. self.fileext, game:GetService"HttpService":JSONEncode(Config))
146
end
147
148
function library:GetConfigs()
149
if not isfolder(self.foldername) then
150
makefolder(self.foldername)
151
return {}
152
end
153
local files = {}
154
local a = 0
155
for i,v in next, listfiles(self.foldername) do
156
if v:sub(#v - #self.fileext + 1, #v) == self.fileext then
157
a = a + 1
158
v = v:gsub(self.foldername .. "\\", "")
159
v = v:gsub(self.fileext, "")
160
table.insert(files, a, v)
161
end
162
end
163
return files
164
end
165
166
library.createLabel = function(option, parent)
167
option.main = library:Create("TextLabel", {
168
LayoutOrder = option.position,
169
Position = UDim2.new(0, 6, 0, 0),
170
Size = UDim2.new(1, -12, 0, 24),
171
BackgroundTransparency = 1,
172
TextSize = 15,
173
Font = Enum.Font.Code,
174
TextColor3 = Color3.new(1, 1, 1),
175
TextXAlignment = Enum.TextXAlignment.Left,
176
TextYAlignment = Enum.TextYAlignment.Top,
177
TextWrapped = true,
178
Parent = parent
179
})
180
181
setmetatable(option, {__newindex = function(t, i, v)
182
if i == "Text" then
183
option.main.Text = tostring(v)
184
option.main.Size = UDim2.new(1, -12, 0, textService:GetTextSize(option.main.Text, 15, Enum.Font.Code, Vector2.new(option.main.AbsoluteSize.X, 9e9)).Y + 6)
185
end
186
end})
187
option.Text = option.text
188
end
189
190
library.createDivider = function(option, parent)
191
option.main = library:Create("Frame", {
192
LayoutOrder = option.position,
193
Size = UDim2.new(1, 0, 0, 18),
194
BackgroundTransparency = 1,
195
Parent = parent
196
})
197
198
library:Create("Frame", {
199
AnchorPoint = Vector2.new(0.5, 0.5),
200
Position = UDim2.new(0.5, 0, 0.5, 0),
201
Size = UDim2.new(1, -24, 0, 1),
202
BackgroundColor3 = Color3.fromRGB(60, 60, 60),
203
BorderColor3 = Color3.new(),
204
Parent = option.main
205
})
206
207
option.title = library:Create("TextLabel", {
208
AnchorPoint = Vector2.new(0.5, 0.5),
209
Position = UDim2.new(0.5, 0, 0.5, 0),
210
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
211
BorderSizePixel = 0,
212
TextColor3 = Color3.new(1, 1, 1),
213
TextSize = 15,
214
Font = Enum.Font.Code,
215
TextXAlignment = Enum.TextXAlignment.Center,
216
Parent = option.main
217
})
218
219
setmetatable(option, {__newindex = function(t, i, v)
220
if i == "Text" then
221
if v then
222
option.title.Text = tostring(v)
223
option.title.Size = UDim2.new(0, textService:GetTextSize(option.title.Text, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X + 12, 0, 20)
224
option.main.Size = UDim2.new(1, 0, 0, 18)
225
else
226
option.title.Text = ""
227
option.title.Size = UDim2.new()
228
option.main.Size = UDim2.new(1, 0, 0, 6)
229
end
230
end
231
end})
232
option.Text = option.text
233
end
234
235
library.createToggle = function(option, parent)
236
option.hasInit = true
237
238
option.main = library:Create("Frame", {
239
LayoutOrder = option.position,
240
Size = UDim2.new(1, 0, 0, 20),
241
BackgroundTransparency = 1,
242
Parent = parent
243
})
244
245
local tickbox
246
local tickboxOverlay
247
if option.style then
248
tickbox = library:Create("ImageLabel", {
249
Position = UDim2.new(0, 6, 0, 4),
250
Size = UDim2.new(0, 12, 0, 12),
251
BackgroundTransparency = 1,
252
Image = "rbxassetid://3570695787",
253
ImageColor3 = Color3.new(),
254
Parent = option.main
255
})
256
257
library:Create("ImageLabel", {
258
AnchorPoint = Vector2.new(0.5, 0.5),
259
Position = UDim2.new(0.5, 0, 0.5, 0),
260
Size = UDim2.new(1, -2, 1, -2),
261
BackgroundTransparency = 1,
262
Image = "rbxassetid://3570695787",
263
ImageColor3 = Color3.fromRGB(60, 60, 60),
264
Parent = tickbox
265
})
266
267
library:Create("ImageLabel", {
268
AnchorPoint = Vector2.new(0.5, 0.5),
269
Position = UDim2.new(0.5, 0, 0.5, 0),
270
Size = UDim2.new(1, -6, 1, -6),
271
BackgroundTransparency = 1,
272
Image = "rbxassetid://3570695787",
273
ImageColor3 = Color3.fromRGB(40, 40, 40),
274
Parent = tickbox
275
})
276
277
tickboxOverlay = library:Create("ImageLabel", {
278
AnchorPoint = Vector2.new(0.5, 0.5),
279
Position = UDim2.new(0.5, 0, 0.5, 0),
280
Size = UDim2.new(1, -6, 1, -6),
281
BackgroundTransparency = 1,
282
Image = "rbxassetid://3570695787",
283
ImageColor3 = library.flags["Menu Accent Color"],
284
Visible = option.state,
285
Parent = tickbox
286
})
287
288
library:Create("ImageLabel", {
289
AnchorPoint = Vector2.new(0.5, 0.5),
290
Position = UDim2.new(0.5, 0, 0.5, 0),
291
Size = UDim2.new(1, 0, 1, 0),
292
BackgroundTransparency = 1,
293
Image = "rbxassetid://5941353943",
294
ImageTransparency = 0.6,
295
Parent = tickbox
296
})
297
298
table.insert(library.theme, tickboxOverlay)
299
else
300
tickbox = library:Create("Frame", {
301
Position = UDim2.new(0, 6, 0, 4),
302
Size = UDim2.new(0, 12, 0, 12),
303
BackgroundColor3 = library.flags["Menu Accent Color"],
304
BorderColor3 = Color3.new(),
305
Parent = option.main
306
})
307
308
tickboxOverlay = library:Create("ImageLabel", {
309
Size = UDim2.new(1, 0, 1, 0),
310
BackgroundTransparency = option.state and 1 or 0,
311
BackgroundColor3 = Color3.fromRGB(50, 50, 50),
312
BorderColor3 = Color3.new(),
313
Image = "rbxassetid://4155801252",
314
ImageTransparency = 0.6,
315
ImageColor3 = Color3.new(),
316
Parent = tickbox
317
})
318
319
library:Create("ImageLabel", {
320
Size = UDim2.new(1, 0, 1, 0),
321
BackgroundTransparency = 1,
322
Image = "rbxassetid://2592362371",
323
ImageColor3 = Color3.fromRGB(60, 60, 60),
324
ScaleType = Enum.ScaleType.Slice,
325
SliceCenter = Rect.new(2, 2, 62, 62),
326
Parent = tickbox
327
})
328
329
library:Create("ImageLabel", {
330
Size = UDim2.new(1, -2, 1, -2),
331
Position = UDim2.new(0, 1, 0, 1),
332
BackgroundTransparency = 1,
333
Image = "rbxassetid://2592362371",
334
ImageColor3 = Color3.new(),
335
ScaleType = Enum.ScaleType.Slice,
336
SliceCenter = Rect.new(2, 2, 62, 62),
337
Parent = tickbox
338
})
339
340
table.insert(library.theme, tickbox)
341
end
342
343
option.interest = library:Create("Frame", {
344
Position = UDim2.new(0, 0, 0, 0),
345
Size = UDim2.new(1, 0, 0, 20),
346
BackgroundTransparency = 1,
347
Parent = option.main
348
})
349
350
option.title = library:Create("TextLabel", {
351
Position = UDim2.new(0, 24, 0, 0),
352
Size = UDim2.new(1, 0, 1, 0),
353
BackgroundTransparency = 1,
354
Text = option.text,
355
TextColor3 = option.state and Color3.fromRGB(210, 210, 210) or Color3.fromRGB(180, 180, 180),
356
TextSize = 15,
357
Font = Enum.Font.Code,
358
TextXAlignment = Enum.TextXAlignment.Left,
359
Parent = option.interest
360
})
361
362
option.interest.InputBegan:connect(function(input)
363
if input.UserInputType.Name == "MouseButton1" then
364
option:SetState(not option.state)
365
end
366
if input.UserInputType.Name == "MouseMovement" then
367
if not library.warning and not library.slider then
368
if option.style then
369
tickbox.ImageColor3 = library.flags["Menu Accent Color"]
370
--tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = library.flags["Menu Accent Color"]}):Play()
371
else
372
tickbox.BorderColor3 = library.flags["Menu Accent Color"]
373
tickboxOverlay.BorderColor3 = library.flags["Menu Accent Color"]
374
--tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = library.flags["Menu Accent Color"]}):Play()
375
--tweenService:Create(tickboxOverlay, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = library.flags["Menu Accent Color"]}):Play()
376
end
377
end
378
if option.tip then
379
library.tooltip.Text = option.tip
380
library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
381
end
382
end
383
end)
384
385
option.interest.InputChanged:connect(function(input)
386
if input.UserInputType.Name == "MouseMovement" then
387
if option.tip then
388
library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
389
end
390
end
391
end)
392
393
option.interest.InputEnded:connect(function(input)
394
if input.UserInputType.Name == "MouseMovement" then
395
if option.style then
396
tickbox.ImageColor3 = Color3.new()
397
--tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.new()}):Play()
398
else
399
tickbox.BorderColor3 = Color3.new()
400
tickboxOverlay.BorderColor3 = Color3.new()
401
--tweenService:Create(tickbox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.new()}):Play()
402
--tweenService:Create(tickboxOverlay, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.new()}):Play()
403
end
404
library.tooltip.Position = UDim2.new(2)
405
end
406
end)
407
408
function option:SetState(state, nocallback)
409
state = typeof(state) == "boolean" and state
410
state = state or false
411
library.flags[self.flag] = state
412
self.state = state
413
option.title.TextColor3 = state and Color3.fromRGB(210, 210, 210) or Color3.fromRGB(160, 160, 160)
414
if option.style then
415
tickboxOverlay.Visible = state
416
else
417
tickboxOverlay.BackgroundTransparency = state and 1 or 0
418
end
419
if not nocallback then
420
self.callback(state)
421
end
422
end
423
424
if option.state ~= nil then
425
delay(1, function()
426
if library then
427
option.callback(option.state)
428
end
429
end)
430
end
431
432
setmetatable(option, {__newindex = function(t, i, v)
433
if i == "Text" then
434
option.title.Text = tostring(v)
435
end
436
end})
437
end
438
439
library.createButton = function(option, parent)
440
option.hasInit = true
441
442
option.main = library:Create("Frame", {
443
LayoutOrder = option.position,
444
Size = UDim2.new(1, 0, 0, 28),
445
BackgroundTransparency = 1,
446
Parent = parent
447
})
448
449
option.title = library:Create("TextLabel", {
450
AnchorPoint = Vector2.new(0.5, 1),
451
Position = UDim2.new(0.5, 0, 1, -5),
452
Size = UDim2.new(1, -12, 0, 20),
453
BackgroundColor3 = Color3.fromRGB(50, 50, 50),
454
BorderColor3 = Color3.new(),
455
Text = option.text,
456
TextColor3 = Color3.new(1, 1, 1),
457
TextSize = 15,
458
Font = Enum.Font.Code,
459
Parent = option.main
460
})
461
462
library:Create("ImageLabel", {
463
Size = UDim2.new(1, 0, 1, 0),
464
BackgroundTransparency = 1,
465
Image = "rbxassetid://2592362371",
466
ImageColor3 = Color3.fromRGB(60, 60, 60),
467
ScaleType = Enum.ScaleType.Slice,
468
SliceCenter = Rect.new(2, 2, 62, 62),
469
Parent = option.title
470
})
471
472
library:Create("ImageLabel", {
473
Size = UDim2.new(1, -2, 1, -2),
474
Position = UDim2.new(0, 1, 0, 1),
475
BackgroundTransparency = 1,
476
Image = "rbxassetid://2592362371",
477
ImageColor3 = Color3.new(),
478
ScaleType = Enum.ScaleType.Slice,
479
SliceCenter = Rect.new(2, 2, 62, 62),
480
Parent = option.title
481
})
482
483
library:Create("UIGradient", {
484
Color = ColorSequence.new({
485
ColorSequenceKeypoint.new(0, Color3.fromRGB(180, 180, 180)),
486
ColorSequenceKeypoint.new(1, Color3.fromRGB(253, 253, 253)),
487
}),
488
Rotation = -90,
489
Parent = option.title
490
})
491
492
option.title.InputBegan:connect(function(input)
493
if input.UserInputType.Name == "MouseButton1" then
494
option.callback()
495
if library then
496
library.flags[option.flag] = true
497
end
498
if option.tip then
499
library.tooltip.Text = option.tip
500
library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
501
end
502
end
503
if input.UserInputType.Name == "MouseMovement" then
504
if not library.warning and not library.slider then
505
option.title.BorderColor3 = library.flags["Menu Accent Color"]
506
end
507
end
508
end)
509
510
option.title.InputChanged:connect(function(input)
511
if input.UserInputType.Name == "MouseMovement" then
512
if option.tip then
513
library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
514
end
515
end
516
end)
517
518
option.title.InputEnded:connect(function(input)
519
if input.UserInputType.Name == "MouseMovement" then
520
option.title.BorderColor3 = Color3.new()
521
library.tooltip.Position = UDim2.new(2)
522
end
523
end)
524
end
525
526
library.createBind = function(option, parent)
527
option.hasInit = true
528
529
local binding
530
local holding
531
local Loop
532
533
if option.sub then
534
option.main = option:getMain()
535
else
536
option.main = option.main or library:Create("Frame", {
537
LayoutOrder = option.position,
538
Size = UDim2.new(1, 0, 0, 20),
539
BackgroundTransparency = 1,
540
Parent = parent
541
})
542
543
library:Create("TextLabel", {
544
Position = UDim2.new(0, 6, 0, 0),
545
Size = UDim2.new(1, -12, 1, 0),
546
BackgroundTransparency = 1,
547
Text = option.text,
548
TextSize = 15,
549
Font = Enum.Font.Code,
550
TextColor3 = Color3.fromRGB(210, 210, 210),
551
TextXAlignment = Enum.TextXAlignment.Left,
552
Parent = option.main
553
})
554
end
555
556
local bindinput = library:Create(option.sub and "TextButton" or "TextLabel", {
557
Position = UDim2.new(1, -6 - (option.subpos or 0), 0, option.sub and 2 or 3),
558
SizeConstraint = Enum.SizeConstraint.RelativeYY,
559
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
560
BorderSizePixel = 0,
561
TextSize = 15,
562
Font = Enum.Font.Code,
563
TextColor3 = Color3.fromRGB(160, 160, 160),
564
TextXAlignment = Enum.TextXAlignment.Right,
565
Parent = option.main
566
})
567
568
if option.sub then
569
bindinput.AutoButtonColor = false
570
end
571
572
local interest = option.sub and bindinput or option.main
573
local inContact
574
interest.InputEnded:connect(function(input)
575
if input.UserInputType.Name == "MouseButton1" then
576
binding = true
577
bindinput.Text = "[...]"
578
bindinput.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 16, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 16)
579
bindinput.TextColor3 = library.flags["Menu Accent Color"]
580
end
581
end)
582
583
library:AddConnection(inputService.InputBegan, function(input)
584
if inputService:GetFocusedTextBox() then return end
585
if binding then
586
local key = (table.find(whitelistedMouseinputs, input.UserInputType) and not option.nomouse) and input.UserInputType
587
option:SetKey(key or (not table.find(blacklistedKeys, input.KeyCode)) and input.KeyCode)
588
else
589
if (input.KeyCode.Name == option.key or input.UserInputType.Name == option.key) and not binding then
590
if option.mode == "toggle" then
591
library.flags[option.flag] = not library.flags[option.flag]
592
option.callback(library.flags[option.flag], 0)
593
else
594
library.flags[option.flag] = true
595
if Loop then Loop:Disconnect() option.callback(true, 0) end
596
Loop = library:AddConnection(runService.RenderStepped, function(step)
597
if not inputService:GetFocusedTextBox() then
598
option.callback(nil, step)
599
end
600
end)
601
end
602
end
603
end
604
end)
605
606
library:AddConnection(inputService.InputEnded, function(input)
607
if option.key ~= "none" then
608
if input.KeyCode.Name == option.key or input.UserInputType.Name == option.key then
609
if Loop then
610
Loop:Disconnect()
611
library.flags[option.flag] = false
612
option.callback(true, 0)
613
end
614
end
615
end
616
end)
617
618
function option:SetKey(key)
619
binding = false
620
bindinput.TextColor3 = Color3.fromRGB(160, 160, 160)
621
if Loop then Loop:Disconnect() library.flags[option.flag] = false option.callback(true, 0) end
622
self.key = (key and key.Name) or key or self.key
623
if self.key == "Backspace" then
624
self.key = "none"
625
bindinput.Text = "[NONE]"
626
else
627
local a = self.key
628
if self.key:match"Mouse" then
629
a = self.key:gsub("Button", ""):gsub("Mouse", "M")
630
elseif self.key:match"Shift" or self.key:match"Alt" or self.key:match"Control" then
631
a = self.key:gsub("Left", "L"):gsub("Right", "R")
632
end
633
bindinput.Text = "[" .. a:gsub("Control", "CTRL"):upper() .. "]"
634
end
635
bindinput.Size = UDim2.new(0, -textService:GetTextSize(bindinput.Text, 16, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 16)
636
end
637
option:SetKey()
638
end
639
640
library.createSlider = function(option, parent)
641
option.hasInit = true
642
643
if option.sub then
644
option.main = option:getMain()
645
option.main.Size = UDim2.new(1, 0, 0, 42)
646
else
647
option.main = library:Create("Frame", {
648
LayoutOrder = option.position,
649
Size = UDim2.new(1, 0, 0, option.textpos and 24 or 40),
650
BackgroundTransparency = 1,
651
Parent = parent
652
})
653
end
654
655
option.slider = library:Create("Frame", {
656
Position = UDim2.new(0, 6, 0, (option.sub and 22 or option.textpos and 4 or 20)),
657
Size = UDim2.new(1, -12, 0, 16),
658
BackgroundColor3 = Color3.fromRGB(50, 50, 50),
659
BorderColor3 = Color3.new(),
660
Parent = option.main
661
})
662
663
library:Create("ImageLabel", {
664
Size = UDim2.new(1, 0, 1, 0),
665
BackgroundTransparency = 1,
666
Image = "rbxassetid://2454009026",
667
ImageColor3 = Color3.new(),
668
ImageTransparency = 0.8,
669
Parent = option.slider
670
})
671
672
option.fill = library:Create("Frame", {
673
BackgroundColor3 = library.flags["Menu Accent Color"],
674
BorderSizePixel = 0,
675
Parent = option.slider
676
})
677
678
library:Create("ImageLabel", {
679
Size = UDim2.new(1, 0, 1, 0),
680
BackgroundTransparency = 1,
681
Image = "rbxassetid://2592362371",
682
ImageColor3 = Color3.fromRGB(60, 60, 60),
683
ScaleType = Enum.ScaleType.Slice,
684
SliceCenter = Rect.new(2, 2, 62, 62),
685
Parent = option.slider
686
})
687
688
library:Create("ImageLabel", {
689
Size = UDim2.new(1, -2, 1, -2),
690
Position = UDim2.new(0, 1, 0, 1),
691
BackgroundTransparency = 1,
692
Image = "rbxassetid://2592362371",
693
ImageColor3 = Color3.new(),
694
ScaleType = Enum.ScaleType.Slice,
695
SliceCenter = Rect.new(2, 2, 62, 62),
696
Parent = option.slider
697
})
698
699
option.title = library:Create("TextBox", {
700
Position = UDim2.new((option.sub or option.textpos) and 0.5 or 0, (option.sub or option.textpos) and 0 or 6, 0, 0),
701
Size = UDim2.new(0, 0, 0, (option.sub or option.textpos) and 14 or 18),
702
BackgroundTransparency = 1,
703
Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix,
704
TextSize = (option.sub or option.textpos) and 14 or 15,
705
Font = Enum.Font.Code,
706
TextColor3 = Color3.fromRGB(210, 210, 210),
707
TextXAlignment = Enum.TextXAlignment[(option.sub or option.textpos) and "Center" or "Left"],
708
Parent = (option.sub or option.textpos) and option.slider or option.main
709
})
710
table.insert(library.theme, option.fill)
711
712
library:Create("UIGradient", {
713
Color = ColorSequence.new({
714
ColorSequenceKeypoint.new(0, Color3.fromRGB(115, 115, 115)),
715
ColorSequenceKeypoint.new(1, Color3.new(1, 1, 1)),
716
}),
717
Rotation = -90,
718
Parent = option.fill
719
})
720
721
if option.min >= 0 then
722
option.fill.Size = UDim2.new((option.value - option.min) / (option.max - option.min), 0, 1, 0)
723
else
724
option.fill.Position = UDim2.new((0 - option.min) / (option.max - option.min), 0, 0, 0)
725
option.fill.Size = UDim2.new(option.value / (option.max - option.min), 0, 1, 0)
726
end
727
728
local manualInput
729
option.title.Focused:connect(function()
730
if not manualInput then
731
option.title:ReleaseFocus()
732
option.title.Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix
733
end
734
end)
735
736
option.title.FocusLost:connect(function()
737
option.slider.BorderColor3 = Color3.new()
738
if manualInput then
739
if tonumber(option.title.Text) then
740
option:SetValue(tonumber(option.title.Text))
741
else
742
option.title.Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix
743
end
744
end
745
manualInput = false
746
end)
747
748
local interest = (option.sub or option.textpos) and option.slider or option.main
749
interest.InputBegan:connect(function(input)
750
if input.UserInputType.Name == "MouseButton1" then
751
if inputService:IsKeyDown(Enum.KeyCode.LeftControl) or inputService:IsKeyDown(Enum.KeyCode.RightControl) then
752
manualInput = true
753
option.title:CaptureFocus()
754
else
755
library.slider = option
756
option.slider.BorderColor3 = library.flags["Menu Accent Color"]
757
option:SetValue(option.min + ((input.Position.X - option.slider.AbsolutePosition.X) / option.slider.AbsoluteSize.X) * (option.max - option.min))
758
end
759
end
760
if input.UserInputType.Name == "MouseMovement" then
761
if not library.warning and not library.slider then
762
option.slider.BorderColor3 = library.flags["Menu Accent Color"]
763
end
764
if option.tip then
765
library.tooltip.Text = option.tip
766
library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
767
end
768
end
769
end)
770
771
interest.InputChanged:connect(function(input)
772
if input.UserInputType.Name == "MouseMovement" then
773
if option.tip then
774
library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
775
end
776
end
777
end)
778
779
interest.InputEnded:connect(function(input)
780
if input.UserInputType.Name == "MouseMovement" then
781
library.tooltip.Position = UDim2.new(2)
782
if option ~= library.slider then
783
option.slider.BorderColor3 = Color3.new()
784
--option.fill.BorderColor3 = Color3.new()
785
end
786
end
787
end)
788
789
function option:SetValue(value, nocallback)
790
if typeof(value) ~= "number" then value = 0 end
791
value = library.round(value, option.float)
792
value = math.clamp(value, self.min, self.max)
793
if self.min >= 0 then
794
option.fill:TweenSize(UDim2.new((value - self.min) / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.05, true)
795
else
796
option.fill:TweenPosition(UDim2.new((0 - self.min) / (self.max - self.min), 0, 0, 0), "Out", "Quad", 0.05, true)
797
option.fill:TweenSize(UDim2.new(value / (self.max - self.min), 0, 1, 0), "Out", "Quad", 0.1, true)
798
end
799
library.flags[self.flag] = value
800
self.value = value
801
option.title.Text = (option.text == "nil" and "" or option.text .. ": ") .. option.value .. option.suffix
802
if not nocallback then
803
self.callback(value)
804
end
805
end
806
delay(1, function()
807
if library then
808
option:SetValue(option.value)
809
end
810
end)
811
end
812
813
library.createList = function(option, parent)
814
option.hasInit = true
815
816
if option.sub then
817
option.main = option:getMain()
818
option.main.Size = UDim2.new(1, 0, 0, 48)
819
else
820
option.main = library:Create("Frame", {
821
LayoutOrder = option.position,
822
Size = UDim2.new(1, 0, 0, option.text == "nil" and 30 or 48),
823
BackgroundTransparency = 1,
824
Parent = parent
825
})
826
827
if option.text ~= "nil" then
828
library:Create("TextLabel", {
829
Position = UDim2.new(0, 6, 0, 0),
830
Size = UDim2.new(1, -12, 0, 18),
831
BackgroundTransparency = 1,
832
Text = option.text,
833
TextSize = 15,
834
Font = Enum.Font.Code,
835
TextColor3 = Color3.fromRGB(210, 210, 210),
836
TextXAlignment = Enum.TextXAlignment.Left,
837
Parent = option.main
838
})
839
end
840
end
841
842
local function getMultiText()
843
local s = ""
844
for _, value in next, option.values do
845
s = s .. (option.value[value] and (tostring(value) .. ", ") or "")
846
end
847
return string.sub(s, 1, #s - 2)
848
end
849
850
option.listvalue = library:Create("TextLabel", {
851
Position = UDim2.new(0, 6, 0, (option.text == "nil" and not option.sub) and 4 or 22),
852
Size = UDim2.new(1, -12, 0, 22),
853
BackgroundColor3 = Color3.fromRGB(50, 50, 50),
854
BorderColor3 = Color3.new(),
855
Text = " " .. (typeof(option.value) == "string" and option.value or getMultiText()),
856
TextSize = 15,
857
Font = Enum.Font.Code,
858
TextColor3 = Color3.new(1, 1, 1),
859
TextXAlignment = Enum.TextXAlignment.Left,
860
TextTruncate = Enum.TextTruncate.AtEnd,
861
Parent = option.main
862
})
863
864
library:Create("ImageLabel", {
865
Size = UDim2.new(1, 0, 1, 0),
866
BackgroundTransparency = 1,
867
Image = "rbxassetid://2454009026",
868
ImageColor3 = Color3.new(),
869
ImageTransparency = 0.8,
870
Parent = option.listvalue
871
})
872
873
library:Create("ImageLabel", {
874
Size = UDim2.new(1, 0, 1, 0),
875
BackgroundTransparency = 1,
876
Image = "rbxassetid://2592362371",
877
ImageColor3 = Color3.fromRGB(60, 60, 60),
878
ScaleType = Enum.ScaleType.Slice,
879
SliceCenter = Rect.new(2, 2, 62, 62),
880
Parent = option.listvalue
881
})
882
883
library:Create("ImageLabel", {
884
Size = UDim2.new(1, -2, 1, -2),
885
Position = UDim2.new(0, 1, 0, 1),
886
BackgroundTransparency = 1,
887
Image = "rbxassetid://2592362371",
888
ImageColor3 = Color3.new(),
889
ScaleType = Enum.ScaleType.Slice,
890
SliceCenter = Rect.new(2, 2, 62, 62),
891
Parent = option.listvalue
892
})
893
894
option.arrow = library:Create("ImageLabel", {
895
Position = UDim2.new(1, -16, 0, 7),
896
Size = UDim2.new(0, 8, 0, 8),
897
Rotation = 90,
898
BackgroundTransparency = 1,
899
Image = "rbxassetid://4918373417",
900
ImageColor3 = Color3.new(1, 1, 1),
901
ScaleType = Enum.ScaleType.Fit,
902
ImageTransparency = 0.4,
903
Parent = option.listvalue
904
})
905
906
option.holder = library:Create("TextButton", {
907
ZIndex = 4,
908
BackgroundColor3 = Color3.fromRGB(40, 40, 40),
909
BorderColor3 = Color3.new(),
910
Text = "",
911
AutoButtonColor = false,
912
Visible = false,
913
Parent = library.base
914
})
915
916
option.content = library:Create("ScrollingFrame", {
917
ZIndex = 4,
918
Size = UDim2.new(1, 0, 1, 0),
919
BackgroundTransparency = 1,
920
BorderSizePixel = 0,
921
ScrollBarImageColor3 = Color3.new(),
922
ScrollBarThickness = 3,
923
ScrollingDirection = Enum.ScrollingDirection.Y,
924
VerticalScrollBarInset = Enum.ScrollBarInset.Always,
925
TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
926
BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
927
Parent = option.holder
928
})
929
930
library:Create("ImageLabel", {
931
ZIndex = 4,
932
Size = UDim2.new(1, 0, 1, 0),
933
BackgroundTransparency = 1,
934
Image = "rbxassetid://2592362371",
935
ImageColor3 = Color3.fromRGB(60, 60, 60),
936
ScaleType = Enum.ScaleType.Slice,
937
SliceCenter = Rect.new(2, 2, 62, 62),
938
Parent = option.holder
939
})
940
941
library:Create("ImageLabel", {
942
ZIndex = 4,
943
Size = UDim2.new(1, -2, 1, -2),
944
Position = UDim2.new(0, 1, 0, 1),
945
BackgroundTransparency = 1,
946
Image = "rbxassetid://2592362371",
947
ImageColor3 = Color3.new(),
948
ScaleType = Enum.ScaleType.Slice,
949
SliceCenter = Rect.new(2, 2, 62, 62),
950
Parent = option.holder
951
})
952
953
local layout = library:Create("UIListLayout", {
954
Padding = UDim.new(0, 2),
955
Parent = option.content
956
})
957
958
library:Create("UIPadding", {
959
PaddingTop = UDim.new(0, 4),
960
PaddingLeft = UDim.new(0, 4),
961
Parent = option.content
962
})
963
964
local valueCount = 0
965
layout.Changed:connect(function()
966
option.holder.Size = UDim2.new(0, option.listvalue.AbsoluteSize.X, 0, 8 + (valueCount > option.max and (-2 + (option.max * 22)) or layout.AbsoluteContentSize.Y))
967
option.content.CanvasSize = UDim2.new(0, 0, 0, 8 + layout.AbsoluteContentSize.Y)
968
end)
969
local interest = option.sub and option.listvalue or option.main
970
971
option.listvalue.InputBegan:connect(function(input)
972
if input.UserInputType.Name == "MouseButton1" then
973
if library.popup == option then library.popup:Close() return end
974
if library.popup then
975
library.popup:Close()
976
end
977
option.arrow.Rotation = -90
978
option.open = true
979
option.holder.Visible = true
980
local pos = option.main.AbsolutePosition
981
option.holder.Position = UDim2.new(0, pos.X + 6, 0, pos.Y + ((option.text == "nil" and not option.sub) and 66 or 84))
982
library.popup = option
983
option.listvalue.BorderColor3 = library.flags["Menu Accent Color"]
984
end
985
if input.UserInputType.Name == "MouseMovement" then
986
if not library.warning and not library.slider then
987
option.listvalue.BorderColor3 = library.flags["Menu Accent Color"]
988
end
989
end
990
end)
991
992
option.listvalue.InputEnded:connect(function(input)
993
if input.UserInputType.Name == "MouseMovement" then
994
if not option.open then
995
option.listvalue.BorderColor3 = Color3.new()
996
end
997
end
998
end)
999
1000
interest.InputBegan:connect(function(input)
1001
if input.UserInputType.Name == "MouseMovement" then
1002
if option.tip then
1003
library.tooltip.Text = option.tip
1004
library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
1005
end
1006
end
1007
end)
1008
1009
interest.InputChanged:connect(function(input)
1010
if input.UserInputType.Name == "MouseMovement" then
1011
if option.tip then
1012
library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
1013
end
1014
end
1015
end)
1016
1017
interest.InputEnded:connect(function(input)
1018
if input.UserInputType.Name == "MouseMovement" then
1019
library.tooltip.Position = UDim2.new(2)
1020
end
1021
end)
1022
1023
local selected
1024
function option:AddValue(value, state)
1025
if self.labels[value] then return end
1026
valueCount = valueCount + 1
1027
1028
if self.multiselect then
1029
self.values[value] = state
1030
else
1031
if not table.find(self.values, value) then
1032
table.insert(self.values, value)
1033
end
1034
end
1035
1036
local label = library:Create("TextLabel", {
1037
ZIndex = 4,
1038
Size = UDim2.new(1, 0, 0, 20),
1039
BackgroundTransparency = 1,
1040
Text = value,
1041
TextSize = 15,
1042
Font = Enum.Font.Code,
1043
TextTransparency = self.multiselect and (self.value[value] and 1 or 0) or self.value == value and 1 or 0,
1044
TextColor3 = Color3.fromRGB(210, 210, 210),
1045
TextXAlignment = Enum.TextXAlignment.Left,
1046
Parent = option.content
1047
})
1048
self.labels[value] = label
1049
1050
local labelOverlay = library:Create("TextLabel", {
1051
ZIndex = 4,
1052
Size = UDim2.new(1, 0, 1, 0),
1053
BackgroundTransparency = 0.8,
1054
Text = " " ..value,
1055
TextSize = 15,
1056
Font = Enum.Font.Code,
1057
TextColor3 = library.flags["Menu Accent Color"],
1058
TextXAlignment = Enum.TextXAlignment.Left,
1059
Visible = self.multiselect and self.value[value] or self.value == value,
1060
Parent = label
1061
})
1062
selected = selected or self.value == value and labelOverlay
1063
table.insert(library.theme, labelOverlay)
1064
1065
label.InputBegan:connect(function(input)
1066
if input.UserInputType.Name == "MouseButton1" then
1067
if self.multiselect then
1068
self.value[value] = not self.value[value]
1069
self:SetValue(self.value)
1070
else
1071
self:SetValue(value)
1072
self:Close()
1073
end
1074
end
1075
end)
1076
end
1077
1078
for i, value in next, option.values do
1079
option:AddValue(tostring(typeof(i) == "number" and value or i))
1080
end
1081
1082
function option:RemoveValue(value)
1083
local label = self.labels[value]
1084
if label then
1085
label:Destroy()
1086
self.labels[value] = nil
1087
valueCount = valueCount - 1
1088
if self.multiselect then
1089
self.values[value] = nil
1090
self:SetValue(self.value)
1091
else
1092
table.remove(self.values, table.find(self.values, value))
1093
if self.value == value then
1094
selected = nil
1095
self:SetValue(self.values[1] or "")
1096
end
1097
end
1098
end
1099
end
1100
1101
function option:SetValue(value, nocallback)
1102
if self.multiselect and typeof(value) ~= "table" then
1103
value = {}
1104
for i,v in next, self.values do
1105
value[v] = false
1106
end
1107
end
1108
self.value = typeof(value) == "table" and value or tostring(table.find(self.values, value) and value or self.values[1])
1109
library.flags[self.flag] = self.value
1110
option.listvalue.Text = " " .. (self.multiselect and getMultiText() or self.value)
1111
if self.multiselect then
1112
for name, label in next, self.labels do
1113
label.TextTransparency = self.value[name] and 1 or 0
1114
if label:FindFirstChild"TextLabel" then
1115
label.TextLabel.Visible = self.value[name]
1116
end
1117
end
1118
else
1119
if selected then
1120
selected.TextTransparency = 0
1121
if selected:FindFirstChild"TextLabel" then
1122
selected.TextLabel.Visible = false
1123
end
1124
end
1125
if self.labels[self.value] then
1126
selected = self.labels[self.value]
1127
selected.TextTransparency = 1
1128
if selected:FindFirstChild"TextLabel" then
1129
selected.TextLabel.Visible = true
1130
end
1131
end
1132
end
1133
if not nocallback then
1134
self.callback(self.value)
1135
end
1136
end
1137
delay(1, function()
1138
if library then
1139
option:SetValue(option.value)
1140
end
1141
end)
1142
1143
function option:Close()
1144
library.popup = nil
1145
option.arrow.Rotation = 90
1146
self.open = false
1147
option.holder.Visible = false
1148
option.listvalue.BorderColor3 = Color3.new()
1149
end
1150
1151
return option
1152
end
1153
1154
library.createBox = function(option, parent)
1155
option.hasInit = true
1156
1157
option.main = library:Create("Frame", {
1158
LayoutOrder = option.position,
1159
Size = UDim2.new(1, 0, 0, option.text == "nil" and 28 or 44),
1160
BackgroundTransparency = 1,
1161
Parent = parent
1162
})
1163
1164
if option.text ~= "nil" then
1165
option.title = library:Create("TextLabel", {
1166
Position = UDim2.new(0, 6, 0, 0),
1167
Size = UDim2.new(1, -12, 0, 18),
1168
BackgroundTransparency = 1,
1169
Text = option.text,
1170
TextSize = 15,
1171
Font = Enum.Font.Code,
1172
TextColor3 = Color3.fromRGB(210, 210, 210),
1173
TextXAlignment = Enum.TextXAlignment.Left,
1174
Parent = option.main
1175
})
1176
end
1177
1178
option.holder = library:Create("Frame", {
1179
Position = UDim2.new(0, 6, 0, option.text == "nil" and 4 or 20),
1180
Size = UDim2.new(1, -12, 0, 20),
1181
BackgroundColor3 = Color3.fromRGB(50, 50, 50),
1182
BorderColor3 = Color3.new(),
1183
Parent = option.main
1184
})
1185
1186
library:Create("ImageLabel", {
1187
Size = UDim2.new(1, 0, 1, 0),
1188
BackgroundTransparency = 1,
1189
Image = "rbxassetid://2454009026",
1190
ImageColor3 = Color3.new(),
1191
ImageTransparency = 0.8,
1192
Parent = option.holder
1193
})
1194
1195
library:Create("ImageLabel", {
1196
Size = UDim2.new(1, 0, 1, 0),
1197
BackgroundTransparency = 1,
1198
Image = "rbxassetid://2592362371",
1199
ImageColor3 = Color3.fromRGB(60, 60, 60),
1200
ScaleType = Enum.ScaleType.Slice,
1201
SliceCenter = Rect.new(2, 2, 62, 62),
1202
Parent = option.holder
1203
})
1204
1205
library:Create("ImageLabel", {
1206
Size = UDim2.new(1, -2, 1, -2),
1207
Position = UDim2.new(0, 1, 0, 1),
1208
BackgroundTransparency = 1,
1209
Image = "rbxassetid://2592362371",
1210
ImageColor3 = Color3.new(),
1211
ScaleType = Enum.ScaleType.Slice,
1212
SliceCenter = Rect.new(2, 2, 62, 62),
1213
Parent = option.holder
1214
})
1215
1216
local inputvalue = library:Create("TextBox", {
1217
Position = UDim2.new(0, 4, 0, 0),
1218
Size = UDim2.new(1, -4, 1, 0),
1219
BackgroundTransparency = 1,
1220
Text = " " .. option.value,
1221
TextSize = 15,
1222
Font = Enum.Font.Code,
1223
TextColor3 = Color3.new(1, 1, 1),
1224
TextXAlignment = Enum.TextXAlignment.Left,
1225
TextWrapped = true,
1226
ClearTextOnFocus = false,
1227
Parent = option.holder
1228
})
1229
1230
inputvalue.FocusLost:connect(function(enter)
1231
option.holder.BorderColor3 = Color3.new()
1232
option:SetValue(inputvalue.Text, enter)
1233
end)
1234
1235
inputvalue.Focused:connect(function()
1236
option.holder.BorderColor3 = library.flags["Menu Accent Color"]
1237
end)
1238
1239
inputvalue.InputBegan:connect(function(input)
1240
if input.UserInputType.Name == "MouseButton1" then
1241
inputvalue.Text = ""
1242
end
1243
if input.UserInputType.Name == "MouseMovement" then
1244
if not library.warning and not library.slider then
1245
option.holder.BorderColor3 = library.flags["Menu Accent Color"]
1246
end
1247
if option.tip then
1248
library.tooltip.Text = option.tip
1249
library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
1250
end
1251
end
1252
end)
1253
1254
inputvalue.InputChanged:connect(function(input)
1255
if input.UserInputType.Name == "MouseMovement" then
1256
if option.tip then
1257
library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
1258
end
1259
end
1260
end)
1261
1262
inputvalue.InputEnded:connect(function(input)
1263
if input.UserInputType.Name == "MouseMovement" then
1264
if not inputvalue:IsFocused() then
1265
option.holder.BorderColor3 = Color3.new()
1266
end
1267
library.tooltip.Position = UDim2.new(2)
1268
end
1269
end)
1270
1271
function option:SetValue(value, enter)
1272
if tostring(value) == "" then
1273
inputvalue.Text = self.value
1274
else
1275
library.flags[self.flag] = tostring(value)
1276
self.value = tostring(value)
1277
inputvalue.Text = self.value
1278
self.callback(value, enter)
1279
end
1280
end
1281
delay(1, function()
1282
if library then
1283
option:SetValue(option.value)
1284
end
1285
end)
1286
end
1287
1288
library.createColorPickerWindow = function(option)
1289
option.mainHolder = library:Create("TextButton", {
1290
ZIndex = 4,
1291
--Position = UDim2.new(1, -184, 1, 6),
1292
Size = UDim2.new(0, option.trans and 200 or 184, 0, 264),
1293
BackgroundColor3 = Color3.fromRGB(40, 40, 40),
1294
BorderColor3 = Color3.new(),
1295
AutoButtonColor = false,
1296
Visible = false,
1297
Parent = library.base
1298
})
1299
1300
option.rgbBox = library:Create("Frame", {
1301
Position = UDim2.new(0, 6, 0, 214),
1302
Size = UDim2.new(0, (option.mainHolder.AbsoluteSize.X - 12), 0, 20),
1303
BackgroundColor3 = Color3.fromRGB(57, 57, 57),
1304
BorderColor3 = Color3.new(),
1305
ZIndex = 5;
1306
Parent = option.mainHolder
1307
})
1308
1309
library:Create("ImageLabel", {
1310
Size = UDim2.new(1, 0, 1, 0),
1311
BackgroundTransparency = 1,
1312
Image = "rbxassetid://2454009026",
1313
ImageColor3 = Color3.new(),
1314
ImageTransparency = 0.8,
1315
ZIndex = 6;
1316
Parent = option.rgbBox
1317
})
1318
1319
library:Create("ImageLabel", {
1320
Size = UDim2.new(1, 0, 1, 0),
1321
BackgroundTransparency = 1,
1322
Image = "rbxassetid://2592362371",
1323
ImageColor3 = Color3.fromRGB(60, 60, 60),
1324
ScaleType = Enum.ScaleType.Slice,
1325
SliceCenter = Rect.new(2, 2, 62, 62),
1326
ZIndex = 6;
1327
Parent = option.rgbBox
1328
})
1329
1330
library:Create("ImageLabel", {
1331
Size = UDim2.new(1, -2, 1, -2),
1332
Position = UDim2.new(0, 1, 0, 1),
1333
BackgroundTransparency = 1,
1334
Image = "rbxassetid://2592362371",
1335
ImageColor3 = Color3.new(),
1336
ScaleType = Enum.ScaleType.Slice,
1337
SliceCenter = Rect.new(2, 2, 62, 62),
1338
ZIndex = 6;
1339
Parent = option.rgbBox
1340
})
1341
1342
option.rgbInput = library:Create("TextBox", {
1343
Position = UDim2.new(0, 4, 0, 0),
1344
Size = UDim2.new(1, -4, 1, 0),
1345
BackgroundTransparency = 1,
1346
Text = tostring(option.color),
1347
TextSize = 14,
1348
Font = Enum.Font.Code,
1349
TextColor3 = Color3.new(1, 1, 1),
1350
TextXAlignment = Enum.TextXAlignment.Center,
1351
TextWrapped = true,
1352
ClearTextOnFocus = false,
1353
ZIndex = 6;
1354
Parent = option.rgbBox
1355
})
1356
1357
option.hexBox = option.rgbBox:Clone()
1358
option.hexBox.Position = UDim2.new(0, 6, 0, 238)
1359
-- option.hexBox.Size = UDim2.new(0, (option.mainHolder.AbsoluteSize.X/2 - 10), 0, 20)
1360
option.hexBox.Parent = option.mainHolder
1361
option.hexInput = option.hexBox.TextBox;
1362
1363
library:Create("ImageLabel", {
1364
ZIndex = 4,
1365
Size = UDim2.new(1, 0, 1, 0),
1366
BackgroundTransparency = 1,
1367
Image = "rbxassetid://2592362371",
1368
ImageColor3 = Color3.fromRGB(60, 60, 60),
1369
ScaleType = Enum.ScaleType.Slice,
1370
SliceCenter = Rect.new(2, 2, 62, 62),
1371
Parent = option.mainHolder
1372
})
1373
1374
library:Create("ImageLabel", {
1375
ZIndex = 4,
1376
Size = UDim2.new(1, -2, 1, -2),
1377
Position = UDim2.new(0, 1, 0, 1),
1378
BackgroundTransparency = 1,
1379
Image = "rbxassetid://2592362371",
1380
ImageColor3 = Color3.new(),
1381
ScaleType = Enum.ScaleType.Slice,
1382
SliceCenter = Rect.new(2, 2, 62, 62),
1383
Parent = option.mainHolder
1384
})
1385
1386
local hue, sat, val = Color3.toHSV(option.color)
1387
hue, sat, val = hue == 0 and 1 or hue, sat + 0.005, val - 0.005
1388
local editinghue
1389
local editingsatval
1390
local editingtrans
1391
1392
local transMain
1393
if option.trans then
1394
transMain = library:Create("ImageLabel", {
1395
ZIndex = 5,
1396
Size = UDim2.new(1, 0, 1, 0),
1397
BackgroundTransparency = 1,
1398
Image = "rbxassetid://2454009026",
1399
ImageColor3 = Color3.fromHSV(hue, 1, 1),
1400
Rotation = 180,
1401
Parent = library:Create("ImageLabel", {
1402
ZIndex = 4,
1403
AnchorPoint = Vector2.new(1, 0),
1404
Position = UDim2.new(1, -6, 0, 6),
1405
Size = UDim2.new(0, 10, 1, -60),
1406
BorderColor3 = Color3.new(),
1407
Image = "rbxassetid://4632082392",
1408
ScaleType = Enum.ScaleType.Tile,
1409
TileSize = UDim2.new(0, 5, 0, 5),
1410
Parent = option.mainHolder
1411
})
1412
})
1413
1414
option.transSlider = library:Create("Frame", {
1415
ZIndex = 5,
1416
Position = UDim2.new(0, 0, option.trans, 0),
1417
Size = UDim2.new(1, 0, 0, 2),
1418
BackgroundColor3 = Color3.fromRGB(38, 41, 65),
1419
BorderColor3 = Color3.fromRGB(255, 255, 255),
1420
Parent = transMain
1421
})
1422
1423
transMain.InputBegan:connect(function(Input)
1424
if Input.UserInputType.Name == "MouseButton1" then
1425
editingtrans = true
1426
option:SetTrans(1 - ((Input.Position.Y - transMain.AbsolutePosition.Y) / transMain.AbsoluteSize.Y))
1427
end
1428
end)
1429
1430
transMain.InputEnded:connect(function(Input)
1431
if Input.UserInputType.Name == "MouseButton1" then
1432
editingtrans = false
1433
end
1434
end)
1435
end
1436
1437
local hueMain = library:Create("Frame", {
1438
ZIndex = 4,
1439
AnchorPoint = Vector2.new(0, 1),
1440
Position = UDim2.new(0, 6, 1, -54),
1441
Size = UDim2.new(1, option.trans and -28 or -12, 0, 10),
1442
BackgroundColor3 = Color3.new(1, 1, 1),
1443
BorderColor3 = Color3.new(),
1444
Parent = option.mainHolder
1445
})
1446
1447
local Gradient = library:Create("UIGradient", {
1448
Color = ColorSequence.new({
1449
ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)),
1450
ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 0, 255)),
1451
ColorSequenceKeypoint.new(0.33, Color3.fromRGB(0, 0, 255)),
1452
ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 255, 255)),
1453
ColorSequenceKeypoint.new(0.67, Color3.fromRGB(0, 255, 0)),
1454
ColorSequenceKeypoint.new(0.83, Color3.fromRGB(255, 255, 0)),
1455
ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 0, 0)),
1456
}),
1457
Parent = hueMain
1458
})
1459
1460
local hueSlider = library:Create("Frame", {
1461
ZIndex = 4,
1462
Position = UDim2.new(1 - hue, 0, 0, 0),
1463
Size = UDim2.new(0, 2, 1, 0),
1464
BackgroundColor3 = Color3.fromRGB(38, 41, 65),
1465
BorderColor3 = Color3.fromRGB(255, 255, 255),
1466
Parent = hueMain
1467
})
1468
1469
hueMain.InputBegan:connect(function(Input)
1470
if Input.UserInputType.Name == "MouseButton1" then
1471
editinghue = true
1472
X = (hueMain.AbsolutePosition.X + hueMain.AbsoluteSize.X) - hueMain.AbsolutePosition.X
1473
X = math.clamp((Input.Position.X - hueMain.AbsolutePosition.X) / X, 0, 0.995)
1474
option:SetColor(Color3.fromHSV(1 - X, sat, val))
1475
end
1476
end)
1477
1478
hueMain.InputEnded:connect(function(Input)
1479
if Input.UserInputType.Name == "MouseButton1" then
1480
editinghue = false
1481
end
1482
end)
1483
1484
local satval = library:Create("ImageLabel", {
1485
ZIndex = 4,
1486
Position = UDim2.new(0, 6, 0, 6),
1487
Size = UDim2.new(1, option.trans and -28 or -12, 1, -74),
1488
BackgroundColor3 = Color3.fromHSV(hue, 1, 1),
1489
BorderColor3 = Color3.new(),
1490
Image = "rbxassetid://4155801252",
1491
ClipsDescendants = true,
1492
Parent = option.mainHolder
1493
})
1494
1495
local satvalSlider = library:Create("Frame", {
1496
ZIndex = 4,
1497
AnchorPoint = Vector2.new(0.5, 0.5),
1498
Position = UDim2.new(sat, 0, 1 - val, 0),
1499
Size = UDim2.new(0, 4, 0, 4),
1500
Rotation = 45,
1501
BackgroundColor3 = Color3.fromRGB(255, 255, 255),
1502
Parent = satval
1503
})
1504
1505
satval.InputBegan:connect(function(Input)
1506
if Input.UserInputType.Name == "MouseButton1" then
1507
editingsatval = true
1508
X = (satval.AbsolutePosition.X + satval.AbsoluteSize.X) - satval.AbsolutePosition.X
1509
Y = (satval.AbsolutePosition.Y + satval.AbsoluteSize.Y) - satval.AbsolutePosition.Y
1510
X = math.clamp((Input.Position.X - satval.AbsolutePosition.X) / X, 0.005, 1)
1511
Y = math.clamp((Input.Position.Y - satval.AbsolutePosition.Y) / Y, 0, 0.995)
1512
option:SetColor(Color3.fromHSV(hue, X, 1 - Y))
1513
end
1514
end)
1515
1516
library:AddConnection(inputService.InputChanged, function(Input)
1517
if Input.UserInputType.Name == "MouseMovement" then
1518
if editingsatval then
1519
X = (satval.AbsolutePosition.X + satval.AbsoluteSize.X) - satval.AbsolutePosition.X
1520
Y = (satval.AbsolutePosition.Y + satval.AbsoluteSize.Y) - satval.AbsolutePosition.Y
1521
X = math.clamp((Input.Position.X - satval.AbsolutePosition.X) / X, 0.005, 1)
1522
Y = math.clamp((Input.Position.Y - satval.AbsolutePosition.Y) / Y, 0, 0.995)
1523
option:SetColor(Color3.fromHSV(hue, X, 1 - Y))
1524
elseif editinghue then
1525
X = (hueMain.AbsolutePosition.X + hueMain.AbsoluteSize.X) - hueMain.AbsolutePosition.X
1526
X = math.clamp((Input.Position.X - hueMain.AbsolutePosition.X) / X, 0, 0.995)
1527
option:SetColor(Color3.fromHSV(1 - X, sat, val))
1528
elseif editingtrans then
1529
option:SetTrans(1 - ((Input.Position.Y - transMain.AbsolutePosition.Y) / transMain.AbsoluteSize.Y))
1530
end
1531
end
1532
end)
1533
1534
satval.InputEnded:connect(function(Input)
1535
if Input.UserInputType.Name == "MouseButton1" then
1536
editingsatval = false
1537
end
1538
end)
1539
1540
local r, g, b = library.round(option.color)
1541
option.hexInput.Text = string.format("#%02x%02x%02x", r, g, b)
1542
option.rgbInput.Text = table.concat({r, g, b}, ",")
1543
1544
option.rgbInput.FocusLost:connect(function()
1545
local r, g, b = option.rgbInput.Text:gsub("%s+", ""):match("(%d+),(%d+),(%d+)")
1546
if r and g and b then
1547
local color = Color3.fromRGB(tonumber(r), tonumber(g), tonumber(b))
1548
return option:SetColor(color)
1549
end
1550
1551
local r, g, b = library.round(option.color)
1552
option.rgbInput.Text = table.concat({r, g, b}, ",")
1553
end)
1554
1555
option.hexInput.FocusLost:connect(function()
1556
local r, g, b = option.hexInput.Text:match("#?(..)(..)(..)")
1557
if r and g and b then
1558
local color = Color3.fromRGB(tonumber("0x"..r), tonumber("0x"..g), tonumber("0x"..b))
1559
return option:SetColor(color)
1560
end
1561
1562
local r, g, b = library.round(option.color)
1563
option.hexInput.Text = string.format("#%02x%02x%02x", r, g, b)
1564
end)
1565
1566
function option:updateVisuals(Color)
1567
hue, sat, val = Color3.toHSV(Color)
1568
hue = hue == 0 and 1 or hue
1569
satval.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
1570
if option.trans then
1571
transMain.ImageColor3 = Color3.fromHSV(hue, 1, 1)
1572
end
1573
hueSlider.Position = UDim2.new(1 - hue, 0, 0, 0)
1574
satvalSlider.Position = UDim2.new(sat, 0, 1 - val, 0)
1575
1576
local r, g, b = library.round(Color3.fromHSV(hue, sat, val))
1577
1578
option.hexInput.Text = string.format("#%02x%02x%02x", r, g, b)
1579
option.rgbInput.Text = table.concat({r, g, b}, ",")
1580
end
1581
1582
return option
1583
end
1584
1585
library.createColor = function(option, parent)
1586
option.hasInit = true
1587
1588
if option.sub then
1589
option.main = option:getMain()
1590
else
1591
option.main = library:Create("Frame", {
1592
LayoutOrder = option.position,
1593
Size = UDim2.new(1, 0, 0, 20),
1594
BackgroundTransparency = 1,
1595
Parent = parent
1596
})
1597
1598
option.title = library:Create("TextLabel", {
1599
Position = UDim2.new(0, 6, 0, 0),
1600
Size = UDim2.new(1, -12, 1, 0),
1601
BackgroundTransparency = 1,
1602
Text = option.text,
1603
TextSize = 15,
1604
Font = Enum.Font.Code,
1605
TextColor3 = Color3.fromRGB(210, 210, 210),
1606
TextXAlignment = Enum.TextXAlignment.Left,
1607
Parent = option.main
1608
})
1609
end
1610
1611
option.visualize = library:Create(option.sub and "TextButton" or "Frame", {
1612
Position = UDim2.new(1, -(option.subpos or 0) - 24, 0, 4),
1613
Size = UDim2.new(0, 18, 0, 12),
1614
SizeConstraint = Enum.SizeConstraint.RelativeYY,
1615
BackgroundColor3 = option.color,
1616
BorderColor3 = Color3.new(),
1617
Parent = option.main
1618
})
1619
1620
library:Create("ImageLabel", {
1621
Size = UDim2.new(1, 0, 1, 0),
1622
BackgroundTransparency = 1,
1623
Image = "rbxassetid://2454009026",
1624
ImageColor3 = Color3.new(),
1625
ImageTransparency = 0.6,
1626
Parent = option.visualize
1627
})
1628
1629
library:Create("ImageLabel", {
1630
Size = UDim2.new(1, 0, 1, 0),
1631
BackgroundTransparency = 1,
1632
Image = "rbxassetid://2592362371",
1633
ImageColor3 = Color3.fromRGB(60, 60, 60),
1634
ScaleType = Enum.ScaleType.Slice,
1635
SliceCenter = Rect.new(2, 2, 62, 62),
1636
Parent = option.visualize
1637
})
1638
1639
library:Create("ImageLabel", {
1640
Size = UDim2.new(1, -2, 1, -2),
1641
Position = UDim2.new(0, 1, 0, 1),
1642
BackgroundTransparency = 1,
1643
Image = "rbxassetid://2592362371",
1644
ImageColor3 = Color3.new(),
1645
ScaleType = Enum.ScaleType.Slice,
1646
SliceCenter = Rect.new(2, 2, 62, 62),
1647
Parent = option.visualize
1648
})
1649
1650
local interest = option.sub and option.visualize or option.main
1651
1652
if option.sub then
1653
option.visualize.Text = ""
1654
option.visualize.AutoButtonColor = false
1655
end
1656
1657
interest.InputBegan:connect(function(input)
1658
if input.UserInputType.Name == "MouseButton1" then
1659
if not option.mainHolder then library.createColorPickerWindow(option) end
1660
if library.popup == option then library.popup:Close() return end
1661
if library.popup then library.popup:Close() end
1662
option.open = true
1663
local pos = option.main.AbsolutePosition
1664
option.mainHolder.Position = UDim2.new(0, pos.X + 36 + (option.trans and -16 or 0), 0, pos.Y + 56)
1665
option.mainHolder.Visible = true
1666
library.popup = option
1667
option.visualize.BorderColor3 = library.flags["Menu Accent Color"]
1668
end
1669
if input.UserInputType.Name == "MouseMovement" then
1670
if not library.warning and not library.slider then
1671
option.visualize.BorderColor3 = library.flags["Menu Accent Color"]
1672
end
1673
if option.tip then
1674
library.tooltip.Text = option.tip
1675
library.tooltip.Size = UDim2.new(0, textService:GetTextSize(option.tip, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X, 0, 20)
1676
end
1677
end
1678
end)
1679
1680
interest.InputChanged:connect(function(input)
1681
if input.UserInputType.Name == "MouseMovement" then
1682
if option.tip then
1683
library.tooltip.Position = UDim2.new(0, input.Position.X + 26, 0, input.Position.Y + 36)
1684
end
1685
end
1686
end)
1687
1688
interest.InputEnded:connect(function(input)
1689
if input.UserInputType.Name == "MouseMovement" then
1690
if not option.open then
1691
option.visualize.BorderColor3 = Color3.new()
1692
end
1693
library.tooltip.Position = UDim2.new(2)
1694
end
1695
end)
1696
1697
function option:SetColor(newColor, nocallback)
1698
if typeof(newColor) == "table" then
1699
newColor = Color3.new(newColor[1], newColor[2], newColor[3])
1700
end
1701
newColor = newColor or Color3.new(1, 1, 1)
1702
if self.mainHolder then
1703
self:updateVisuals(newColor)
1704
end
1705
option.visualize.BackgroundColor3 = newColor
1706
library.flags[self.flag] = newColor
1707
self.color = newColor
1708
if not nocallback then
1709
self.callback(newColor)
1710
end
1711
end
1712
1713
if option.trans then
1714
function option:SetTrans(value, manual)
1715
value = math.clamp(tonumber(value) or 0, 0, 1)
1716
if self.transSlider then
1717
self.transSlider.Position = UDim2.new(0, 0, value, 0)
1718
end
1719
self.trans = value
1720
library.flags[self.flag .. " Transparency"] = 1 - value
1721
self.calltrans(value)
1722
end
1723
option:SetTrans(option.trans)
1724
end
1725
1726
delay(1, function()
1727
if library then
1728
option:SetColor(option.color)
1729
end
1730
end)
1731
1732
function option:Close()
1733
library.popup = nil
1734
self.open = false
1735
self.mainHolder.Visible = false
1736
option.visualize.BorderColor3 = Color3.new()
1737
end
1738
end
1739
1740
function library:AddTab(title, pos)
1741
local tab = {canInit = true, tabs = {}, columns = {}, title = tostring(title)}
1742
table.insert(self.tabs, pos or #self.tabs + 1, tab)
1743
1744
function tab:AddColumn()
1745
local column = {sections = {}, position = #self.columns, canInit = true, tab = self}
1746
table.insert(self.columns, column)
1747
1748
function column:AddSection(title)
1749
local section = {title = tostring(title), options = {}, canInit = true, column = self}
1750
table.insert(self.sections, section)
1751
1752
function section:AddLabel(text)
1753
local option = {text = text}
1754
option.section = self
1755
option.type = "label"
1756
option.position = #self.options
1757
option.canInit = true
1758
table.insert(self.options, option)
1759
1760
if library.hasInit and self.hasInit then
1761
library.createLabel(option, self.content)
1762
else
1763
option.Init = library.createLabel
1764
end
1765
1766
return option
1767
end
1768
1769
function section:AddDivider(text)
1770
local option = {text = text}
1771
option.section = self
1772
option.type = "divider"
1773
option.position = #self.options
1774
option.canInit = true
1775
table.insert(self.options, option)
1776
1777
if library.hasInit and self.hasInit then
1778
library.createDivider(option, self.content)
1779
else
1780
option.Init = library.createDivider
1781
end
1782
1783
return option
1784
end
1785
1786
function section:AddToggle(option)
1787
option = typeof(option) == "table" and option or {}
1788
option.section = self
1789
option.text = tostring(option.text)
1790
option.state = option.state == nil and nil or (typeof(option.state) == "boolean" and option.state or false)
1791
option.callback = typeof(option.callback) == "function" and option.callback or function() end
1792
option.type = "toggle"
1793
option.position = #self.options
1794
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
1795
option.subcount = 0
1796
option.canInit = (option.canInit ~= nil and option.canInit) or true
1797
option.tip = option.tip and tostring(option.tip)
1798
option.style = option.style == 2
1799
library.flags[option.flag] = option.state
1800
table.insert(self.options, option)
1801
library.options[option.flag] = option
1802
1803
function option:AddColor(subOption)
1804
subOption = typeof(subOption) == "table" and subOption or {}
1805
subOption.sub = true
1806
subOption.subpos = self.subcount * 24
1807
function subOption:getMain() return option.main end
1808
self.subcount = self.subcount + 1
1809
return section:AddColor(subOption)
1810
end
1811
1812
function option:AddBind(subOption)
1813
subOption = typeof(subOption) == "table" and subOption or {}
1814
subOption.sub = true
1815
subOption.subpos = self.subcount * 24
1816
function subOption:getMain() return option.main end
1817
self.subcount = self.subcount + 1
1818
return section:AddBind(subOption)
1819
end
1820
1821
function option:AddList(subOption)
1822
subOption = typeof(subOption) == "table" and subOption or {}
1823
subOption.sub = true
1824
function subOption:getMain() return option.main end
1825
self.subcount = self.subcount + 1
1826
return section:AddList(subOption)
1827
end
1828
1829
function option:AddSlider(subOption)
1830
subOption = typeof(subOption) == "table" and subOption or {}
1831
subOption.sub = true
1832
function subOption:getMain() return option.main end
1833
self.subcount = self.subcount + 1
1834
return section:AddSlider(subOption)
1835
end
1836
1837
if library.hasInit and self.hasInit then
1838
library.createToggle(option, self.content)
1839
else
1840
option.Init = library.createToggle
1841
end
1842
1843
return option
1844
end
1845
1846
function section:AddButton(option)
1847
option = typeof(option) == "table" and option or {}
1848
option.section = self
1849
option.text = tostring(option.text)
1850
option.callback = typeof(option.callback) == "function" and option.callback or function() end
1851
option.type = "button"
1852
option.position = #self.options
1853
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
1854
option.subcount = 0
1855
option.canInit = (option.canInit ~= nil and option.canInit) or true
1856
option.tip = option.tip and tostring(option.tip)
1857
table.insert(self.options, option)
1858
library.options[option.flag] = option
1859
1860
function option:AddBind(subOption)
1861
subOption = typeof(subOption) == "table" and subOption or {}
1862
subOption.sub = true
1863
subOption.subpos = self.subcount * 24
1864
function subOption:getMain() option.main.Size = UDim2.new(1, 0, 0, 40) return option.main end
1865
self.subcount = self.subcount + 1
1866
return section:AddBind(subOption)
1867
end
1868
1869
function option:AddColor(subOption)
1870
subOption = typeof(subOption) == "table" and subOption or {}
1871
subOption.sub = true
1872
subOption.subpos = self.subcount * 24
1873
function subOption:getMain() option.main.Size = UDim2.new(1, 0, 0, 40) return option.main end
1874
self.subcount = self.subcount + 1
1875
return section:AddColor(subOption)
1876
end
1877
1878
if library.hasInit and self.hasInit then
1879
library.createButton(option, self.content)
1880
else
1881
option.Init = library.createButton
1882
end
1883
1884
return option
1885
end
1886
1887
function section:AddBind(option)
1888
option = typeof(option) == "table" and option or {}
1889
option.section = self
1890
option.text = tostring(option.text)
1891
option.key = (option.key and option.key.Name) or option.key or "none"
1892
option.nomouse = typeof(option.nomouse) == "boolean" and option.nomouse or false
1893
option.mode = typeof(option.mode) == "string" and (option.mode == "toggle" or option.mode == "hold" and option.mode) or "toggle"
1894
option.callback = typeof(option.callback) == "function" and option.callback or function() end
1895
option.type = "bind"
1896
option.position = #self.options
1897
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
1898
option.canInit = (option.canInit ~= nil and option.canInit) or true
1899
option.tip = option.tip and tostring(option.tip)
1900
table.insert(self.options, option)
1901
library.options[option.flag] = option
1902
1903
if library.hasInit and self.hasInit then
1904
library.createBind(option, self.content)
1905
else
1906
option.Init = library.createBind
1907
end
1908
1909
return option
1910
end
1911
1912
function section:AddSlider(option)
1913
option = typeof(option) == "table" and option or {}
1914
option.section = self
1915
option.text = tostring(option.text)
1916
option.min = typeof(option.min) == "number" and option.min or 0
1917
option.max = typeof(option.max) == "number" and option.max or 0
1918
option.value = option.min < 0 and 0 or math.clamp(typeof(option.value) == "number" and option.value or option.min, option.min, option.max)
1919
option.callback = typeof(option.callback) == "function" and option.callback or function() end
1920
option.float = typeof(option.value) == "number" and option.float or 1
1921
option.suffix = option.suffix and tostring(option.suffix) or ""
1922
option.textpos = option.textpos == 2
1923
option.type = "slider"
1924
option.position = #self.options
1925
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
1926
option.subcount = 0
1927
option.canInit = (option.canInit ~= nil and option.canInit) or true
1928
option.tip = option.tip and tostring(option.tip)
1929
library.flags[option.flag] = option.value
1930
table.insert(self.options, option)
1931
library.options[option.flag] = option
1932
1933
function option:AddColor(subOption)
1934
subOption = typeof(subOption) == "table" and subOption or {}
1935
subOption.sub = true
1936
subOption.subpos = self.subcount * 24
1937
function subOption:getMain() return option.main end
1938
self.subcount = self.subcount + 1
1939
return section:AddColor(subOption)
1940
end
1941
1942
function option:AddBind(subOption)
1943
subOption = typeof(subOption) == "table" and subOption or {}
1944
subOption.sub = true
1945
subOption.subpos = self.subcount * 24
1946
function subOption:getMain() return option.main end
1947
self.subcount = self.subcount + 1
1948
return section:AddBind(subOption)
1949
end
1950
1951
if library.hasInit and self.hasInit then
1952
library.createSlider(option, self.content)
1953
else
1954
option.Init = library.createSlider
1955
end
1956
1957
return option
1958
end
1959
1960
function section:AddList(option)
1961
option = typeof(option) == "table" and option or {}
1962
option.section = self
1963
option.text = tostring(option.text)
1964
option.values = typeof(option.values) == "table" and option.values or {}
1965
option.callback = typeof(option.callback) == "function" and option.callback or function() end
1966
option.multiselect = typeof(option.multiselect) == "boolean" and option.multiselect or false
1967
--option.groupbox = (not option.multiselect) and (typeof(option.groupbox) == "boolean" and option.groupbox or false)
1968
option.value = option.multiselect and (typeof(option.value) == "table" and option.value or {}) or tostring(option.value or option.values[1] or "")
1969
if option.multiselect then
1970
for i,v in next, option.values do
1971
option.value[v] = false
1972
end
1973
end
1974
option.max = option.max or 4
1975
option.open = false
1976
option.type = "list"
1977
option.position = #self.options
1978
option.labels = {}
1979
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
1980
option.subcount = 0
1981
option.canInit = (option.canInit ~= nil and option.canInit) or true
1982
option.tip = option.tip and tostring(option.tip)
1983
library.flags[option.flag] = option.value
1984
table.insert(self.options, option)
1985
library.options[option.flag] = option
1986
1987
function option:AddValue(value, state)
1988
if self.multiselect then
1989
self.values[value] = state
1990
else
1991
table.insert(self.values, value)
1992
end
1993
end
1994
1995
function option:AddColor(subOption)
1996
subOption = typeof(subOption) == "table" and subOption or {}
1997
subOption.sub = true
1998
subOption.subpos = self.subcount * 24
1999
function subOption:getMain() return option.main end
2000
self.subcount = self.subcount + 1
2001
return section:AddColor(subOption)
2002
end
2003
2004
function option:AddBind(subOption)
2005
subOption = typeof(subOption) == "table" and subOption or {}
2006
subOption.sub = true
2007
subOption.subpos = self.subcount * 24
2008
function subOption:getMain() return option.main end
2009
self.subcount = self.subcount + 1
2010
return section:AddBind(subOption)
2011
end
2012
2013
if library.hasInit and self.hasInit then
2014
library.createList(option, self.content)
2015
else
2016
option.Init = library.createList
2017
end
2018
2019
return option
2020
end
2021
2022
function section:AddBox(option)
2023
option = typeof(option) == "table" and option or {}
2024
option.section = self
2025
option.text = tostring(option.text)
2026
option.value = tostring(option.value or "")
2027
option.callback = typeof(option.callback) == "function" and option.callback or function() end
2028
option.type = "box"
2029
option.position = #self.options
2030
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
2031
option.canInit = (option.canInit ~= nil and option.canInit) or true
2032
option.tip = option.tip and tostring(option.tip)
2033
library.flags[option.flag] = option.value
2034
table.insert(self.options, option)
2035
library.options[option.flag] = option
2036
2037
if library.hasInit and self.hasInit then
2038
library.createBox(option, self.content)
2039
else
2040
option.Init = library.createBox
2041
end
2042
2043
return option
2044
end
2045
2046
function section:AddColor(option)
2047
option = typeof(option) == "table" and option or {}
2048
option.section = self
2049
option.text = tostring(option.text)
2050
option.color = typeof(option.color) == "table" and Color3.new(option.color[1], option.color[2], option.color[3]) or option.color or Color3.new(1, 1, 1)
2051
option.callback = typeof(option.callback) == "function" and option.callback or function() end
2052
option.calltrans = typeof(option.calltrans) == "function" and option.calltrans or (option.calltrans == 1 and option.callback) or function() end
2053
option.open = false
2054
option.trans = tonumber(option.trans)
2055
option.subcount = 1
2056
option.type = "color"
2057
option.position = #self.options
2058
option.flag = (library.flagprefix and library.flagprefix .. " " or "") .. (option.flag or option.text)
2059
option.canInit = (option.canInit ~= nil and option.canInit) or true
2060
option.tip = option.tip and tostring(option.tip)
2061
library.flags[option.flag] = option.color
2062
table.insert(self.options, option)
2063
library.options[option.flag] = option
2064
2065
function option:AddColor(subOption)
2066
subOption = typeof(subOption) == "table" and subOption or {}
2067
subOption.sub = true
2068
subOption.subpos = self.subcount * 24
2069
function subOption:getMain() return option.main end
2070
self.subcount = self.subcount + 1
2071
return section:AddColor(subOption)
2072
end
2073
2074
if option.trans then
2075
library.flags[option.flag .. " Transparency"] = option.trans
2076
end
2077
2078
if library.hasInit and self.hasInit then
2079
library.createColor(option, self.content)
2080
else
2081
option.Init = library.createColor
2082
end
2083
2084
return option
2085
end
2086
2087
function section:SetTitle(newTitle)
2088
self.title = tostring(newTitle)
2089
if self.titleText then
2090
self.titleText.Text = tostring(newTitle)
2091
end
2092
end
2093
2094
function section:Init()
2095
if self.hasInit then return end
2096
self.hasInit = true
2097
2098
self.main = library:Create("Frame", {
2099
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
2100
BorderColor3 = Color3.new(),
2101
Parent = column.main
2102
})
2103
2104
self.content = library:Create("Frame", {
2105
Size = UDim2.new(1, 0, 1, 0),
2106
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
2107
BorderColor3 = Color3.fromRGB(60, 60, 60),
2108
BorderMode = Enum.BorderMode.Inset,
2109
Parent = self.main
2110
})
2111
2112
library:Create("ImageLabel", {
2113
Size = UDim2.new(1, -2, 1, -2),
2114
Position = UDim2.new(0, 1, 0, 1),
2115
BackgroundTransparency = 1,
2116
Image = "rbxassetid://2592362371",
2117
ImageColor3 = Color3.new(),
2118
ScaleType = Enum.ScaleType.Slice,
2119
SliceCenter = Rect.new(2, 2, 62, 62),
2120
Parent = self.main
2121
})
2122
2123
table.insert(library.theme, library:Create("Frame", {
2124
Size = UDim2.new(1, 0, 0, 1),
2125
BackgroundColor3 = library.flags["Menu Accent Color"],
2126
BorderSizePixel = 0,
2127
BorderMode = Enum.BorderMode.Inset,
2128
Parent = self.main
2129
}))
2130
2131
local layout = library:Create("UIListLayout", {
2132
HorizontalAlignment = Enum.HorizontalAlignment.Center,
2133
SortOrder = Enum.SortOrder.LayoutOrder,
2134
Padding = UDim.new(0, 2),
2135
Parent = self.content
2136
})
2137
2138
library:Create("UIPadding", {
2139
PaddingTop = UDim.new(0, 12),
2140
Parent = self.content
2141
})
2142
2143
self.titleText = library:Create("TextLabel", {
2144
AnchorPoint = Vector2.new(0, 0.5),
2145
Position = UDim2.new(0, 12, 0, 0),
2146
Size = UDim2.new(0, textService:GetTextSize(self.title, 15, Enum.Font.Code, Vector2.new(9e9, 9e9)).X + 10, 0, 3),
2147
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
2148
BorderSizePixel = 0,
2149
Text = self.title,
2150
TextSize = 15,
2151
Font = Enum.Font.Code,
2152
TextColor3 = Color3.new(1, 1, 1),
2153
Parent = self.main
2154
})
2155
2156
layout.Changed:connect(function()
2157
self.main.Size = UDim2.new(1, 0, 0, layout.AbsoluteContentSize.Y + 16)
2158
end)
2159
2160
for _, option in next, self.options do
2161
if option.canInit then
2162
option.Init(option, self.content)
2163
end
2164
end
2165
end
2166
2167
if library.hasInit and self.hasInit then
2168
section:Init()
2169
end
2170
2171
return section
2172
end
2173
2174
function column:Init()
2175
if self.hasInit then return end
2176
self.hasInit = true
2177
2178
self.main = library:Create("ScrollingFrame", {
2179
ZIndex = 2,
2180
Position = UDim2.new(0, 6 + (self.position * 239), 0, 2),
2181
Size = UDim2.new(0, 233, 1, -4),
2182
BackgroundTransparency = 1,
2183
BorderSizePixel = 0,
2184
ScrollBarImageColor3 = Color3.fromRGB(),
2185
ScrollBarThickness = 4,
2186
VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar,
2187
ScrollingDirection = Enum.ScrollingDirection.Y,
2188
Visible = false,
2189
Parent = library.columnHolder
2190
})
2191
2192
local layout = library:Create("UIListLayout", {
2193
HorizontalAlignment = Enum.HorizontalAlignment.Center,
2194
SortOrder = Enum.SortOrder.LayoutOrder,
2195
Padding = UDim.new(0, 12),
2196
Parent = self.main
2197
})
2198
2199
library:Create("UIPadding", {
2200
PaddingTop = UDim.new(0, 8),
2201
PaddingLeft = UDim.new(0, 2),
2202
PaddingRight = UDim.new(0, 2),
2203
Parent = self.main
2204
})
2205
2206
layout.Changed:connect(function()
2207
self.main.CanvasSize = UDim2.new(0, 0, 0, layout.AbsoluteContentSize.Y + 14)
2208
end)
2209
2210
for _, section in next, self.sections do
2211
if section.canInit and #section.options > 0 then
2212
section:Init()
2213
end
2214
end
2215
end
2216
2217
if library.hasInit and self.hasInit then
2218
column:Init()
2219
end
2220
2221
return column
2222
end
2223
2224
function tab:Init()
2225
if self.hasInit then return end
2226
self.hasInit = true
2227
local size = textService:GetTextSize(self.title, 18, Enum.Font.Code, Vector2.new(9e9, 9e9)).X + 10
2228
2229
self.button = library:Create("TextLabel", {
2230
Position = UDim2.new(0, library.tabSize, 0, 22),
2231
Size = UDim2.new(0, size, 0, 30),
2232
BackgroundTransparency = 1,
2233
Text = self.title,
2234
TextColor3 = Color3.new(1, 1, 1),
2235
TextSize = 15,
2236
Font = Enum.Font.Code,
2237
TextWrapped = true,
2238
ClipsDescendants = true,
2239
Parent = library.main
2240
})
2241
library.tabSize = library.tabSize + size
2242
2243
self.button.InputBegan:connect(function(input)
2244
if input.UserInputType.Name == "MouseButton1" then
2245
library:selectTab(self)
2246
end
2247
end)
2248
2249
for _, column in next, self.columns do
2250
if column.canInit then
2251
column:Init()
2252
end
2253
end
2254
end
2255
2256
if self.hasInit then
2257
tab:Init()
2258
end
2259
2260
return tab
2261
end
2262
2263
function library:AddWarning(warning)
2264
warning = typeof(warning) == "table" and warning or {}
2265
warning.text = tostring(warning.text)
2266
warning.type = warning.type == "confirm" and "confirm" or ""
2267
2268
local answer
2269
function warning:Show()
2270
library.warning = warning
2271
if warning.main and warning.type == "" then return end
2272
if library.popup then library.popup:Close() end
2273
if not warning.main then
2274
warning.main = library:Create("TextButton", {
2275
ZIndex = 2,
2276
Size = UDim2.new(1, 0, 1, 0),
2277
BackgroundTransparency = 0.6,
2278
BackgroundColor3 = Color3.new(),
2279
BorderSizePixel = 0,
2280
Text = "",
2281
AutoButtonColor = false,
2282
Parent = library.main
2283
})
2284
2285
warning.message = library:Create("TextLabel", {
2286
ZIndex = 2,
2287
Position = UDim2.new(0, 20, 0.5, -60),
2288
Size = UDim2.new(1, -40, 0, 40),
2289
BackgroundTransparency = 1,
2290
TextSize = 16,
2291
Font = Enum.Font.Code,
2292
TextColor3 = Color3.new(1, 1, 1),
2293
TextWrapped = true,
2294
RichText = true,
2295
Parent = warning.main
2296
})
2297
2298
if warning.type == "confirm" then
2299
local button = library:Create("TextLabel", {
2300
ZIndex = 2,
2301
Position = UDim2.new(0.5, -105, 0.5, -10),
2302
Size = UDim2.new(0, 100, 0, 20),
2303
BackgroundColor3 = Color3.fromRGB(40, 40, 40),
2304
BorderColor3 = Color3.new(),
2305
Text = "Yes",
2306
TextSize = 16,
2307
Font = Enum.Font.Code,
2308
TextColor3 = Color3.new(1, 1, 1),
2309
Parent = warning.main
2310
})
2311
2312
library:Create("ImageLabel", {
2313
ZIndex = 2,
2314
Size = UDim2.new(1, 0, 1, 0),
2315
BackgroundTransparency = 1,
2316
Image = "rbxassetid://2454009026",
2317
ImageColor3 = Color3.new(),
2318
ImageTransparency = 0.8,
2319
Parent = button
2320
})
2321
2322
library:Create("ImageLabel", {
2323
ZIndex = 2,
2324
Size = UDim2.new(1, 0, 1, 0),
2325
BackgroundTransparency = 1,
2326
Image = "rbxassetid://2592362371",
2327
ImageColor3 = Color3.fromRGB(60, 60, 60),
2328
ScaleType = Enum.ScaleType.Slice,
2329
SliceCenter = Rect.new(2, 2, 62, 62),
2330
Parent = button
2331
})
2332
2333
local button1 = library:Create("TextLabel", {
2334
ZIndex = 2,
2335
Position = UDim2.new(0.5, 5, 0.5, -10),
2336
Size = UDim2.new(0, 100, 0, 20),
2337
BackgroundColor3 = Color3.fromRGB(40, 40, 40),
2338
BorderColor3 = Color3.new(),
2339
Text = "No",
2340
TextSize = 16,
2341
Font = Enum.Font.Code,
2342
TextColor3 = Color3.new(1, 1, 1),
2343
Parent = warning.main
2344
})
2345
2346
library:Create("ImageLabel", {
2347
ZIndex = 2,
2348
Size = UDim2.new(1, 0, 1, 0),
2349
BackgroundTransparency = 1,
2350
Image = "rbxassetid://2454009026",
2351
ImageColor3 = Color3.new(),
2352
ImageTransparency = 0.8,
2353
Parent = button1
2354
})
2355
2356
library:Create("ImageLabel", {
2357
ZIndex = 2,
2358
Size = UDim2.new(1, 0, 1, 0),
2359
BackgroundTransparency = 1,
2360
Image = "rbxassetid://2592362371",
2361
ImageColor3 = Color3.fromRGB(60, 60, 60),
2362
ScaleType = Enum.ScaleType.Slice,
2363
SliceCenter = Rect.new(2, 2, 62, 62),
2364
Parent = button1
2365
})
2366
2367
button.InputBegan:connect(function(input)
2368
if input.UserInputType.Name == "MouseButton1" then
2369
answer = true
2370
end
2371
end)
2372
2373
button1.InputBegan:connect(function(input)
2374
if input.UserInputType.Name == "MouseButton1" then
2375
answer = false
2376
end
2377
end)
2378
else
2379
local button = library:Create("TextLabel", {
2380
ZIndex = 2,
2381
Position = UDim2.new(0.5, -50, 0.5, -10),
2382
Size = UDim2.new(0, 100, 0, 20),
2383
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
2384
BorderColor3 = Color3.new(),
2385
Text = "OK",
2386
TextSize = 16,
2387
Font = Enum.Font.Code,
2388
TextColor3 = Color3.new(1, 1, 1),
2389
Parent = warning.main
2390
})
2391
2392
library:Create("ImageLabel", {
2393
ZIndex = 2,
2394
Size = UDim2.new(1, 0, 1, 0),
2395
BackgroundTransparency = 1,
2396
Image = "rbxassetid://2454009026",
2397
ImageColor3 = Color3.new(),
2398
ImageTransparency = 0.8,
2399
Parent = button
2400
})
2401
2402
library:Create("ImageLabel", {
2403
ZIndex = 2,
2404
AnchorPoint = Vector2.new(0.5, 0.5),
2405
Position = UDim2.new(0.5, 0, 0.5, 0),
2406
Size = UDim2.new(1, -2, 1, -2),
2407
BackgroundTransparency = 1,
2408
Image = "rbxassetid://3570695787",
2409
ImageColor3 = Color3.fromRGB(50, 50, 50),
2410
Parent = button
2411
})
2412
2413
button.InputBegan:connect(function(input)
2414
if input.UserInputType.Name == "MouseButton1" then
2415
answer = true
2416
end
2417
end)
2418
end
2419
end
2420
warning.main.Visible = true
2421
warning.message.Text = warning.text
2422
2423
repeat wait()
2424
until answer ~= nil
2425
spawn(warning.Close)
2426
library.warning = nil
2427
return answer
2428
end
2429
2430
function warning:Close()
2431
answer = nil
2432
if not warning.main then return end
2433
warning.main.Visible = false
2434
end
2435
2436
return warning
2437
end
2438
2439
function library:Close()
2440
self.open = not self.open
2441
if self.open then
2442
inputService.MouseIconEnabled = false
2443
else
2444
inputService.MouseIconEnabled = self.mousestate
2445
end
2446
if self.main then
2447
if self.popup then
2448
self.popup:Close()
2449
end
2450
self.main.Visible = self.open
2451
self.cursor.Visible = self.open
2452
self.cursor1.Visible = self.open
2453
end
2454
end
2455
2456
function library:Init()
2457
if self.hasInit then return end
2458
self.hasInit = true
2459
2460
self.base = library:Create("ScreenGui", {IgnoreGuiInset = true, ZIndexBehavior = Enum.ZIndexBehavior.Global})
2461
if runService:IsStudio() then
2462
self.base.Parent = script.Parent.Parent
2463
elseif syn then
2464
pcall(function() syn.protect_gui(self.base) end)
2465
self.base.Parent = game:GetService"CoreGui"
2466
end
2467
2468
self.main = self:Create("ImageButton", {
2469
AutoButtonColor = false,
2470
Position = UDim2.new(0, 100, 0, 46),
2471
Size = UDim2.new(0, 500, 0, 600),
2472
BackgroundColor3 = Color3.fromRGB(20, 20, 20),
2473
BorderColor3 = Color3.new(),
2474
ScaleType = Enum.ScaleType.Tile,
2475
Modal = true,
2476
Visible = false,
2477
Parent = self.base
2478
})
2479
2480
self.top = self:Create("Frame", {
2481
Size = UDim2.new(1, 0, 0, 50),
2482
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
2483
BorderColor3 = Color3.new(),
2484
Parent = self.main
2485
})
2486
2487
self:Create("TextLabel", {
2488
Position = UDim2.new(0, 6, 0, -1),
2489
Size = UDim2.new(0, 0, 0, 20),
2490
BackgroundTransparency = 1,
2491
Text = tostring(self.title),
2492
Font = Enum.Font.Code,
2493
TextSize = 18,
2494
TextColor3 = Color3.new(1, 1, 1),
2495
TextXAlignment = Enum.TextXAlignment.Left,
2496
Parent = self.main
2497
})
2498
2499
table.insert(library.theme, self:Create("Frame", {
2500
Size = UDim2.new(1, 0, 0, 1),
2501
Position = UDim2.new(0, 0, 0, 24),
2502
BackgroundColor3 = library.flags["Menu Accent Color"],
2503
BorderSizePixel = 0,
2504
Parent = self.main
2505
}))
2506
2507
library:Create("ImageLabel", {
2508
Size = UDim2.new(1, 0, 1, 0),
2509
BackgroundTransparency = 1,
2510
Image = "rbxassetid://2454009026",
2511
ImageColor3 = Color3.new(),
2512
ImageTransparency = 0.4,
2513
Parent = top
2514
})
2515
2516
self.tabHighlight = self:Create("Frame", {
2517
BackgroundColor3 = library.flags["Menu Accent Color"],
2518
BorderSizePixel = 0,
2519
Parent = self.main
2520
})
2521
table.insert(library.theme, self.tabHighlight)
2522
2523
self.columnHolder = self:Create("Frame", {
2524
Position = UDim2.new(0, 5, 0, 55),
2525
Size = UDim2.new(1, -10, 1, -60),
2526
BackgroundTransparency = 1,
2527
Parent = self.main
2528
})
2529
2530
self.cursor = self:Create("Triangle", {
2531
Color = Color3.fromRGB(180, 180, 180),
2532
Transparency = 0.6,
2533
})
2534
self.cursor1 = self:Create("Triangle", {
2535
Color = Color3.fromRGB(240, 240, 240),
2536
Transparency = 0.6,
2537
})
2538
2539
self.tooltip = self:Create("TextLabel", {
2540
ZIndex = 2,
2541
BackgroundTransparency = 1,
2542
BorderSizePixel = 0,
2543
TextSize = 15,
2544
Font = Enum.Font.Code,
2545
TextColor3 = Color3.new(1, 1, 1),
2546
Visible = true,
2547
Parent = self.base
2548
})
2549
2550
self:Create("Frame", {
2551
AnchorPoint = Vector2.new(0.5, 0),
2552
Position = UDim2.new(0.5, 0, 0, 0),
2553
Size = UDim2.new(1, 10, 1, 0),
2554
Style = Enum.FrameStyle.RobloxRound,
2555
Parent = self.tooltip
2556
})
2557
2558
self:Create("ImageLabel", {
2559
Size = UDim2.new(1, 0, 1, 0),
2560
BackgroundTransparency = 1,
2561
Image = "rbxassetid://2592362371",
2562
ImageColor3 = Color3.fromRGB(60, 60, 60),
2563
ScaleType = Enum.ScaleType.Slice,
2564
SliceCenter = Rect.new(2, 2, 62, 62),
2565
Parent = self.main
2566
})
2567
2568
self:Create("ImageLabel", {
2569
Size = UDim2.new(1, -2, 1, -2),
2570
Position = UDim2.new(0, 1, 0, 1),
2571
BackgroundTransparency = 1,
2572
Image = "rbxassetid://2592362371",
2573
ImageColor3 = Color3.new(),
2574
ScaleType = Enum.ScaleType.Slice,
2575
SliceCenter = Rect.new(2, 2, 62, 62),
2576
Parent = self.main
2577
})
2578
2579
self.top.InputBegan:connect(function(input)
2580
if input.UserInputType.Name == "MouseButton1" then
2581
dragObject = self.main
2582
dragging = true
2583
dragStart = input.Position
2584
startPos = dragObject.Position
2585
if library.popup then library.popup:Close() end
2586
end
2587
end)
2588
self.top.InputChanged:connect(function(input)
2589
if dragging and input.UserInputType.Name == "MouseMovement" then
2590
dragInput = input
2591
end
2592
end)
2593
self.top.InputEnded:connect(function(input)
2594
if input.UserInputType.Name == "MouseButton1" then
2595
dragging = false
2596
end
2597
end)
2598
2599
function self:selectTab(tab)
2600
if self.currentTab == tab then return end
2601
if library.popup then library.popup:Close() end
2602
if self.currentTab then
2603
self.currentTab.button.TextColor3 = Color3.fromRGB(255, 255, 255)
2604
for _, column in next, self.currentTab.columns do
2605
column.main.Visible = false
2606
end
2607
end
2608
self.main.Size = UDim2.new(0, 16 + ((#tab.columns < 2 and 2 or #tab.columns) * 239), 0, 600)
2609
self.currentTab = tab
2610
tab.button.TextColor3 = library.flags["Menu Accent Color"]
2611
self.tabHighlight:TweenPosition(UDim2.new(0, tab.button.Position.X.Offset, 0, 50), "Out", "Quad", 0.2, true)
2612
self.tabHighlight:TweenSize(UDim2.new(0, tab.button.AbsoluteSize.X, 0, -1), "Out", "Quad", 0.1, true)
2613
for _, column in next, tab.columns do
2614
column.main.Visible = true
2615
end
2616
end
2617
2618
spawn(function()
2619
while library do
2620
wait(1)
2621
local Configs = self:GetConfigs()
2622
for _, config in next, Configs do
2623
if not table.find(self.options["Config List"].values, config) then
2624
self.options["Config List"]:AddValue(config)
2625
end
2626
end
2627
for _, config in next, self.options["Config List"].values do
2628
if not table.find(Configs, config) then
2629
self.options["Config List"]:RemoveValue(config)
2630
end
2631
end
2632
end
2633
end)
2634
2635
for _, tab in next, self.tabs do
2636
if tab.canInit then
2637
tab:Init()
2638
self:selectTab(tab)
2639
end
2640
end
2641
2642
self:AddConnection(inputService.InputEnded, function(input)
2643
if input.UserInputType.Name == "MouseButton1" and self.slider then
2644
self.slider.slider.BorderColor3 = Color3.new()
2645
self.slider = nil
2646
end
2647
end)
2648
2649
self:AddConnection(inputService.InputChanged, function(input)
2650
if not self.open then return end
2651
2652
if input.UserInputType.Name == "MouseMovement" then
2653
if self.cursor then
2654
local mouse = inputService:GetMouseLocation()
2655
local MousePos = Vector2.new(mouse.X, mouse.Y)
2656
self.cursor.PointA = MousePos
2657
self.cursor.PointB = MousePos + Vector2.new(12, 12)
2658
self.cursor.PointC = MousePos + Vector2.new(12, 12)
2659
self.cursor1.PointA = MousePos
2660
self.cursor1.PointB = MousePos + Vector2.new(11, 11)
2661
self.cursor1.PointC = MousePos + Vector2.new(11, 11)
2662
end
2663
if self.slider then
2664
self.slider:SetValue(self.slider.min + ((input.Position.X - self.slider.slider.AbsolutePosition.X) / self.slider.slider.AbsoluteSize.X) * (self.slider.max - self.slider.min))
2665
end
2666
end
2667
if input == dragInput and dragging and library.draggable then
2668
local delta = input.Position - dragStart
2669
local yPos = (startPos.Y.Offset + delta.Y) < -36 and -36 or startPos.Y.Offset + delta.Y
2670
dragObject:TweenPosition(UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, yPos), "Out", "Quint", 0.1, true)
2671
end
2672
end)
2673
2674
local Old_index
2675
Old_index = hookmetamethod(game, "__index", function(t, i)
2676
if checkcaller() then return Old_index(t, i) end
2677
2678
if library and i == "MouseIconEnabled" then
2679
return library.mousestate
2680
end
2681
2682
return Old_index(t, i)
2683
end)
2684
2685
local Old_new
2686
Old_new = hookmetamethod(game, "__newindex", function(t, i, v)
2687
if checkcaller() then return Old_new(t, i, v) end
2688
2689
if library and i == "MouseIconEnabled" then
2690
library.mousestate = v
2691
if library.open then return end
2692
end
2693
2694
return Old_new(t, i, v)
2695
end)
2696
2697
if not getgenv().silent then
2698
delay(1, function() self:Close() end)
2699
end
2700
end
2701
2702
library.SettingsTab = library:AddTab("Settings", 100)
2703
library.SettingsColumn = library.SettingsTab:AddColumn()
2704
library.SettingsColumn1 = library.SettingsTab:AddColumn()
2705
2706
library.SettingsMain = library.SettingsColumn:AddSection"Main"
2707
library.SettingsMain:AddButton({text = "Unload Cheat", nomouse = true, callback = function()
2708
library:Unload()
2709
getgenv().uwuware = nil
2710
end})
2711
library.SettingsMain:AddBind({text = "Panic Key", callback = library.options["Unload Cheat"].callback})
2712
2713
library.SettingsMenu = library.SettingsColumn:AddSection"Menu"
2714
library.SettingsMenu:AddBind({text = "Open / Close", flag = "UI Toggle", nomouse = true, key = "Insert", callback = function() library:Close() end})
2715
library.SettingsMenu:AddColor({text = "Accent Color", flag = "Menu Accent Color", color = Color3.fromRGB(255, 65, 65), callback = function(Color)
2716
if library.currentTab then
2717
library.currentTab.button.TextColor3 = Color
2718
end
2719
for _, obj in next, library.theme do
2720
obj[(obj.ClassName == "TextLabel" and "TextColor3") or (obj.ClassName == "ImageLabel" and "ImageColor3") or "BackgroundColor3"] = Color
2721
end
2722
end})
2723
local Backgrounds = {
2724
["Floral"] = 5553946656,
2725
["Flowers"] = 6071575925,
2726
["Circles"] = 6071579801,
2727
["Hearts"] = 6073763717,
2728
["Polka dots"] = 6214418014,
2729
["Mountains"] = 6214412460,
2730
["Zigzag"] = 6214416834,
2731
["Zigzag 2"] = 6214375242,
2732
["Tartan"] = 6214404863,
2733
["Roses"] = 6214374619,
2734
["Hexagons"] = 6214320051,
2735
["Leopard print"] = 6214318622
2736
}
2737
library.SettingsMenu:AddList({text = "Background", flag = "UI Background", max = 6, values = {"Floral", "Flowers", "Circles", "Hearts", "Polka dots", "Mountains", "Zigzag", "Zigzag 2", "Tartan", "Roses", "Hexagons", "Leopard print"}, callback = function(Value)
2738
if Backgrounds[Value] then
2739
library.main.Image = "rbxassetid://" .. Backgrounds[Value]
2740
end
2741
end}):AddColor({flag = "Menu Background Color", color = Color3.new(), callback = function(Color)
2742
library.main.ImageColor3 = Color
2743
end, trans = 1, calltrans = function(Value)
2744
library.main.ImageTransparency = 1 - Value
2745
end})
2746
library.SettingsMenu:AddSlider({text = "Tile Size", value = 90, min = 50, max = 500, callback = function(Value)
2747
library.main.TileSize = UDim2.new(0, Value, 0, Value)
2748
end})
2749
2750
library.ConfigSection = library.SettingsColumn1:AddSection"Configs"
2751
library.ConfigSection:AddBox({text = "Config Name", skipflag = true})
2752
library.ConfigSection:AddButton({text = "Create", callback = function()
2753
library:GetConfigs()
2754
writefile(library.foldername .. "/" .. library.flags["Config Name"] .. library.fileext, "{}")
2755
library.options["Config List"]:AddValue(library.flags["Config Name"])
2756
end})
2757
library.ConfigWarning = library:AddWarning({type = "confirm"})
2758
library.ConfigSection:AddList({text = "Configs", skipflag = true, value = "", flag = "Config List", values = library:GetConfigs()})
2759
library.ConfigSection:AddButton({text = "Save", callback = function()
2760
local r, g, b = library.round(library.flags["Menu Accent Color"])
2761
library.ConfigWarning.text = "Are you sure you want to save the current settings to config <font color='rgb(" .. r .. "," .. g .. "," .. b .. ")'>" .. library.flags["Config List"] .. "</font>?"
2762
if library.ConfigWarning:Show() then
2763
library:SaveConfig(library.flags["Config List"])
2764
end
2765
end})
2766
library.ConfigSection:AddButton({text = "Load", callback = function()
2767
local r, g, b = library.round(library.flags["Menu Accent Color"])
2768
library.ConfigWarning.text = "Are you sure you want to load config <font color='rgb(" .. r .. "," .. g .. "," .. b .. ")'>" .. library.flags["Config List"] .. "</font>?"
2769
if library.ConfigWarning:Show() then
2770
library:LoadConfig(library.flags["Config List"])
2771
end
2772
end})
2773
library.ConfigSection:AddButton({text = "Delete", callback = function()
2774
local r, g, b = library.round(library.flags["Menu Accent Color"])
2775
library.ConfigWarning.text = "Are you sure you want to delete config <font color='rgb(" .. r .. "," .. g .. "," .. b .. ")'>" .. library.flags["Config List"] .. "</font>?"
2776
if ConfigWarning:Show() then
2777
local Config = library.flags["Config List"]
2778
if table.find(library:GetConfigs(), Config) and isfile(library.foldername .. "/" .. Config .. library.fileext) then
2779
library.options["Config List"]:RemoveValue(Config)
2780
delfile(library.foldername .. "/" .. Config .. library.fileext)
2781
end
2782
end
2783
end})
2784
--LIBRARY END
2785
2786
--custom notification thing, library required for this to work
2787
local LastNotification = 0
2788
function library:SendNotification(duration, message)
2789
LastNotification = LastNotification + tick()
2790
if LastNotification < 0.2 or not library.base then return end
2791
LastNotification = 0
2792
if duration then
2793
duration = tonumber(duration) or 2
2794
duration = duration < 2 and 2 or duration
2795
else
2796
duration = message
2797
end
2798
message = message and tostring(message) or "Empty"
2799
2800
--create the thing
2801
local notification = library:Create("Frame", {
2802
AnchorPoint = Vector2.new(1, 1),
2803
Size = UDim2.new(0, 0, 0, 80),
2804
Position = UDim2.new(1, -5, 1, -5),
2805
BackgroundTransparency = 1,
2806
BackgroundColor3 = Color3.fromRGB(30, 30, 30),
2807
BorderColor3 = Color3.fromRGB(20, 20, 20),
2808
Parent = library.base
2809
})
2810
tweenService:Create(notification, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Size = UDim2.new(0, 240, 0, 80), BackgroundTransparency = 0}):Play()
2811
2812
tweenService:Create(library:Create("TextLabel", {
2813
Position = UDim2.new(0, 5, 0, 25),
2814
Size = UDim2.new(1, -10, 0, 40),
2815
BackgroundTransparency = 1,
2816
Text = tostring(message),
2817
Font = Enum.Font.SourceSans,
2818
TextColor3 = Color3.fromRGB(255, 255, 255),
2819
TextSize = 18,
2820
TextTransparency = 1,
2821
TextWrapped = true,
2822
Parent = notification
2823
}), TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0.3), {TextTransparency = 0}):Play()
2824
2825
--bump existing notifications
2826
for _,notification in next, library.notifications do
2827
notification:TweenPosition(UDim2.new(1, -5, 1, notification.Position.Y.Offset - 85), "Out", "Quad", 0.2)
2828
end
2829
library.notifications[notification] = notification
2830
2831
wait(0.4)
2832
2833
--create other things
2834
library:Create("Frame", {
2835
Position = UDim2.new(0, 0, 0, 20),
2836
Size = UDim2.new(0, 0, 0, 1),
2837
BackgroundColor3 = Color3.fromRGB(255, 65, 65),
2838
BorderSizePixel = 0,
2839
Parent = notification
2840
}):TweenSize(UDim2.new(1, 0, 0, 1), "Out", "Linear", duration)
2841
2842
tweenService:Create(library:Create("TextLabel", {
2843
Position = UDim2.new(0, 4, 0, 0),
2844
Size = UDim2.new(0, 70, 0, 16),
2845
BackgroundTransparency = 1,
2846
Text = "uwuware",
2847
Font = Enum.Font.Gotham,
2848
TextColor3 = Color3.fromRGB(255, 65, 65),
2849
TextSize = 16,
2850
TextTransparency = 1,
2851
Parent = notification
2852
}), TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextTransparency = 0}):Play()
2853
2854
--remove
2855
delay(duration, function()
2856
if not library then return end
2857
library.notifications[notification] = nil
2858
--bump existing notifications down
2859
for _,otherNotif in next, library.notifications do
2860
if otherNotif.Position.Y.Offset < notification.Position.Y.Offset then
2861
otherNotif:TweenPosition(UDim2.new(1, -5, 1, otherNotif.Position.Y.Offset + 85), "Out", "Quad", 0.2)
2862
end
2863
end
2864
notification:Destroy()
2865
end)
2866
end
2867
2868
return library