Advertisement
CriShoux

Modified Finity UI Library

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