matekaOSF2

Untitled

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