Advertisement
kyanopro

ui lib

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