HOLYSHlTz

finitylib.lua

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