Advertisement
dawulfey

[backup] Finity UI Lib

Jul 5th, 2020
2,226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 47.68 KB | None | 0 0
  1. --[[
  2.      ______ _____ _   _ _____ _________     __
  3.     |  ____|_   _| \ | |_   _|__   __\ \   / /
  4.     | |__    | | |  \| | | |    | |   \ \_/ /
  5.     |  __|   | | | . ` | | |    | |    \   /  
  6.     | |     _| |_| |\  |_| |_   | |     | |  
  7.     |_|    |_____|_| \_|_____|  |_|     |_|  
  8.    
  9.     Source:
  10.         http://finity.vip/scripts/finity_lib.lua
  11.     Version:
  12.      0.1.4
  13.     Date:
  14.         January 18th, 2020
  15.     Author:
  16.         detourious @ v3rmillion.net
  17.         deto#7612  @ discord.gg
  18.    
  19.     NOT MINE JUST A BACKUP FOR WHEN ITS DOWN.
  20.     FREE TO USE WITH ORIGINAL CREATOR CREDIT.
  21.    
  22. --]]
  23.  
  24.  
  25. local finity = {}
  26. finity.gs = {}
  27.  
  28. finity.theme = { -- light
  29.     main_container = Color3.fromRGB(249, 249, 255),
  30.     separator_color = Color3.fromRGB(223, 219, 228),
  31.  
  32.     text_color = Color3.fromRGB(96, 96, 96),
  33.  
  34.     category_button_background = Color3.fromRGB(223, 219, 228),
  35.     category_button_border = Color3.fromRGB(200, 196, 204),
  36.  
  37.     checkbox_checked = Color3.fromRGB(114, 214, 112),
  38.     checkbox_outer = Color3.fromRGB(198, 189, 202),
  39.     checkbox_inner = Color3.fromRGB(249, 239, 255),
  40.  
  41.     slider_color = Color3.fromRGB(114, 214, 112),
  42.     slider_color_sliding = Color3.fromRGB(114, 214, 112),
  43.     slider_background = Color3.fromRGB(198, 188, 202),
  44.     slider_text = Color3.fromRGB(112, 112, 112),
  45.  
  46.     textbox_background = Color3.fromRGB(198, 189, 202),
  47.     textbox_background_hover = Color3.fromRGB(215, 206, 227),
  48.     textbox_text = Color3.fromRGB(112, 112, 112),
  49.     textbox_text_hover = Color3.fromRGB(50, 50, 50),
  50.     textbox_placeholder = Color3.fromRGB(178, 178, 178),
  51.  
  52.     dropdown_background = Color3.fromRGB(198, 189, 202),
  53.     dropdown_text = Color3.fromRGB(112, 112, 112),
  54.     dropdown_text_hover = Color3.fromRGB(50, 50, 50),
  55.     dropdown_scrollbar_color = Color3.fromRGB(198, 189, 202),
  56.    
  57.     button_background = Color3.fromRGB(198, 189, 202),
  58.     button_background_hover = Color3.fromRGB(215, 206, 227),
  59.     button_background_down = Color3.fromRGB(178, 169, 182),
  60.    
  61.     scrollbar_color = Color3.fromRGB(198, 189, 202),
  62. }
  63.  
  64. finity.dark_theme = { -- dark
  65.     main_container = Color3.fromRGB(32, 32, 33),
  66.     separator_color = Color3.fromRGB(63, 63, 65),
  67.  
  68.     text_color = Color3.fromRGB(206, 206, 206),
  69.  
  70.     category_button_background = Color3.fromRGB(63, 62, 65),
  71.     category_button_border = Color3.fromRGB(72, 71, 74),
  72.  
  73.     checkbox_checked = Color3.fromRGB(132, 255, 130),
  74.     checkbox_outer = Color3.fromRGB(84, 81, 86),
  75.     checkbox_inner = Color3.fromRGB(132, 132, 136),
  76.  
  77.     slider_color = Color3.fromRGB(177, 177, 177),
  78.     slider_color_sliding = Color3.fromRGB(132, 255, 130),
  79.     slider_background = Color3.fromRGB(88, 84, 90),
  80.     slider_text = Color3.fromRGB(177, 177, 177),
  81.  
  82.     textbox_background = Color3.fromRGB(103, 103, 106),
  83.     textbox_background_hover = Color3.fromRGB(137, 137, 141),
  84.     textbox_text = Color3.fromRGB(195, 195, 195),
  85.     textbox_text_hover = Color3.fromRGB(232, 232, 232),
  86.     textbox_placeholder = Color3.fromRGB(135, 135, 138),
  87.  
  88.     dropdown_background = Color3.fromRGB(88, 88, 91),
  89.     dropdown_text = Color3.fromRGB(195, 195, 195),
  90.     dropdown_text_hover = Color3.fromRGB(232, 232, 232),
  91.     dropdown_scrollbar_color = Color3.fromRGB(118, 118, 121),
  92.    
  93.     button_background = Color3.fromRGB(103, 103, 106),
  94.     button_background_hover = Color3.fromRGB(137, 137, 141),
  95.     button_background_down = Color3.fromRGB(70, 70, 81),
  96.    
  97.     scrollbar_color = Color3.fromRGB(118, 118, 121),
  98. }
  99.  
  100. setmetatable(finity.gs, {
  101.     __index = function(_, service)
  102.         return game:GetService(service)
  103.     end,
  104.     __newindex = function(t, i)
  105.         t[i] = nil
  106.         return
  107.     end
  108. })
  109.  
  110.  
  111. local mouse = finity.gs["Players"].LocalPlayer:GetMouse()
  112.  
  113. function finity:Create(class, properties)
  114.     local object = Instance.new(class)
  115.  
  116.     for prop, val in next, properties do
  117.         if object[prop] and prop ~= "Parent" then
  118.             object[prop] = val
  119.         end
  120.     end
  121.  
  122.     return object
  123. end
  124.  
  125. function finity:addShadow(object, transparency)
  126.     local shadow = self:Create("ImageLabel", {
  127.         Name = "Shadow",
  128.         AnchorPoint = Vector2.new(0.5, 0.5),
  129.         BackgroundTransparency = 1,
  130.         Position = UDim2.new(0.5, 0, 0.5, 4),
  131.         Size = UDim2.new(1, 6, 1, 6),
  132.         Image = "rbxassetid://1316045217",
  133.         ImageTransparency = transparency and true or 0.5,
  134.         ImageColor3 = Color3.fromRGB(35, 35, 35),
  135.         ScaleType = Enum.ScaleType.Slice,
  136.         SliceCenter = Rect.new(10, 10, 118, 118)
  137.     })
  138.  
  139.     shadow.Parent = object
  140. end
  141.  
  142. function finity.new(isdark, gprojectName, thinProject)
  143.     local finityObject = {}
  144.     local self2 = finityObject
  145.     local self = finity
  146.  
  147.     if not finity.gs["RunService"]:IsStudio() and self.gs["CoreGui"]:FindFirstChild("FinityUI") then
  148.         warn("finity:", "instance already exists in coregui!")
  149.        
  150.         return
  151.     end
  152.  
  153.     local theme = finity.theme
  154.     local projectName = false
  155.     local thinMenu = false
  156.    
  157.     if isdark == true then theme = finity.dark_theme end
  158.     if gprojectName then projectName = gprojectName end
  159.     if thinProject then thinMenu = thinProject end
  160.    
  161.     local toggled = true
  162.     local typing = false
  163.     local firstCategory = true
  164.     local savedposition = UDim2.new(0.5, 0, 0.5, 0)
  165.    
  166.  
  167.     local finityData
  168.     finityData = {
  169.         UpConnection = nil,
  170.         ToggleKey = Enum.KeyCode.Home,
  171.     }
  172.  
  173.     self2.ChangeToggleKey = function(NewKey)
  174.         finityData.ToggleKey = NewKey
  175.        
  176.         if not projectName then
  177.             self2.tip.Text = "Press '".. string.sub(tostring(NewKey), 14) .."' to hide this menu"
  178.         end
  179.        
  180.         if finityData.UpConnection then
  181.             finityData.UpConnection:Disconnect()
  182.         end
  183.  
  184.         finityData.UpConnection = finity.gs["UserInputService"].InputEnded:Connect(function(Input)
  185.             if Input.KeyCode == finityData.ToggleKey and not typing then
  186.                 toggled = not toggled
  187.  
  188.                 pcall(function() self2.modal.Modal = toggled end)
  189.  
  190.                 if toggled then
  191.                     pcall(self2.container.TweenPosition, self2.container, savedposition, "Out", "Sine", 0.5, true)
  192.                 else
  193.                     savedposition = self2.container.Position;
  194.                     pcall(self2.container.TweenPosition, self2.container, UDim2.new(savedposition.Width.Scale, savedposition.Width.Offset, 1.5, 0), "Out", "Sine", 0.5, true)
  195.                 end
  196.             end
  197.         end)
  198.     end
  199.    
  200.     self2.ChangeBackgroundImage = function(ImageID, Transparency)
  201.         self2.container.Image = ImageID
  202.        
  203.         if Transparency then
  204.             self2.container.ImageTransparency = Transparency
  205.         else
  206.             self2.container.ImageTransparency = 0.8
  207.         end
  208.     end
  209.  
  210.     finityData.UpConnection = finity.gs["UserInputService"].InputEnded:Connect(function(Input)
  211.         if Input.KeyCode == finityData.ToggleKey and not typing then
  212.             toggled = not toggled
  213.  
  214.             if toggled then
  215.                 self2.container:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
  216.             else
  217.                 self2.container:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), "Out", "Sine", 0.5, true)
  218.             end
  219.         end
  220.     end)
  221.  
  222.     self2.userinterface = self:Create("ScreenGui", {
  223.         Name = "FinityUI",
  224.         ZIndexBehavior = Enum.ZIndexBehavior.Global,
  225.         ResetOnSpawn = false,
  226.     })
  227.  
  228.     self2.container = self:Create("ImageLabel", {
  229.         Draggable = true,
  230.         Active = true,
  231.         Name = "Container",
  232.         AnchorPoint = Vector2.new(0.5, 0.5),
  233.         BackgroundTransparency = 0,
  234.         BackgroundColor3 = theme.main_container,
  235.         BorderSizePixel = 0,
  236.         Position = UDim2.new(0.5, 0, 0.5, 0),
  237.         Size = UDim2.new(0, 800, 0, 500),
  238.         ZIndex = 2,
  239.         ImageTransparency = 1
  240.     })
  241.    
  242.     self2.modal = self:Create("TextButton", {
  243.         Text = "";
  244.         Transparency = 1;
  245.         Modal = true;
  246.     }) self2.modal.Parent = self2.userinterface;
  247.    
  248.     if thinProject and typeof(thinProject) == "UDim2" then
  249.         self2.container.Size = thinProject
  250.     end
  251.  
  252.     self2.container.Draggable = true
  253.     self2.container.Active = true
  254.  
  255.     self2.sidebar = self:Create("Frame", {
  256.         Name = "Sidebar",
  257.         BackgroundColor3 = Color3.new(0.976471, 0.937255, 1),
  258.         BackgroundTransparency = 1,
  259.         BorderColor3 = Color3.new(0.745098, 0.713726, 0.760784),
  260.         Size = UDim2.new(0, 120, 1, -30),
  261.         Position = UDim2.new(0, 0, 0, 30),
  262.         ZIndex = 2,
  263.     })
  264.  
  265.     self2.categories = self:Create("Frame", {
  266.         Name = "Categories",
  267.         BackgroundColor3 = Color3.new(0.976471, 0.937255, 1),
  268.         ClipsDescendants = true,
  269.         BackgroundTransparency = 1,
  270.         BorderColor3 = Color3.new(0.745098, 0.713726, 0.760784),
  271.         Size = UDim2.new(1, -120, 1, -30),
  272.         AnchorPoint = Vector2.new(1, 0),
  273.         Position = UDim2.new(1, 0, 0, 30),
  274.         ZIndex = 2,
  275.     })
  276.     self2.categories.ClipsDescendants = true
  277.  
  278.     self2.topbar = self:Create("Frame", {
  279.         Name = "Topbar",
  280.         ZIndex = 2,
  281.         Size = UDim2.new(1,0,0,30),
  282.         BackgroundTransparency = 2
  283.     })
  284.  
  285.     self2.tip = self:Create("TextLabel", {
  286.         Name = "TopbarTip",
  287.         ZIndex = 2,
  288.         Size = UDim2.new(1, -30, 0, 30),
  289.         Position = UDim2.new(0, 30, 0, 0),
  290.         Text = "Press '".. string.sub(tostring(self.ToggleKey), 14) .."' to hide this menu",
  291.         Font = Enum.Font.GothamSemibold,
  292.         TextSize = 13,
  293.         TextXAlignment = Enum.TextXAlignment.Left,
  294.         BackgroundTransparency = 1,
  295.         TextColor3 = theme.text_color,
  296.     })
  297.    
  298.     if projectName then
  299.         self2.tip.Text = projectName
  300.     else
  301.         self2.tip.Text = "Press '".. string.sub(tostring(self.ToggleKey), 14) .."' to hide this menu"
  302.     end
  303.    
  304.     local separator = self:Create("Frame", {
  305.         Name = "Separator",
  306.         BackgroundColor3 = theme.separator_color,
  307.         BorderSizePixel = 0,
  308.         Position = UDim2.new(0, 118, 0, 30),
  309.         Size = UDim2.new(0, 1, 1, -30),
  310.         ZIndex = 6,
  311.     })
  312.     separator.Parent = self2.container
  313.     separator = nil
  314.  
  315.     local separator = self:Create("Frame", {
  316.         Name = "Separator",
  317.         BackgroundColor3 = theme.separator_color,
  318.         BorderSizePixel = 0,
  319.         Position = UDim2.new(0, 0, 0, 30),
  320.         Size = UDim2.new(1, 0, 0, 1),
  321.         ZIndex = 6,
  322.     })
  323.     separator.Parent = self2.container
  324.     separator = nil
  325.  
  326.     local uipagelayout = self:Create("UIPageLayout", {
  327.         Padding = UDim.new(0, 10),
  328.         FillDirection = Enum.FillDirection.Vertical,
  329.         TweenTime = 0.7,
  330.         EasingStyle = Enum.EasingStyle.Quad,
  331.         EasingDirection = Enum.EasingDirection.InOut,
  332.         SortOrder = Enum.SortOrder.LayoutOrder,
  333.     })
  334.     uipagelayout.Parent = self2.categories
  335.     uipagelayout = nil
  336.  
  337.     local uipadding = self:Create("UIPadding", {
  338.         PaddingTop = UDim.new(0, 3),
  339.         PaddingLeft = UDim.new(0, 2)
  340.     })
  341.     uipadding.Parent = self2.sidebar
  342.     uipadding = nil
  343.  
  344.     local uilistlayout = self:Create("UIListLayout", {
  345.         SortOrder = Enum.SortOrder.LayoutOrder
  346.     })
  347.     uilistlayout.Parent = self2.sidebar
  348.     uilistlayout = nil
  349.  
  350.     function self2:Category(name)
  351.         local category = {}
  352.        
  353.         category.button = finity:Create("TextButton", {
  354.             Name = name,
  355.             BackgroundColor3 = theme.category_button_background,
  356.             BackgroundTransparency = 1,
  357.             BorderMode = Enum.BorderMode.Inset,
  358.             BorderColor3 = theme.category_button_border,
  359.             Size = UDim2.new(1, -4, 0, 25),
  360.             ZIndex = 2,
  361.             AutoButtonColor = false,
  362.             Font = Enum.Font.GothamSemibold,
  363.             Text = name,
  364.             TextColor3 = theme.text_color,
  365.             TextSize = 14
  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.                             Size = UDim2.new(1, 0, 1, 0),
  803.                             ZIndex = 2,
  804.                             Image = "rbxassetid://3570695787",
  805.                             ImageColor3 = theme.dropdown_background,
  806.                             ImageTransparency = 0.5,
  807.                             ScaleType = Enum.ScaleType.Slice,
  808.                             SliceCenter = Rect.new(100, 100, 100, 100),
  809.                             SliceScale = 0.02
  810.                         })
  811.  
  812.                         cheat.selected = finity:Create("TextLabel", {
  813.                             Name = "Selected",
  814.                             BackgroundColor3 = Color3.new(1, 1, 1),
  815.                             BackgroundTransparency = 1,
  816.                             Position = UDim2.new(0, 10, 0, 0),
  817.                             Size = UDim2.new(1, -35, 1, 0),
  818.                             ZIndex = 2,
  819.                             Font = Enum.Font.Gotham,
  820.                             Text = tostring(cheat.value),
  821.                             TextColor3 = theme.dropdown_text,
  822.                             TextSize = 13,
  823.                             TextXAlignment = Enum.TextXAlignment.Left
  824.                         })
  825.  
  826.                         cheat.list = finity:Create("ScrollingFrame", {
  827.                             Name = "List",
  828.                             BackgroundColor3 = theme.dropdown_background,
  829.                             BackgroundTransparency = 0.5,
  830.                             BorderSizePixel = 0,
  831.                             Position = UDim2.new(0, 0, 1, 0),
  832.                             Size = UDim2.new(1, 0, 0, 100),
  833.                             ZIndex = 3,
  834.                             BottomImage = "rbxassetid://967852042",
  835.                             MidImage = "rbxassetid://967852042",
  836.                             TopImage = "rbxassetid://967852042",
  837.                             ScrollBarThickness = 4,
  838.                             VerticalScrollBarInset = Enum.ScrollBarInset.None,
  839.                             ScrollBarImageColor3 = theme.dropdown_scrollbar_color
  840.                         })
  841.  
  842.                         local uilistlayout = finity:Create("UIListLayout", {
  843.                             SortOrder = Enum.SortOrder.LayoutOrder,
  844.                             Padding = UDim.new(0, 2)
  845.                         })
  846.                         uilistlayout.Parent = cheat.list
  847.                         uilistlayout = nil
  848.                         local uipadding = finity:Create("UIPadding", {
  849.                             PaddingLeft = UDim.new(0, 2)
  850.                         })
  851.                         uipadding.Parent = cheat.list
  852.                         uipadding = nil
  853.                        
  854.                         local function refreshOptions()
  855.                             if cheat.dropped then
  856.                                 cheat.fadelist()
  857.                             end
  858.                            
  859.                             for _, child in next, cheat.list:GetChildren() do
  860.                                 if child:IsA("TextButton") then
  861.                                     child:Destroy()
  862.                                 end
  863.                             end
  864.                            
  865.                             for _, value in next, options do
  866.                                 local button = finity:Create("TextButton", {
  867.                                     BackgroundColor3 = Color3.new(1, 1, 1),
  868.                                     BackgroundTransparency = 1,
  869.                                     Size = UDim2.new(1, 0, 0, 20),
  870.                                     ZIndex = 3,
  871.                                     Font = Enum.Font.Gotham,
  872.                                     Text = value,
  873.                                     TextColor3 = theme.dropdown_text,
  874.                                     TextSize = 13
  875.                                 })
  876.    
  877.                                 button.Parent = cheat.list
  878.    
  879.                                 button.MouseEnter:Connect(function()
  880.                                     finity.gs["TweenService"]:Create(button, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text_hover}):Play()
  881.                                 end)
  882.                                 button.MouseLeave:Connect(function()
  883.                                     finity.gs["TweenService"]:Create(button, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text}):Play()
  884.                                 end)
  885.                                 button.MouseButton1Click:Connect(function()
  886.                                     if cheat.dropped then
  887.                                         cheat.value = value
  888.                                         cheat.selected.Text = value
  889.    
  890.                                         cheat.fadelist()
  891.                                        
  892.                                         if callback then
  893.                                             local s, e = pcall(function()
  894.                                                 callback(cheat.value)
  895.                                             end)
  896.    
  897.                                             if not s then warn("error: ".. e) end
  898.                                         end
  899.                                     end
  900.                                 end)
  901.                                
  902.                                
  903.                                 finity.gs["TweenService"]:Create(button, TweenInfo.new(0), {TextTransparency = 1}):Play()
  904.                             end
  905.                            
  906.                             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()
  907.                         end
  908.                        
  909.                        
  910.                         function cheat.fadelist()
  911.                             cheat.dropped = not cheat.dropped
  912.  
  913.                             if cheat.dropped then
  914.                                 for _, button in next, cheat.list:GetChildren() do
  915.                                     if button:IsA("TextButton") then
  916.                                         finity.gs["TweenService"]:Create(button, TweenInfo.new(0.2), {TextTransparency = 0}):Play()
  917.                                     end
  918.                                 end
  919.  
  920.                                 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()
  921.                             else
  922.                                 for _, button in next, cheat.list:GetChildren() do
  923.                                     if button:IsA("TextButton") then
  924.                                         finity.gs["TweenService"]:Create(button, TweenInfo.new(0.2), {TextTransparency = 1}):Play()
  925.                                     end
  926.                                 end
  927.  
  928.                                 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()
  929.                             end
  930.                         end
  931.  
  932.                         cheat.dropdown.MouseEnter:Connect(function()
  933.                             finity.gs["TweenService"]:Create(cheat.selected, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text_hover}):Play()
  934.                         end)
  935.                         cheat.dropdown.MouseLeave:Connect(function()
  936.                             finity.gs["TweenService"]:Create(cheat.selected, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text}):Play()
  937.                         end)
  938.                         cheat.dropdown.MouseButton1Click:Connect(function()
  939.                             cheat.fadelist()
  940.                         end)
  941.  
  942.                         refreshOptions()
  943.                        
  944.                         function cheat:RemoveOption(value)
  945.                             local removed = false
  946.                             for index, option in next, options do
  947.                                 if option == value then
  948.                                     table.remove(options, index)
  949.                                     removed = true
  950.                                     break
  951.                                 end
  952.                             end
  953.                            
  954.                             if removed then
  955.                                 refreshOptions()
  956.                             end
  957.                            
  958.                             return removed
  959.                         end
  960.                        
  961.                         function cheat:AddOption(value)
  962.                             table.insert(options, value)
  963.                            
  964.                             refreshOptions()
  965.                         end
  966.                        
  967.                         function cheat:SetValue(value)
  968.                             cheat.selected.Text = value
  969.                             cheat.value = value
  970.                            
  971.                             if cheat.dropped then
  972.                                 cheat.fadelist()
  973.                             end
  974.                            
  975.                             if callback then
  976.                                 local s, e = pcall(function()
  977.                                     callback(cheat.value)
  978.                                 end)
  979.  
  980.                                 if not s then warn("error: ".. e) end
  981.                             end
  982.                         end
  983.  
  984.                         cheat.selected.Parent = cheat.dropdown
  985.                         cheat.dropdown.Parent = cheat.container
  986.                         cheat.list.Parent = cheat.container
  987.                     elseif string.lower(kind) == "textbox" then
  988.                         local placeholdertext = data and data.placeholder
  989.  
  990.                         cheat.background = finity:Create("ImageLabel", {
  991.                             Name = "Background",
  992.                             BackgroundColor3 = Color3.new(1, 1, 1),
  993.                             BackgroundTransparency = 1,
  994.                             Size = UDim2.new(1, 0, 1, 0),
  995.                             ZIndex = 2,
  996.                             Image = "rbxassetid://3570695787",
  997.                             ImageColor3 = theme.textbox_background,
  998.                             ImageTransparency = 0.5,
  999.                             ScaleType = Enum.ScaleType.Slice,
  1000.                             SliceCenter = Rect.new(100, 100, 100, 100),
  1001.                             SliceScale = 0.02
  1002.                         })
  1003.  
  1004.                         cheat.textbox = finity:Create("TextBox", {
  1005.                             Name = "Textbox",
  1006.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1007.                             BackgroundTransparency = 1,
  1008.                             Position = UDim2.new(0, 0, 0, 0),
  1009.                             Size = UDim2.new(1, 0, 1, 0),
  1010.                             ZIndex = 2,
  1011.                             Font = Enum.Font.Gotham,
  1012.                             Text = "",
  1013.                             TextColor3 = theme.textbox_text,
  1014.                             PlaceholderText = placeholdertext or "Value",
  1015.                             TextSize = 13,
  1016.                             TextXAlignment = Enum.TextXAlignment.Center,
  1017.                             ClearTextOnFocus = false
  1018.                         })
  1019.  
  1020.                         cheat.background.MouseEnter:Connect(function()
  1021.                             finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text_hover}):Play()
  1022.                         end)
  1023.                         cheat.background.MouseLeave:Connect(function()
  1024.                             finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text}):Play()
  1025.                         end)
  1026.                         cheat.textbox.Focused:Connect(function()
  1027.                             typing = true
  1028.  
  1029.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.textbox_background_hover}):Play()
  1030.                         end)
  1031.                         cheat.textbox.FocusLost:Connect(function()
  1032.                             typing = false
  1033.  
  1034.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.textbox_background}):Play()
  1035.                             finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text}):Play()
  1036.  
  1037.                             cheat.value = cheat.textbox.Text
  1038.  
  1039.                             if callback then
  1040.                                 local s, e = pcall(function()
  1041.                                     callback(cheat.value)
  1042.                                 end)
  1043.  
  1044.                                 if not s then warn("error: "..e) end
  1045.                             end
  1046.                         end)
  1047.  
  1048.                         cheat.background.Parent = cheat.container
  1049.                         cheat.textbox.Parent = cheat.container
  1050.                     elseif string.lower(kind) == "slider" then
  1051.                         cheat.value = 0
  1052.  
  1053.                         local suffix = data.suffix or ""
  1054.                         local minimum = data.min or 0
  1055.                         local maximum = data.max or 1
  1056.                        
  1057.                         local moveconnection
  1058.                         local releaseconnection
  1059.  
  1060.                         cheat.sliderbar = finity:Create("ImageButton", {
  1061.                             Name = "Sliderbar",
  1062.                             AnchorPoint = Vector2.new(1, 0.5),
  1063.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1064.                             BackgroundTransparency = 1,
  1065.                             Position = UDim2.new(1, 0, 0.5, 0),
  1066.                             Size = UDim2.new(1, 0, 0, 6),
  1067.                             ZIndex = 2,
  1068.                             Image = "rbxassetid://3570695787",
  1069.                             ImageColor3 = theme.slider_background,
  1070.                             ImageTransparency = 0.5,
  1071.                             ScaleType = Enum.ScaleType.Slice,
  1072.                             SliceCenter = Rect.new(100, 100, 100, 100),
  1073.                             SliceScale = 0.02,
  1074.                         })
  1075.  
  1076.                         cheat.numbervalue = finity:Create("TextLabel", {
  1077.                             Name = "Value",
  1078.                             AnchorPoint = Vector2.new(0, 0.5),
  1079.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1080.                             BackgroundTransparency = 1,
  1081.                             Position = UDim2.new(0.5, 5, 0.5, 0),
  1082.                             Size = UDim2.new(1, 0, 0, 13),
  1083.                             ZIndex = 2,
  1084.                             Font = Enum.Font.Gotham,
  1085.                             TextXAlignment = Enum.TextXAlignment.Left,
  1086.                             Text = "",
  1087.                             TextTransparency = 1,
  1088.                             TextColor3 = theme.slider_text,
  1089.                             TextSize = 13,
  1090.                         })
  1091.  
  1092.                         cheat.visiframe = finity:Create("ImageLabel", {
  1093.                             Name = "Frame",
  1094.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1095.                             BackgroundTransparency = 1,
  1096.                             Size = UDim2.new(0.5, 0, 1, 0),
  1097.                             ZIndex = 2,
  1098.                             Image = "rbxassetid://3570695787",
  1099.                             ImageColor3 = theme.slider_color,
  1100.                             ScaleType = Enum.ScaleType.Slice,
  1101.                             SliceCenter = Rect.new(100, 100, 100, 100),
  1102.                             SliceScale = 0.02
  1103.                         })
  1104.  
  1105.                         cheat.sliderbar.MouseButton1Down:Connect(function()
  1106.                             local size = math.clamp(mouse.X - cheat.sliderbar.AbsolutePosition.X, 0, 150)
  1107.                             local percent = size / 150
  1108.  
  1109.                             cheat.value = math.floor((minimum + (maximum - minimum) * percent) * 100) / 100
  1110.                             cheat.numbervalue.Text = tostring(cheat.value) .. suffix
  1111.  
  1112.                             if callback then
  1113.                                 local s, e = pcall(function()
  1114.                                     callback(cheat.value)
  1115.                                 end)
  1116.  
  1117.                                 if not s then warn("error: ".. e) end
  1118.                             end
  1119.  
  1120.                             finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
  1121.                                 Size = UDim2.new(size / 150, 0, 1, 0),
  1122.                                 ImageColor3 = theme.slider_color_sliding
  1123.                             }):Play()
  1124.  
  1125.                             finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
  1126.                                 Position = UDim2.new(size / 150, 5, 0.5, 0),
  1127.                                 TextTransparency = 0
  1128.                             }):Play()
  1129.  
  1130.                             moveconnection = mouse.Move:Connect(function()
  1131.                                 local size = math.clamp(mouse.X - cheat.sliderbar.AbsolutePosition.X, 0, 150)
  1132.                                 local percent = size / 150
  1133.  
  1134.                                 cheat.value = math.floor((minimum + (maximum - minimum) * percent) * 100) / 100
  1135.                                 cheat.numbervalue.Text = tostring(cheat.value) .. suffix
  1136.  
  1137.                                 if callback then
  1138.                                     local s, e = pcall(function()
  1139.                                         callback(cheat.value)
  1140.                                     end)
  1141.  
  1142.                                     if not s then warn("error: ".. e) end
  1143.                                 end
  1144.  
  1145.                                 finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
  1146.                                     Size = UDim2.new(size / 150, 0, 1, 0),
  1147.                                 ImageColor3 = theme.slider_color_sliding
  1148.                                 }):Play()
  1149.                                
  1150.                                 local Position = UDim2.new(size / 150, 5, 0.5, 0);
  1151.  
  1152.                                 if Position.Width.Scale >= 0.6 then
  1153.                                     Position = UDim2.new(1, -cheat.numbervalue.TextBounds.X, 0.5, 10);
  1154.                                 end
  1155.  
  1156.                                 finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
  1157.                                     Position = Position,
  1158.                                     TextTransparency = 0
  1159.                                 }):Play()
  1160.                             end)
  1161.  
  1162.                             releaseconnection = finity.gs["UserInputService"].InputEnded:Connect(function(Mouse)
  1163.                                 if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  1164.  
  1165.                                     finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
  1166.                                         ImageColor3 = theme.slider_color
  1167.                                     }):Play()
  1168.  
  1169.                                     finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
  1170.                                         TextTransparency = 1
  1171.                                     }):Play()
  1172.  
  1173.                                     moveconnection:Disconnect()
  1174.                                     moveconnection = nil
  1175.                                     releaseconnection:Disconnect()
  1176.                                     releaseconnection = nil
  1177.                                 end
  1178.                             end)
  1179.                         end)
  1180.  
  1181.                         cheat.visiframe.Parent = cheat.sliderbar
  1182.                         cheat.numbervalue.Parent = cheat.sliderbar
  1183.                         cheat.sliderbar.Parent = cheat.container
  1184.                     elseif string.lower(kind) == "button" then
  1185.                         local button_text = data and data.text
  1186.  
  1187.                         cheat.background = finity:Create("ImageLabel", {
  1188.                             Name = "Background",
  1189.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1190.                             BackgroundTransparency = 1,
  1191.                             Size = UDim2.new(1, 0, 1, 0),
  1192.                             ZIndex = 2,
  1193.                             Image = "rbxassetid://3570695787",
  1194.                             ImageColor3 = theme.button_background,
  1195.                             ImageTransparency = 0.5,
  1196.                             ScaleType = Enum.ScaleType.Slice,
  1197.                             SliceCenter = Rect.new(100, 100, 100, 100),
  1198.                             SliceScale = 0.02
  1199.                         })
  1200.  
  1201.                         cheat.button = finity:Create("TextButton", {
  1202.                             Name = "Button",
  1203.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1204.                             BackgroundTransparency = 1,
  1205.                             Position = UDim2.new(0, 0, 0, 0),
  1206.                             Size = UDim2.new(1, 0, 1, 0),
  1207.                             ZIndex = 2,
  1208.                             Font = Enum.Font.Gotham,
  1209.                             Text = button_text or "Button",
  1210.                             TextColor3 = theme.textbox_text,
  1211.                             TextSize = 13,
  1212.                             TextXAlignment = Enum.TextXAlignment.Center
  1213.                         })
  1214.  
  1215.                         cheat.button.MouseEnter:Connect(function()
  1216.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_hover}):Play()
  1217.                         end)
  1218.                         cheat.button.MouseLeave:Connect(function()
  1219.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  1220.                         end)
  1221.                         cheat.button.MouseButton1Down:Connect(function()
  1222.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
  1223.                         end)
  1224.                         cheat.button.MouseButton1Up:Connect(function()
  1225.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  1226.                            
  1227.                             if callback then
  1228.                                 local s, e = pcall(function()
  1229.                                     callback()
  1230.                                 end)
  1231.  
  1232.                                 if not s then warn("error: ".. e) end
  1233.                             end
  1234.                         end)
  1235.  
  1236.                         cheat.background.Parent = cheat.container
  1237.                         cheat.button.Parent = cheat.container
  1238.                    
  1239.                     elseif string.lower(kind) == "keybind" or string.lower(kind) == "bind" then
  1240.                         local callback_bind = data and data.bind
  1241.                         local connection
  1242.                        
  1243.                         cheat.background = finity:Create("ImageLabel", {
  1244.                             Name = "Background",
  1245.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1246.                             BackgroundTransparency = 1,
  1247.                             Size = UDim2.new(1, 0, 1, 0),
  1248.                             ZIndex = 2,
  1249.                             Image = "rbxassetid://3570695787",
  1250.                             ImageColor3 = theme.button_background,
  1251.                             ImageTransparency = 0.5,
  1252.                             ScaleType = Enum.ScaleType.Slice,
  1253.                             SliceCenter = Rect.new(100, 100, 100, 100),
  1254.                             SliceScale = 0.02
  1255.                         })
  1256.  
  1257.                         cheat.button = finity:Create("TextButton", {
  1258.                             Name = "Button",
  1259.                             BackgroundColor3 = Color3.new(1, 1, 1),
  1260.                             BackgroundTransparency = 1,
  1261.                             Position = UDim2.new(0, 0, 0, 0),
  1262.                             Size = UDim2.new(1, 0, 1, 0),
  1263.                             ZIndex = 2,
  1264.                             Font = Enum.Font.Gotham,
  1265.                             Text = "Click to Bind",
  1266.                             TextColor3 = theme.textbox_text,
  1267.                             TextSize = 13,
  1268.                             TextXAlignment = Enum.TextXAlignment.Center
  1269.                         })
  1270.  
  1271.                         cheat.button.MouseEnter:Connect(function()
  1272.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_hover}):Play()
  1273.                         end)
  1274.                         cheat.button.MouseLeave:Connect(function()
  1275.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  1276.                         end)
  1277.                         cheat.button.MouseButton1Down:Connect(function()
  1278.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
  1279.                         end)
  1280.                         cheat.button.MouseButton2Down:Connect(function()
  1281.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
  1282.                         end)
  1283.                         cheat.button.MouseButton1Up:Connect(function()
  1284.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  1285.                             cheat.button.Text = "Press key..."
  1286.                            
  1287.                             if connection then
  1288.                                 connection:Disconnect()
  1289.                                 connection = nil
  1290.                             end
  1291.  
  1292.                             connection = finity.gs["UserInputService"].InputBegan:Connect(function(Input)
  1293.                                 if Input.UserInputType.Name == "Keyboard" and Input.KeyCode ~= finityData.ToggleKey and Input.KeyCode ~= Enum.KeyCode.Backspace then
  1294.                                     cheat.button.Text = "Bound to " .. tostring(Input.KeyCode.Name)
  1295.                                    
  1296.                                     if connection then
  1297.                                         connection:Disconnect()
  1298.                                         connection = nil
  1299.                                     end
  1300.                                    
  1301.                                     delay(0, function()
  1302.                                         callback_bind = Input.KeyCode
  1303.  
  1304.                                         if callback then
  1305.                                             local s, e = pcall(function()
  1306.                                                 callback(Input.KeyCode)
  1307.                                             end)
  1308.            
  1309.                                             if not s then warn("error: ".. e) end
  1310.                                         end
  1311.                                     end)
  1312.                                 elseif Input.KeyCode == Enum.KeyCode.Backspace then
  1313.                                     callback_bind = nil
  1314.                                     cheat.button.Text = "Click to Bind"
  1315.  
  1316.                                     delay(0, function()
  1317.                                         if callback then
  1318.                                             local s, e = pcall(function()
  1319.                                                 callback()
  1320.                                             end)
  1321.            
  1322.                                             if not s then warn("error: ".. e) end
  1323.                                         end
  1324.                                     end)
  1325.  
  1326.                                     connection:Disconnect()
  1327.                                     connection = nil
  1328.                                 elseif Input.KeyCode == finityData.ToggleKey then
  1329.                                     cheat.button.Text = "Invalid Key";
  1330.                                 end
  1331.                             end)
  1332.                         end)
  1333.                        
  1334.                         cheat.button.MouseButton2Up:Connect(function()
  1335.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  1336.                        
  1337.                             callback_bind = nil
  1338.                             cheat.button.Text = "Click to Bind"
  1339.  
  1340.                             delay(0, function()
  1341.                                 if callback then
  1342.                                     local s, e = pcall(function()
  1343.                                         callback()
  1344.                                     end)
  1345.    
  1346.                                     if not s then warn("error: ".. e) end
  1347.                                 end
  1348.                             end)
  1349.                            
  1350.                             if connection then
  1351.                                 connection:Disconnect()
  1352.                                 connection = nil
  1353.                             end
  1354.                         end)
  1355.                        
  1356.                        
  1357.                         finity.gs["UserInputService"].InputBegan:Connect(function(Input, Process)
  1358.                             if callback_bind and Input.KeyCode == callback_bind and not Process then
  1359.                                 if callback then
  1360.                                     local s, e = pcall(function()
  1361.                                         callback(Input.KeyCode)
  1362.                                     end)
  1363.    
  1364.                                     if not s then warn("error: ".. e) end
  1365.                                 end
  1366.                             end
  1367.                         end)
  1368.                        
  1369.                         if callback_bind then
  1370.                             cheat.button.Text = "Bound to " .. tostring(callback_bind.Name)
  1371.                         end
  1372.  
  1373.                         cheat.background.Parent = cheat.container
  1374.                         cheat.button.Parent = cheat.container
  1375.                     end
  1376.                 end
  1377.  
  1378.                 cheat.frame.Parent = sector.container
  1379.                 cheat.label.Parent = cheat.frame
  1380.                 cheat.container.Parent = cheat.frame
  1381.  
  1382.                 return cheat
  1383.             end
  1384.  
  1385.             sector.frame.Parent = category[calculateSector()]
  1386.             sector.container.Parent = sector.frame
  1387.             sector.title.Parent = sector.frame
  1388.  
  1389.             return sector
  1390.         end
  1391.        
  1392.         firstCategory = false
  1393.        
  1394.         return category
  1395.     end
  1396.  
  1397.     self:addShadow(self2.container, 0)
  1398.  
  1399.     self2.categories.ClipsDescendants = true
  1400.    
  1401.     if not finity.gs["RunService"]:IsStudio() then
  1402.         self2.userinterface.Parent = self.gs["CoreGui"]
  1403.     else
  1404.         self2.userinterface.Parent = self.gs["Players"].LocalPlayer:WaitForChild("PlayerGui")
  1405.     end
  1406.    
  1407.     self2.container.Parent = self2.userinterface
  1408.     self2.categories.Parent = self2.container
  1409.     self2.sidebar.Parent = self2.container
  1410.     self2.topbar.Parent = self2.container
  1411.     self2.tip.Parent = self2.topbar
  1412.  
  1413.     return self2, finityData
  1414. end
  1415.  
  1416. return finity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement