View difference between Paste ID: HYG6TZ5L and UFCzqSwG
SHOW: | | - or go back to the newest paste.
1
do
2
	local imgui = game:GetService("CoreGui"):FindFirstChild("FinityUI")
3
	if imgui then imgui:Destroy() end
4
end
5
6
local finity = {}
7
finity.gs = {}
8
9
finity.theme = { -- light
10
	main_container = Color3.fromRGB(249, 249, 255),
11
	separator_color = Color3.fromRGB(223, 219, 228),
12
13
	text_color = Color3.fromRGB(96, 96, 96),
14
15
	category_button_background = Color3.fromRGB(223, 219, 228),
16
	category_button_border = Color3.fromRGB(200, 196, 204),
17
18
	checkbox_checked = Color3.fromRGB(114, 214, 112),
19
	checkbox_outer = Color3.fromRGB(198, 189, 202),
20
	checkbox_inner = Color3.fromRGB(249, 239, 255),
21
22
	slider_color = Color3.fromRGB(114, 214, 112),
23
	slider_color_sliding = Color3.fromRGB(114, 214, 112),
24
	slider_background = Color3.fromRGB(198, 188, 202),
25
	slider_text = Color3.fromRGB(112, 112, 112),
26
27
	textbox_background = Color3.fromRGB(198, 189, 202),
28
	textbox_background_hover = Color3.fromRGB(215, 206, 227),
29
	textbox_text = Color3.fromRGB(112, 112, 112),
30
	textbox_text_hover = Color3.fromRGB(50, 50, 50),
31
	textbox_placeholder = Color3.fromRGB(178, 178, 178),
32
33
	dropdown_background = Color3.fromRGB(198, 189, 202),
34
	dropdown_text = Color3.fromRGB(112, 112, 112),
35
	dropdown_text_hover = Color3.fromRGB(50, 50, 50),
36
	dropdown_scrollbar_color = Color3.fromRGB(198, 189, 202),
37
	
38
	button_background = Color3.fromRGB(198, 189, 202),
39
	button_background_hover = Color3.fromRGB(215, 206, 227),
40
	button_background_down = Color3.fromRGB(178, 169, 182),
41
	
42
	scrollbar_color = Color3.fromRGB(198, 189, 202),
43
}
44
45
finity.dark_theme = { -- dark
46-
	main_container = Color3.fromRGB(32, 32, 33),
46+
	main_container = Color3.fromRGB(40, 142, 201),
47-
	separator_color = Color3.fromRGB(63, 63, 65),
47+
	separator_color = Color3.fromRGB(6, 69, 105),
48
49
	text_color = Color3.fromRGB(206, 206, 206),
50
51
	category_button_background = Color3.fromRGB(63, 62, 65),
52
	category_button_border = Color3.fromRGB(72, 71, 74),
53
54
	checkbox_checked = Color3.fromRGB(132, 255, 130),
55
	checkbox_outer = Color3.fromRGB(84, 81, 86),
56
	checkbox_inner = Color3.fromRGB(132, 132, 136),
57
58
	slider_color = Color3.fromRGB(177, 177, 177),
59
	slider_color_sliding = Color3.fromRGB(132, 255, 130),
60
	slider_background = Color3.fromRGB(88, 84, 90),
61
	slider_text = Color3.fromRGB(177, 177, 177),
62
63
	textbox_background = Color3.fromRGB(103, 103, 106),
64
	textbox_background_hover = Color3.fromRGB(137, 137, 141),
65
	textbox_text = Color3.fromRGB(195, 195, 195),
66
	textbox_text_hover = Color3.fromRGB(232, 232, 232),
67
	textbox_placeholder = Color3.fromRGB(135, 135, 138),
68
69
	dropdown_background = Color3.fromRGB(88, 88, 91),
70
	dropdown_text = Color3.fromRGB(195, 195, 195),
71
	dropdown_text_hover = Color3.fromRGB(232, 232, 232),
72
	dropdown_scrollbar_color = Color3.fromRGB(118, 118, 121),
73
	
74
	button_background = Color3.fromRGB(103, 103, 106),
75
	button_background_hover = Color3.fromRGB(137, 137, 141),
76
	button_background_down = Color3.fromRGB(70, 70, 81),
77
	
78
	scrollbar_color = Color3.fromRGB(118, 118, 121),
79
}
80
81
setmetatable(finity.gs, {
82
	__index = function(_, service)
83
		return game:GetService(service)
84
	end,
85
	__newindex = function(t, i)
86
		t[i] = nil
87
		return
88
	end
89
})
90
91
92
local mouse = finity.gs["Players"].LocalPlayer:GetMouse()
93
94
function finity:Create(class, properties)
95
	local object = Instance.new(class)
96
97
	for prop, val in next, properties do
98
		if object[prop] and prop ~= "Parent" then
99
			object[prop] = val
100
		end
101
	end
102
103
	return object
104
end
105
106
function finity:addShadow(object, transparency)
107
	local shadow = self:Create("ImageLabel", {
108
		Name = "Shadow",
109
		AnchorPoint = Vector2.new(0.5, 0.5),
110
		BackgroundTransparency = 1,
111
		Position = UDim2.new(0.5, 0, 0.5, 4),
112
		Size = UDim2.new(1, 6, 1, 6),
113
		Image = "rbxassetid://1316045217",
114
		ImageTransparency = transparency and true or 0.5,
115
		ImageColor3 = Color3.fromRGB(35, 35, 35),
116
		ScaleType = Enum.ScaleType.Slice,
117
		SliceCenter = Rect.new(10, 10, 118, 118)
118
	})
119
120
	shadow.Parent = object
121
end
122
123
function finity.new(isdark, gprojectName, thinProject)
124
	local finityObject = {}
125
	local self2 = finityObject
126
	local self = finity
127
128
	if not finity.gs["RunService"]:IsStudio() and self.gs["CoreGui"]:FindFirstChild("FinityUI") then
129
		warn("finity:", "instance already exists in coregui!")
130
		
131
		return
132
	end
133
134
	local theme = finity.theme
135
	local projectName = false
136
	local thinMenu = false
137
	
138
	if isdark == true then theme = finity.dark_theme end
139
	if gprojectName then projectName = gprojectName end
140
	if thinProject then thinMenu = thinProject end
141
	
142
	local toggled = true
143
	local typing = false
144
	local firstCategory = true
145
    local savedposition = UDim2.new(0.5, 0, 0.5, 0)
146
    
147
148
	local finityData
149
	finityData = {
150
		UpConnection = nil,
151
		ToggleKey = Enum.KeyCode.Home,
152
	}
153
154
	self2.ChangeToggleKey = function(NewKey)
155
		finityData.ToggleKey = NewKey
156
		
157
		if not projectName then
158
			self2.tip.Text = "Press '".. string.sub(tostring(NewKey), 14) .."' to hide this menu"
159
		end
160
		
161
		if finityData.UpConnection then
162
			finityData.UpConnection:Disconnect()
163
		end
164
165
		finityData.UpConnection = finity.gs["UserInputService"].InputEnded:Connect(function(Input)
166
			if Input.KeyCode == finityData.ToggleKey and not typing then
167
                toggled = not toggled
168
169
                pcall(function() self2.modal.Modal = toggled end)
170
171
                if toggled then
172
					pcall(self2.container.TweenPosition, self2.container, savedposition, "Out", "Sine", 0.5, true)
173
                else
174
                    savedposition = self2.container.Position;
175
					pcall(self2.container.TweenPosition, self2.container, UDim2.new(savedposition.Width.Scale, savedposition.Width.Offset, 1.5, 0), "Out", "Sine", 0.5, true)
176
				end
177
			end
178
		end)
179
	end
180
	
181
	self2.ChangeBackgroundImage = function(ImageID, Transparency)
182
		self2.container.Image = ImageID
183
		
184
		if Transparency then
185
			self2.container.ImageTransparency = Transparency
186
		else
187
			self2.container.ImageTransparency = 0.8
188
		end
189
	end
190
191
	finityData.UpConnection = finity.gs["UserInputService"].InputEnded:Connect(function(Input)
192
		if Input.KeyCode == finityData.ToggleKey and not typing then
193
			toggled = not toggled
194
195
			if toggled then
196
				self2.container:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
197
			else
198
				self2.container:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), "Out", "Sine", 0.5, true)
199
			end
200
		end
201
	end)
202
203
	self2.userinterface = self:Create("ScreenGui", {
204
		Name = "FinityUI",
205
		ZIndexBehavior = Enum.ZIndexBehavior.Global,
206
		ResetOnSpawn = false,
207
	})
208
209
	self2.container = self:Create("ImageLabel", {
210
		Draggable = true,
211
		Active = true,
212
		Name = "Container",
213
		AnchorPoint = Vector2.new(0.5, 0.5),
214
		BackgroundTransparency = 0,
215
		BackgroundColor3 = theme.main_container,
216
		BorderSizePixel = 0,
217
		Position = UDim2.new(0.5, 0, 0.5, 0),
218
		Size = UDim2.new(0, 800, 0, 500),
219
		ZIndex = 2,
220
		ImageTransparency = 1
221
    })
222
    
223
    self2.modal = self:Create("TextButton", {
224
        Text = "";
225
        Transparency = 1;
226
        Modal = true;
227
    }) self2.modal.Parent = self2.userinterface;
228
	
229
	if thinProject and typeof(thinProject) == "UDim2" then
230
		self2.container.Size = thinProject
231
	end
232
233
	self2.container.Draggable = true
234
	self2.container.Active = true
235
236
	self2.sidebar = self:Create("Frame", {
237
		Name = "Sidebar",
238
		BackgroundColor3 = Color3.new(0.976471, 0.937255, 1),
239
		BackgroundTransparency = 1,
240
		BorderColor3 = Color3.new(0.745098, 0.713726, 0.760784),
241
		Size = UDim2.new(0, 120, 1, -30),
242
		Position = UDim2.new(0, 0, 0, 30),
243
		ZIndex = 2,
244
	})
245
246
	self2.categories = self:Create("Frame", {
247
		Name = "Categories",
248
		BackgroundColor3 = Color3.new(0.976471, 0.937255, 1),
249
		ClipsDescendants = true,
250
		BackgroundTransparency = 1,
251
		BorderColor3 = Color3.new(0.745098, 0.713726, 0.760784),
252
		Size = UDim2.new(1, -120, 1, -30),
253
		AnchorPoint = Vector2.new(1, 0),
254
		Position = UDim2.new(1, 0, 0, 30),
255
		ZIndex = 2,
256
	})
257
	self2.categories.ClipsDescendants = true
258
259
	self2.topbar = self:Create("Frame", {
260
		Name = "Topbar",
261
		ZIndex = 2,
262
		Size = UDim2.new(1,0,0,30),
263
		BackgroundTransparency = 2
264
	})
265
266
	self2.tip = self:Create("TextLabel", {
267
		Name = "TopbarTip",
268
		ZIndex = 2,
269
		Size = UDim2.new(1, -30, 0, 30),
270
		Position = UDim2.new(0, 30, 0, 0),
271
		Text = "Press '".. string.sub(tostring(self.ToggleKey), 14) .."' to hide this menu",
272
		Font = Enum.Font.GothamSemibold,
273
		TextSize = 13,
274
		TextXAlignment = Enum.TextXAlignment.Left,
275
		BackgroundTransparency = 1,
276
		TextColor3 = theme.text_color,
277
	})
278
	
279
	if projectName then
280
		self2.tip.Text = projectName
281
	else
282
		self2.tip.Text = "Press '".. string.sub(tostring(self.ToggleKey), 14) .."' to hide this menu"
283
	end
284
	
285
	local separator = self:Create("Frame", {
286
		Name = "Separator",
287
		BackgroundColor3 = theme.separator_color,
288
		BorderSizePixel = 0,
289
		Position = UDim2.new(0, 118, 0, 30),
290
		Size = UDim2.new(0, 1, 1, -30),
291
		ZIndex = 6,
292
	})
293
	separator.Parent = self2.container
294
	separator = nil
295
296
	local separator = self:Create("Frame", {
297
		Name = "Separator",
298
		BackgroundColor3 = theme.separator_color,
299
		BorderSizePixel = 0,
300
		Position = UDim2.new(0, 0, 0, 30),
301
		Size = UDim2.new(1, 0, 0, 1),
302
		ZIndex = 6,
303
	})
304
	separator.Parent = self2.container
305
	separator = nil
306
307
	local uipagelayout = self:Create("UIPageLayout", {
308
		Padding = UDim.new(0, 10),
309
		FillDirection = Enum.FillDirection.Vertical,
310
		TweenTime = 0.7,
311
		EasingStyle = Enum.EasingStyle.Quad,
312
		EasingDirection = Enum.EasingDirection.InOut,
313
		SortOrder = Enum.SortOrder.LayoutOrder,
314
	})
315
	uipagelayout.Parent = self2.categories
316
	uipagelayout = nil
317
318
	local uipadding = self:Create("UIPadding", {
319
		PaddingTop = UDim.new(0, 3),
320
		PaddingLeft = UDim.new(0, 2)
321
	})
322
	uipadding.Parent = self2.sidebar
323
	uipadding = nil
324
325
	local uilistlayout = self:Create("UIListLayout", {
326
		SortOrder = Enum.SortOrder.LayoutOrder
327
	})
328
	uilistlayout.Parent = self2.sidebar
329
	uilistlayout = nil
330
331
	function self2:Category(name)
332
		local category = {}
333
		
334
		category.button = finity:Create("TextButton", {
335
			Name = name,
336
			BackgroundColor3 = theme.category_button_background,
337
			BackgroundTransparency = 1,
338
			BorderMode = Enum.BorderMode.Inset,
339
			BorderColor3 = theme.category_button_border,
340
			Size = UDim2.new(1, -4, 0, 25),
341
			ZIndex = 2,
342
			AutoButtonColor = false,
343
			Font = Enum.Font.GothamSemibold,
344
			Text = name,
345
			TextColor3 = theme.text_color,
346
			TextSize = 14
347
		})
348
349
		category.container = finity:Create("ScrollingFrame", {
350
			Name = name,
351
			BackgroundTransparency = 1,
352
			ScrollBarThickness = 4,
353
			BorderSizePixel = 0,
354
			Size = UDim2.new(1, 0, 1, 0),
355
			ZIndex = 2,
356
			CanvasSize = UDim2.new(0, 0, 0, 0),
357
			ScrollBarImageColor3 = theme.scrollbar_color or Color3.fromRGB(118, 118, 121),
358
			BottomImage = "rbxassetid://967852042",
359
			MidImage = "rbxassetid://967852042",
360
			TopImage = "rbxassetid://967852042",
361
			ScrollBarImageTransparency = 1 --
362
		})
363
364
		category.hider = finity:Create("Frame", {
365
			Name = "Hider",
366
			BackgroundTransparency = 0, --
367
			BorderSizePixel = 0,
368
			BackgroundColor3 = theme.main_container,
369
			Size = UDim2.new(1, 0, 1, 0),
370
			ZIndex = 5
371
		})
372
373
		category.L = finity:Create("Frame", {
374
			Name = "L",
375
			BackgroundColor3 = Color3.new(1, 1, 1),
376
			BackgroundTransparency = 1,
377
			Position = UDim2.new(0, 10, 0, 3),
378
			Size = UDim2.new(0.5, -20, 1, -3),
379
			ZIndex = 2
380
		})
381
		
382
		if not thinProject then
383
			category.R = finity:Create("Frame", {
384
				Name = "R",
385
				AnchorPoint = Vector2.new(1, 0),
386
				BackgroundColor3 = Color3.new(1, 1, 1),
387
				BackgroundTransparency = 1,
388
				Position = UDim2.new(1, -10, 0, 3),
389
				Size = UDim2.new(0.5, -20, 1, -3),
390
				ZIndex = 2
391
			})
392
		end
393
		
394
		if thinProject then
395
			category.L.Size = UDim2.new(1, -20, 1, -3)
396
		end
397
		
398
		if firstCategory then
399
			finity.gs["TweenService"]:Create(category.hider, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
400
			finity.gs["TweenService"]:Create(category.container, TweenInfo.new(0.3), {ScrollBarImageTransparency = 0}):Play()
401
		end
402
		
403
		do
404
			local uilistlayout = finity:Create("UIListLayout", {
405
				SortOrder = Enum.SortOrder.LayoutOrder
406
			})
407
	
408
			local uilistlayout2 = finity:Create("UIListLayout", {
409
				SortOrder = Enum.SortOrder.LayoutOrder
410
			})
411
			
412
			local function computeSizeChange()
413
				local largestListSize = 0
414
				
415
				largestListSize = uilistlayout.AbsoluteContentSize.Y
416
				
417
				if uilistlayout2.AbsoluteContentSize.Y > largestListSize then
418
					largestListSize = largestListSize
419
				end
420
				
421
				category.container.CanvasSize = UDim2.new(0, 0, 0, largestListSize + 5)
422
			end
423
			
424
			uilistlayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(computeSizeChange)
425
			uilistlayout2:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(computeSizeChange)
426
			
427
			uilistlayout.Parent = category.L
428
			uilistlayout2.Parent = category.R
429
		end
430
		
431
		category.button.MouseEnter:Connect(function()
432
			finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 0.5}):Play()
433
		end)
434
		category.button.MouseLeave:Connect(function()
435
			finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
436
		end)
437
		category.button.MouseButton1Down:Connect(function()
438
			for _, categoryf in next, self2.userinterface["Container"]["Categories"]:GetChildren() do
439
				if categoryf:IsA("ScrollingFrame") then
440
					if categoryf ~= category.container then
441
						finity.gs["TweenService"]:Create(categoryf.Hider, TweenInfo.new(0.3), {BackgroundTransparency = 0}):Play()
442
						finity.gs["TweenService"]:Create(categoryf, TweenInfo.new(0.3), {ScrollBarImageTransparency = 1}):Play()
443
					end
444
				end
445
			end
446
447
			finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 0.2}):Play()
448
			finity.gs["TweenService"]:Create(category.hider, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
449
			finity.gs["TweenService"]:Create(category.container, TweenInfo.new(0.3), {ScrollBarImageTransparency = 0}):Play()
450
451
			self2.categories["UIPageLayout"]:JumpTo(category.container)
452
		end)
453
		category.button.MouseButton1Up:Connect(function()
454
			finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
455
		end)
456
457
		category.container.Parent = self2.categories
458
		category.button.Parent = self2.sidebar
459
		
460
		if not thinProject then
461
			category.R.Parent = category.container
462
		end
463
		
464
		category.L.Parent = category.container
465
		category.hider.Parent = category.container
466
467
		local function calculateSector()
468
			if thinProject then
469
				return "L"
470
			end
471
			
472
			local R = #category.R:GetChildren() - 1
473
			local L = #category.L:GetChildren() - 1
474
475
			if L > R then
476
				return "R"
477
			else
478
				return "L"
479
			end
480
		end
481
482
		function category:Sector(name)
483
			local sector = {}
484
485
			sector.frame = finity:Create("Frame", {
486
				Name = name,
487
				BackgroundColor3 = Color3.new(1, 1, 1),
488
				BackgroundTransparency = 1,
489
				Size = UDim2.new(1, 0, 0, 25),
490
				ZIndex = 2
491
			})
492
493
			sector.container = finity:Create("Frame", {
494
				Name = "Container",
495
				BackgroundColor3 = Color3.new(1, 1, 1),
496
				BackgroundTransparency = 1,
497
				Position = UDim2.new(0, 0, 0, 22),
498
				Size = UDim2.new(1, -5, 1, -30),
499
				ZIndex = 2
500
			})
501
502
			sector.title = finity:Create("TextLabel", {
503
				Name = "Title",
504
				Text = name,
505
				BackgroundColor3 = Color3.new(1, 1, 1),
506
				BackgroundTransparency = 1,
507
				Size = UDim2.new(1, -5, 0, 25),
508
				ZIndex = 2,
509
				Font = Enum.Font.GothamSemibold,
510
				TextColor3 = theme.text_color,
511
				TextSize = 14,
512
				TextXAlignment = Enum.TextXAlignment.Left,
513
			})
514
515
			local uilistlayout = finity:Create("UIListLayout", {
516
				SortOrder = Enum.SortOrder.LayoutOrder
517
			})
518
519
            uilistlayout.Changed:Connect(function()
520
                pcall(function()
521
                    sector.frame.Size = UDim2.new(1, 0, 0, sector.container["UIListLayout"].AbsoluteContentSize.Y + 25)
522
                    sector.container.Size = UDim2.new(1, 0, 0, sector.container["UIListLayout"].AbsoluteContentSize.Y)
523
                end)
524
			end)
525
			uilistlayout.Parent = sector.container
526
			uilistlayout = nil
527
528
			function sector:Cheat(kind, name, callback, data)
529
				local cheat = {}
530
				cheat.value = nil
531
532
				cheat.frame = finity:Create("Frame", {
533
					Name = name,
534
					BackgroundColor3 = Color3.new(1, 1, 1),
535
					BackgroundTransparency = 1,
536
					Size = UDim2.new(1, 0, 0, 25),
537
					ZIndex = 2,
538
				})
539
540
				cheat.label = finity:Create("TextLabel", {
541
					Name = "Title",
542
					BackgroundColor3 = Color3.new(1, 1, 1),
543
					BackgroundTransparency = 1,
544
					Size = UDim2.new(1, 0, 1, 0),
545
					ZIndex = 2,
546
					Font = Enum.Font.Gotham,
547
					TextColor3 = theme.text_color,
548
					TextSize = 13,
549
					Text = name,
550
					TextXAlignment = Enum.TextXAlignment.Left
551
				})
552
553
				cheat.container	= finity:Create("Frame", {
554
					Name = "Container",
555
					AnchorPoint = Vector2.new(1, 0.5),
556
					BackgroundColor3 = Color3.new(1, 1, 1),
557
					BackgroundTransparency = 1,
558
					Position = UDim2.new(1, 0, 0.5, 0),
559
					Size = UDim2.new(0, 150, 0, 22),
560
					ZIndex = 2,
561
				})
562
				
563
				if kind then
564
					if string.lower(kind) == "checkbox" or string.lower(kind) == "toggle" then
565
						if data then
566
							if data.enabled then
567
								cheat.value = true
568
							end
569
						end
570
571
						cheat.checkbox = finity:Create("Frame", {
572
							Name = "Checkbox",
573
							AnchorPoint = Vector2.new(1, 0),
574
							BackgroundColor3 = Color3.new(1, 1, 1),
575
							BackgroundTransparency = 1,
576
							Position = UDim2.new(1, 0, 0, 0),
577
							Size = UDim2.new(0, 25, 0, 25),
578
							ZIndex = 2,
579
						})
580
581
						cheat.outerbox = finity:Create("ImageLabel", {
582
							Name = "Outer",
583
							AnchorPoint = Vector2.new(1, 0.5),
584
							BackgroundColor3 = Color3.new(1, 1, 1),
585
							BackgroundTransparency = 1,
586
							Position = UDim2.new(1, 0, 0.5, 0),
587
							Size = UDim2.new(0, 20, 0, 20),
588
							ZIndex = 2,
589
							Image = "rbxassetid://3570695787",
590
							ImageColor3 = theme.checkbox_outer,
591
							ScaleType = Enum.ScaleType.Slice,
592
							SliceCenter = Rect.new(100, 100, 100, 100),
593
							SliceScale = 0.06,
594
						})
595
596
						cheat.checkboxbutton = finity:Create("ImageButton", {
597
							AnchorPoint = Vector2.new(0.5, 0.5),
598
							Name = "CheckboxButton",
599
							BackgroundColor3 = Color3.new(1, 1, 1),
600
							BackgroundTransparency = 1,
601
							Position = UDim2.new(0.5, 0, 0.5, 0),
602
							Size = UDim2.new(0, 14, 0, 14),
603
							ZIndex = 2,
604
							Image = "rbxassetid://3570695787",
605
							ImageColor3 = theme.checkbox_inner,
606
							ScaleType = Enum.ScaleType.Slice,
607
							SliceCenter = Rect.new(100, 100, 100, 100),
608
							SliceScale = 0.04
609
						})
610
611
						if data then
612
							if data.enabled then
613
								finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
614
								finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
615
							end
616
						end
617
618
						cheat.checkboxbutton.MouseEnter:Connect(function()
619
							local lightertheme = Color3.fromRGB((theme.checkbox_outer.R * 255) + 20, (theme.checkbox_outer.G * 255) + 20, (theme.checkbox_outer.B * 255) + 20)
620
							finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = lightertheme}):Play()
621
						end)
622
						cheat.checkboxbutton.MouseLeave:Connect(function()
623
							if not cheat.value then
624
								finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_outer}):Play()
625
							else
626
								finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
627
							end
628
						end)
629
						cheat.checkboxbutton.MouseButton1Down:Connect(function()
630
							if cheat.value then
631
								finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_outer}):Play()
632
							else
633
								finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
634
							end
635
						end)
636
						cheat.checkboxbutton.MouseButton1Up:Connect(function()
637
							cheat.value = not cheat.value
638
639
							if callback then
640
								local s, e = pcall(function()
641
									callback(cheat.value)
642
								end)
643
644
								if not s then warn("error: ".. e) end
645
							end
646
647
							if cheat.value then
648
								finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
649
							else
650
								finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_outer}):Play()
651
								finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_inner}):Play()
652
							end
653
						end)
654
655
						cheat.checkboxbutton.Parent = cheat.outerbox
656
                        cheat.outerbox.Parent = cheat.container
657
                    elseif string.lower(kind) == "color" or string.lower(kind) == "colorpicker" then
658
                        cheat.value = Color3.new(1, 1, 1);
659
660
						if data then
661
							if data.color then
662
								cheat.value = data.color
663
							end
664
                        end
665
                        
666
                        local hsvimage = "rbxassetid://4613607014"
667
                        local lumienceimage = "rbxassetid://4613627894"
668
                        
669
                        cheat.hsvbar = finity:Create("ImageButton", {
670
							AnchorPoint = Vector2.new(0.5, 0.5),
671
							Name = "HSVBar",
672
							BackgroundColor3 = Color3.new(1, 1, 1),
673
							BackgroundTransparency = 1,
674
							Position = UDim2.new(0.5, 0, 0.5, 0),
675
							Size = UDim2.new(1, 0, 0, 6),
676
							ZIndex = 2,
677
                            Image = hsvimage
678
                        })
679
680
                        cheat.arrowpreview = finity:Create("ImageLabel", {
681
                            Name = "ArrowPreview",
682
                            BackgroundColor3 = Color3.new(1, 1, 1),
683
                            BackgroundTransparency = 1,
684
                            ImageTransparency = 0.25,
685
                            Position = UDim2.new(0.5, 0, 0.5, -6),
686
                            Size = UDim2.new(0, 6, 0, 6),
687
                            ZIndex = 3,
688
                            Image = "rbxassetid://2500573769",
689
                            Rotation = -90
690
                        })
691
                        
692
                        cheat.hsvbar.MouseButton1Down:Connect(function()
693
                            local rs = finity.gs["RunService"]
694
                            local uis = finity.gs["UserInputService"]local last = cheat.value;
695
696
                            cheat.hsvbar.Image = hsvimage
697
698
                            while uis:IsMouseButtonPressed'MouseButton1' do
699
                                local mouseloc = uis:GetMouseLocation()
700
                                local sx = cheat.arrowpreview.AbsoluteSize.X / 2;
701
                                local offset = (mouseloc.x - cheat.hsvbar.AbsolutePosition.X) - sx
702
                                local scale = offset / cheat.hsvbar.AbsoluteSize.X
703
                                local position = math.clamp(offset, -sx, cheat.hsvbar.AbsoluteSize.X - sx) / cheat.hsvbar.AbsoluteSize.X
704
705
                                finity.gs["TweenService"]:Create(cheat.arrowpreview, TweenInfo.new(0.1), {Position = UDim2.new(position, 0, 0.5, -6)}):Play()
706
                                
707
                                cheat.value = Color3.fromHSV(math.clamp(scale, 0, 1), 1, 1)
708
709
                                if cheat.value ~= last then
710
                                    last = cheat.value
711
                                    
712
                                    if callback then
713
                                        local s, e = pcall(function()
714
                                            callback(cheat.value)
715
                                        end)
716
        
717
                                        if not s then warn("error: ".. e) end
718
                                    end
719
                                end
720
721
                                rs.RenderStepped:wait()
722
                            end
723
                        end)
724
                        cheat.hsvbar.MouseButton2Down:Connect(function()
725
                            local rs = finity.gs["RunService"]
726
                            local uis = finity.gs["UserInputService"]
727
                            local last = cheat.value;
728
729
                            cheat.hsvbar.Image = lumienceimage
730
731
                            while uis:IsMouseButtonPressed'MouseButton2' do
732
                                local mouseloc = uis:GetMouseLocation()
733
                                local sx = cheat.arrowpreview.AbsoluteSize.X / 2
734
                                local offset = (mouseloc.x - cheat.hsvbar.AbsolutePosition.X) - sx
735
                                local scale = offset / cheat.hsvbar.AbsoluteSize.X
736
                                local position = math.clamp(offset, -sx, cheat.hsvbar.AbsoluteSize.X - sx) / cheat.hsvbar.AbsoluteSize.X
737
738
                                finity.gs["TweenService"]:Create(cheat.arrowpreview, TweenInfo.new(0.1), {Position = UDim2.new(position, 0, 0.5, -6)}):Play()
739
                                
740
                                cheat.value = Color3.fromHSV(1, 0, 1 - math.clamp(scale, 0, 1))
741
742
                                if cheat.value ~= last then
743
                                    last = cheat.value
744
745
                                    if callback then
746
                                        local s, e = pcall(function()
747
                                            callback(cheat.value)
748
                                        end)
749
        
750
                                        if not s then warn("error: ".. e) end
751
                                    end
752
                                end
753
754
                                rs.RenderStepped:wait()
755
                            end
756
                        end)
757
758
						cheat.hsvbar.Parent = cheat.container
759
						cheat.arrowpreview.Parent = cheat.hsvbar
760
					elseif string.lower(kind) == "dropdown" then
761
						if data then
762
							if data.default then
763
								cheat.value = data.default
764
							elseif data.options then
765
								cheat.value = data.options[1]
766
							else
767
								cheat.value = "None"
768
							end
769
						end
770
						
771
						local options
772
						
773
						if data and data.options then
774
							options = data.options
775
						end
776
777
						cheat.dropped = false
778
779
						cheat.dropdown = finity:Create("ImageButton", {
780
							Name = "Dropdown",
781
							BackgroundColor3 = Color3.new(1, 1, 1),
782
							BackgroundTransparency = 1,
783
							Size = UDim2.new(1, 0, 1, 0),
784
							ZIndex = 2,
785
							Image = "rbxassetid://3570695787",
786
							ImageColor3 = theme.dropdown_background,
787
							ImageTransparency = 0.5,
788
							ScaleType = Enum.ScaleType.Slice,
789
							SliceCenter = Rect.new(100, 100, 100, 100),
790
							SliceScale = 0.02
791
						})
792
793
						cheat.selected = finity:Create("TextLabel", {
794
							Name = "Selected",
795
							BackgroundColor3 = Color3.new(1, 1, 1),
796
							BackgroundTransparency = 1,
797
							Position = UDim2.new(0, 10, 0, 0),
798
							Size = UDim2.new(1, -35, 1, 0),
799
							ZIndex = 2,
800
							Font = Enum.Font.Gotham,
801
							Text = tostring(cheat.value),
802
							TextColor3 = theme.dropdown_text,
803
							TextSize = 13,
804
							TextXAlignment = Enum.TextXAlignment.Left
805
						})
806
807
						cheat.list = finity:Create("ScrollingFrame", {
808
							Name = "List",
809
							BackgroundColor3 = theme.dropdown_background,
810
							BackgroundTransparency = 0.5,
811
							BorderSizePixel = 0,
812
							Position = UDim2.new(0, 0, 1, 0),
813
							Size = UDim2.new(1, 0, 0, 100),
814
							ZIndex = 3,
815
							BottomImage = "rbxassetid://967852042",
816
							MidImage = "rbxassetid://967852042",
817
							TopImage = "rbxassetid://967852042",
818
							ScrollBarThickness = 4,
819
							VerticalScrollBarInset = Enum.ScrollBarInset.None,
820
							ScrollBarImageColor3 = theme.dropdown_scrollbar_color
821
						})
822
823
						local uilistlayout = finity:Create("UIListLayout", {
824
							SortOrder = Enum.SortOrder.LayoutOrder,
825
							Padding = UDim.new(0, 2)
826
						})
827
						uilistlayout.Parent = cheat.list
828
						uilistlayout = nil
829
						local uipadding = finity:Create("UIPadding", {
830
							PaddingLeft = UDim.new(0, 2)
831
						})
832
						uipadding.Parent = cheat.list
833
						uipadding = nil
834
						
835
						local function refreshOptions()
836
							if cheat.dropped then
837
								cheat.fadelist()
838
							end	
839
							
840
							for _, child in next, cheat.list:GetChildren() do
841
								if child:IsA("TextButton") then
842
									child:Destroy()
843
								end
844
							end
845
							
846
							for _, value in next, options do
847
								local button = finity:Create("TextButton", {
848
									BackgroundColor3 = Color3.new(1, 1, 1),
849
									BackgroundTransparency = 1,
850
									Size = UDim2.new(1, 0, 0, 20),
851
									ZIndex = 3,
852
									Font = Enum.Font.Gotham,
853
									Text = value,
854
									TextColor3 = theme.dropdown_text,
855
									TextSize = 13
856
								})
857
	
858
								button.Parent = cheat.list
859
	
860
								button.MouseEnter:Connect(function()
861
									finity.gs["TweenService"]:Create(button, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text_hover}):Play()
862
								end)
863
								button.MouseLeave:Connect(function()
864
									finity.gs["TweenService"]:Create(button, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text}):Play()
865
								end)
866
								button.MouseButton1Click:Connect(function()
867
									if cheat.dropped then
868
										cheat.value = value
869
										cheat.selected.Text = value
870
	
871
										cheat.fadelist()
872
										
873
										if callback then
874
											local s, e = pcall(function()
875
												callback(cheat.value)
876
											end)
877
	
878
											if not s then warn("error: ".. e) end
879
										end
880
									end
881
								end)
882
								
883
								
884
								finity.gs["TweenService"]:Create(button, TweenInfo.new(0), {TextTransparency = 1}):Play()
885
							end
886
							
887
							finity.gs["TweenService"]:Create(cheat.list, TweenInfo.new(0), {Size = UDim2.new(1, 0, 0, 0), Position = UDim2.new(0, 0, 1, 0), CanvasSize = UDim2.new(0, 0, 0, cheat.list["UIListLayout"].AbsoluteContentSize.Y), ScrollBarImageTransparency = 1, BackgroundTransparency = 1}):Play()
888
						end
889
						
890
						
891
						function cheat.fadelist()
892
							cheat.dropped = not cheat.dropped
893
894
							if cheat.dropped then
895
								for _, button in next, cheat.list:GetChildren() do
896
									if button:IsA("TextButton") then
897
										finity.gs["TweenService"]:Create(button, TweenInfo.new(0.2), {TextTransparency = 0}):Play()
898
									end
899
								end
900
901
								finity.gs["TweenService"]:Create(cheat.list, TweenInfo.new(0.2), {Size = UDim2.new(1, 0, 0, math.clamp(cheat.list["UIListLayout"].AbsoluteContentSize.Y, 0, 150)), Position = UDim2.new(0, 0, 1, 0), ScrollBarImageTransparency = 0, BackgroundTransparency = 0.5}):Play()
902
							else
903
								for _, button in next, cheat.list:GetChildren() do
904
									if button:IsA("TextButton") then
905
										finity.gs["TweenService"]:Create(button, TweenInfo.new(0.2), {TextTransparency = 1}):Play()
906
									end
907
								end
908
909
								finity.gs["TweenService"]:Create(cheat.list, TweenInfo.new(0.2), {Size = UDim2.new(1, 0, 0, 0), Position = UDim2.new(0, 0, 1, 0), ScrollBarImageTransparency = 1, BackgroundTransparency = 1}):Play()
910
							end
911
						end
912
913
						cheat.dropdown.MouseEnter:Connect(function()
914
							finity.gs["TweenService"]:Create(cheat.selected, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text_hover}):Play()
915
						end)
916
						cheat.dropdown.MouseLeave:Connect(function()
917
							finity.gs["TweenService"]:Create(cheat.selected, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text}):Play()
918
						end)
919
						cheat.dropdown.MouseButton1Click:Connect(function()
920
							cheat.fadelist()
921
						end)
922
923
						refreshOptions()
924
						
925
						function cheat:RemoveOption(value)
926
							local removed = false
927
							for index, option in next, options do
928
								if option == value then
929
									table.remove(options, index)
930
									removed = true
931
									break
932
								end
933
							end
934
							
935
							if removed then
936
								refreshOptions()
937
							end
938
							
939
							return removed
940
						end
941
						
942
						function cheat:AddOption(value)
943
							table.insert(options, value)
944
							
945
							refreshOptions()
946
						end
947
						
948
						function cheat:SetValue(value)
949
							cheat.selected.Text = value
950
							cheat.value = value
951
							
952
							if cheat.dropped then
953
								cheat.fadelist()
954
							end
955
							
956
							if callback then
957
								local s, e = pcall(function()
958
									callback(cheat.value)
959
								end)
960
961
								if not s then warn("error: ".. e) end
962
							end
963
						end
964
965
						cheat.selected.Parent = cheat.dropdown
966
						cheat.dropdown.Parent = cheat.container
967
						cheat.list.Parent = cheat.container
968
					elseif string.lower(kind) == "textbox" then
969
						local placeholdertext = data and data.placeholder
970
971
						cheat.background = finity:Create("ImageLabel", {
972
							Name = "Background",
973
							BackgroundColor3 = Color3.new(1, 1, 1),
974
							BackgroundTransparency = 1,
975
							Size = UDim2.new(1, 0, 1, 0),
976
							ZIndex = 2,
977
							Image = "rbxassetid://3570695787",
978
							ImageColor3 = theme.textbox_background,
979
							ImageTransparency = 0.5,
980
							ScaleType = Enum.ScaleType.Slice,
981
							SliceCenter = Rect.new(100, 100, 100, 100),
982
							SliceScale = 0.02
983
						})
984
985
						cheat.textbox = finity:Create("TextBox", {
986
							Name = "Textbox",
987
							BackgroundColor3 = Color3.new(1, 1, 1),
988
							BackgroundTransparency = 1,
989
							Position = UDim2.new(0, 0, 0, 0),
990
							Size = UDim2.new(1, 0, 1, 0),
991
							ZIndex = 2,
992
							Font = Enum.Font.Gotham,
993
							Text = "",
994
							TextColor3 = theme.textbox_text,
995
							PlaceholderText = placeholdertext or "Value",
996
							TextSize = 13,
997
                            TextXAlignment = Enum.TextXAlignment.Center,
998
                            ClearTextOnFocus = false
999
						})
1000
1001
						cheat.background.MouseEnter:Connect(function()
1002
							finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text_hover}):Play()
1003
						end)
1004
						cheat.background.MouseLeave:Connect(function()
1005
							finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text}):Play()
1006
						end)
1007
						cheat.textbox.Focused:Connect(function()
1008
							typing = true
1009
1010
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.textbox_background_hover}):Play()
1011
						end)
1012
						cheat.textbox.FocusLost:Connect(function()
1013
							typing = false
1014
1015
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.textbox_background}):Play()
1016
							finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text}):Play()
1017
1018
							cheat.value = cheat.textbox.Text
1019
1020
							if callback then
1021
								local s, e = pcall(function()
1022
									callback(cheat.value)
1023
								end)
1024
1025
								if not s then warn("error: "..e) end
1026
							end
1027
						end)
1028
1029
						cheat.background.Parent = cheat.container
1030
						cheat.textbox.Parent = cheat.container
1031
					elseif string.lower(kind) == "slider" then
1032
						cheat.value = 0
1033
1034
						local suffix = data.suffix or ""
1035
						local minimum = data.min or 0
1036
						local maximum = data.max or 1
1037
						
1038
						local moveconnection
1039
						local releaseconnection
1040
1041
						cheat.sliderbar = finity:Create("ImageButton", {
1042
							Name = "Sliderbar",
1043
							AnchorPoint = Vector2.new(1, 0.5),
1044
							BackgroundColor3 = Color3.new(1, 1, 1),
1045
							BackgroundTransparency = 1,
1046
							Position = UDim2.new(1, 0, 0.5, 0),
1047
							Size = UDim2.new(1, 0, 0, 6),
1048
							ZIndex = 2,
1049
							Image = "rbxassetid://3570695787",
1050
							ImageColor3 = theme.slider_background,
1051
							ImageTransparency = 0.5,
1052
							ScaleType = Enum.ScaleType.Slice,
1053
							SliceCenter = Rect.new(100, 100, 100, 100),
1054
							SliceScale = 0.02,
1055
						})
1056
1057
						cheat.numbervalue = finity:Create("TextLabel", {
1058
							Name = "Value",
1059
							AnchorPoint = Vector2.new(0, 0.5),
1060
							BackgroundColor3 = Color3.new(1, 1, 1),
1061
							BackgroundTransparency = 1,
1062
							Position = UDim2.new(0.5, 5, 0.5, 0),
1063
							Size = UDim2.new(1, 0, 0, 13),
1064
							ZIndex = 2,
1065
							Font = Enum.Font.Gotham,
1066
							TextXAlignment = Enum.TextXAlignment.Left,
1067
							Text = "",
1068
							TextTransparency = 1,
1069
							TextColor3 = theme.slider_text,
1070
							TextSize = 13,
1071
						})
1072
1073
						cheat.visiframe = finity:Create("ImageLabel", {
1074
							Name = "Frame",
1075
							BackgroundColor3 = Color3.new(1, 1, 1),
1076
							BackgroundTransparency = 1,
1077
							Size = UDim2.new(0.5, 0, 1, 0),
1078
							ZIndex = 2,
1079
							Image = "rbxassetid://3570695787",
1080
							ImageColor3 = theme.slider_color,
1081
							ScaleType = Enum.ScaleType.Slice,
1082
							SliceCenter = Rect.new(100, 100, 100, 100),
1083
							SliceScale = 0.02
1084
						})
1085
1086
						cheat.sliderbar.MouseButton1Down:Connect(function()
1087
							local size = math.clamp(mouse.X - cheat.sliderbar.AbsolutePosition.X, 0, 150)
1088
							local percent = size / 150
1089
1090
							cheat.value = math.floor((minimum + (maximum - minimum) * percent) * 100) / 100
1091
							cheat.numbervalue.Text = tostring(cheat.value) .. suffix
1092
1093
							if callback then
1094
								local s, e = pcall(function()
1095
									callback(cheat.value)
1096
								end)
1097
1098
								if not s then warn("error: ".. e) end
1099
							end
1100
1101
							finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
1102
								Size = UDim2.new(size / 150, 0, 1, 0),
1103
								ImageColor3 = theme.slider_color_sliding
1104
							}):Play()
1105
1106
							finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
1107
								Position = UDim2.new(size / 150, 5, 0.5, 0),
1108
								TextTransparency = 0
1109
							}):Play()
1110
1111
							moveconnection = mouse.Move:Connect(function()
1112
								local size = math.clamp(mouse.X - cheat.sliderbar.AbsolutePosition.X, 0, 150)
1113
								local percent = size / 150
1114
1115
								cheat.value = math.floor((minimum + (maximum - minimum) * percent) * 100) / 100
1116
								cheat.numbervalue.Text = tostring(cheat.value) .. suffix
1117
1118
								if callback then
1119
									local s, e = pcall(function()
1120
										callback(cheat.value)
1121
									end)
1122
1123
									if not s then warn("error: ".. e) end
1124
								end
1125
1126
								finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
1127
									Size = UDim2.new(size / 150, 0, 1, 0),
1128
								ImageColor3 = theme.slider_color_sliding
1129
                                }):Play()
1130
                                
1131
                                local Position = UDim2.new(size / 150, 5, 0.5, 0);
1132
1133
                                if Position.Width.Scale >= 0.6 then
1134
                                    Position = UDim2.new(1, -cheat.numbervalue.TextBounds.X, 0.5, 10);
1135
                                end
1136
1137
								finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
1138
									Position = Position,
1139
									TextTransparency = 0
1140
								}):Play()
1141
							end)
1142
1143
							releaseconnection = finity.gs["UserInputService"].InputEnded:Connect(function(Mouse)
1144
								if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
1145
1146
									finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
1147
										ImageColor3 = theme.slider_color
1148
									}):Play()
1149
1150
									finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
1151
										TextTransparency = 1
1152
									}):Play()
1153
1154
									moveconnection:Disconnect()
1155
									moveconnection = nil
1156
									releaseconnection:Disconnect()
1157
									releaseconnection = nil
1158
								end
1159
							end)
1160
						end)
1161
1162
						cheat.visiframe.Parent = cheat.sliderbar
1163
						cheat.numbervalue.Parent = cheat.sliderbar
1164
						cheat.sliderbar.Parent = cheat.container
1165
					elseif string.lower(kind) == "button" then
1166
						local button_text = data and data.text
1167
1168
						cheat.background = finity:Create("ImageLabel", {
1169
							Name = "Background",
1170
							BackgroundColor3 = Color3.new(1, 1, 1),
1171
							BackgroundTransparency = 1,
1172
							Size = UDim2.new(1, 0, 1, 0),
1173
							ZIndex = 2,
1174
							Image = "rbxassetid://3570695787",
1175
							ImageColor3 = theme.button_background,
1176
							ImageTransparency = 0.5,
1177
							ScaleType = Enum.ScaleType.Slice,
1178
							SliceCenter = Rect.new(100, 100, 100, 100),
1179
							SliceScale = 0.02
1180
						})
1181
1182
						cheat.button = finity:Create("TextButton", {
1183
							Name = "Button",
1184
							BackgroundColor3 = Color3.new(1, 1, 1),
1185
							BackgroundTransparency = 1,
1186
							Position = UDim2.new(0, 0, 0, 0),
1187
							Size = UDim2.new(1, 0, 1, 0),
1188
							ZIndex = 2,
1189
							Font = Enum.Font.Gotham,
1190
							Text = button_text or "Button",
1191
							TextColor3 = theme.textbox_text,
1192
							TextSize = 13,
1193
							TextXAlignment = Enum.TextXAlignment.Center
1194
						})
1195
1196
						cheat.button.MouseEnter:Connect(function()
1197
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_hover}):Play()
1198
						end)
1199
						cheat.button.MouseLeave:Connect(function()
1200
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
1201
						end)
1202
						cheat.button.MouseButton1Down:Connect(function()
1203
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
1204
						end)
1205
						cheat.button.MouseButton1Up:Connect(function()
1206
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
1207
							
1208
							if callback then
1209
								local s, e = pcall(function()
1210
									callback()
1211
								end)
1212
1213
								if not s then warn("error: ".. e) end
1214
							end
1215
						end)
1216
1217
						cheat.background.Parent = cheat.container
1218
						cheat.button.Parent = cheat.container
1219
					
1220
					elseif string.lower(kind) == "keybind" or string.lower(kind) == "bind" then
1221
                        local callback_bind = data and data.bind
1222
                        local connection
1223
						
1224
						cheat.background = finity:Create("ImageLabel", {
1225
							Name = "Background",
1226
							BackgroundColor3 = Color3.new(1, 1, 1),
1227
							BackgroundTransparency = 1,
1228
							Size = UDim2.new(1, 0, 1, 0),
1229
							ZIndex = 2,
1230
							Image = "rbxassetid://3570695787",
1231
							ImageColor3 = theme.button_background,
1232
							ImageTransparency = 0.5,
1233
							ScaleType = Enum.ScaleType.Slice,
1234
							SliceCenter = Rect.new(100, 100, 100, 100),
1235
							SliceScale = 0.02
1236
						})
1237
1238
						cheat.button = finity:Create("TextButton", {
1239
							Name = "Button",
1240
							BackgroundColor3 = Color3.new(1, 1, 1),
1241
							BackgroundTransparency = 1,
1242
							Position = UDim2.new(0, 0, 0, 0),
1243
							Size = UDim2.new(1, 0, 1, 0),
1244
							ZIndex = 2,
1245
							Font = Enum.Font.Gotham,
1246
							Text = "Click to Bind",
1247
							TextColor3 = theme.textbox_text,
1248
							TextSize = 13,
1249
							TextXAlignment = Enum.TextXAlignment.Center
1250
						})
1251
1252
						cheat.button.MouseEnter:Connect(function()
1253
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_hover}):Play()
1254
						end)
1255
						cheat.button.MouseLeave:Connect(function()
1256
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
1257
						end)
1258
						cheat.button.MouseButton1Down:Connect(function()
1259
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
1260
                        end)
1261
                        cheat.button.MouseButton2Down:Connect(function()
1262
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
1263
						end)
1264
						cheat.button.MouseButton1Up:Connect(function()
1265
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
1266
							cheat.button.Text = "Press key..."
1267
							
1268
							if connection then
1269
								connection:Disconnect()
1270
								connection = nil
1271
							end
1272
1273
							connection = finity.gs["UserInputService"].InputBegan:Connect(function(Input)
1274
								if Input.UserInputType.Name == "Keyboard" and Input.KeyCode ~= finityData.ToggleKey and Input.KeyCode ~= Enum.KeyCode.Backspace then
1275
									cheat.button.Text = "Bound to " .. tostring(Input.KeyCode.Name)
1276
									
1277
                                    if connection then
1278
                                        connection:Disconnect()
1279
                                        connection = nil
1280
                                    end
1281
									
1282
									delay(0, function()
1283
										callback_bind = Input.KeyCode
1284
1285
										if callback then
1286
											local s, e = pcall(function()
1287
												callback(Input.KeyCode)
1288
											end)
1289
			
1290
											if not s then warn("error: ".. e) end
1291
										end
1292
									end)
1293
								elseif Input.KeyCode == Enum.KeyCode.Backspace then
1294
									callback_bind = nil
1295
									cheat.button.Text = "Click to Bind"
1296
1297
									delay(0, function()
1298
										if callback then
1299
											local s, e = pcall(function()
1300
												callback()
1301
											end)
1302
			
1303
											if not s then warn("error: ".. e) end
1304
										end
1305
									end)
1306
1307
									connection:Disconnect()
1308
									connection = nil
1309
								elseif Input.KeyCode == finityData.ToggleKey then
1310
									cheat.button.Text = "Invalid Key";
1311
								end
1312
							end)
1313
						end)
1314
						
1315
                        cheat.button.MouseButton2Up:Connect(function()
1316
							finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
1317
						
1318
							callback_bind = nil
1319
							cheat.button.Text = "Click to Bind"
1320
1321
							delay(0, function()
1322
								if callback then
1323
									local s, e = pcall(function()
1324
										callback()
1325
									end)
1326
	
1327
									if not s then warn("error: ".. e) end
1328
								end
1329
							end)
1330
							
1331
                            if connection then
1332
                                connection:Disconnect()
1333
                                connection = nil
1334
                            end
1335
						end)
1336
						
1337
						
1338
						finity.gs["UserInputService"].InputBegan:Connect(function(Input, Process)
1339
							if callback_bind and Input.KeyCode == callback_bind and not Process then
1340
								if callback then
1341
									local s, e = pcall(function()
1342
										callback(Input.KeyCode)
1343
									end)
1344
	
1345
									if not s then warn("error: ".. e) end
1346
								end
1347
							end
1348
						end)
1349
						
1350
						if callback_bind then
1351
							cheat.button.Text = "Bound to " .. tostring(callback_bind.Name)
1352
						end
1353
1354
						cheat.background.Parent = cheat.container
1355
						cheat.button.Parent = cheat.container
1356
					end
1357
				end
1358
1359
				cheat.frame.Parent = sector.container
1360
				cheat.label.Parent = cheat.frame
1361
				cheat.container.Parent = cheat.frame
1362
1363
				return cheat
1364
			end
1365
1366
			sector.frame.Parent = category[calculateSector()]
1367
			sector.container.Parent = sector.frame
1368
			sector.title.Parent = sector.frame
1369
1370
			return sector
1371
		end
1372
		
1373
		firstCategory = false
1374
		
1375
		return category
1376
	end
1377
1378
	self:addShadow(self2.container, 0)
1379
1380
	self2.categories.ClipsDescendants = true
1381
	
1382
	if not finity.gs["RunService"]:IsStudio() then
1383
		self2.userinterface.Parent = self.gs["CoreGui"]
1384
	else
1385
		self2.userinterface.Parent = self.gs["Players"].LocalPlayer:WaitForChild("PlayerGui")
1386
	end
1387
	
1388
	self2.container.Parent = self2.userinterface
1389
	self2.categories.Parent = self2.container
1390
	self2.sidebar.Parent = self2.container
1391
	self2.topbar.Parent = self2.container
1392
	self2.tip.Parent = self2.topbar
1393
1394
	return self2, finityData
1395
end
1396
1397
return finity