Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
3,537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 32.46 KB | None | 0 0
  1. local finity = {}
  2. finity.gs = {}
  3.  
  4. finity.theme = { -- light
  5.     main_container = Color3.fromRGB(249, 249, 255),
  6.     separator_color = Color3.fromRGB(223, 219, 228),
  7.  
  8.     text_color = Color3.fromRGB(96, 96, 96),
  9.  
  10.     category_button_background = Color3.fromRGB(223, 219, 228),
  11.     category_button_border = Color3.fromRGB(200, 196, 204),
  12.  
  13.     checkbox_checked = Color3.fromRGB(114, 214, 112),
  14.     checkbox_outer = Color3.fromRGB(198, 189, 202),
  15.     checkbox_inner = Color3.fromRGB(249, 239, 255),
  16.  
  17.     slider_color = Color3.fromRGB(114, 214, 112),
  18.     slider_color_sliding = Color3.fromRGB(114, 214, 112),
  19.     slider_background = Color3.fromRGB(198, 188, 202),
  20.     slider_text = Color3.fromRGB(112, 112, 112),
  21.  
  22.     textbox_background = Color3.fromRGB(198, 189, 202),
  23.     textbox_background_hover = Color3.fromRGB(215, 206, 227),
  24.     textbox_text = Color3.fromRGB(112, 112, 112),
  25.     textbox_text_hover = Color3.fromRGB(50, 50, 50),
  26.     textbox_placeholder = Color3.fromRGB(178, 178, 178),
  27.  
  28.     dropdown_background = Color3.fromRGB(198, 189, 202),
  29.     dropdown_text = Color3.fromRGB(112, 112, 112),
  30.     dropdown_text_hover = Color3.fromRGB(50, 50, 50),
  31.     dropdown_scrollbar_color = Color3.fromRGB(198, 189, 202),
  32.    
  33.     button_background = Color3.fromRGB(198, 189, 202),
  34.     button_background_hover = Color3.fromRGB(215, 206, 227),
  35.     button_background_down = Color3.fromRGB(178, 169, 182),
  36. }
  37.  
  38. finity.dark_theme = { -- dark
  39.     main_container = Color3.fromRGB(32, 32, 33),
  40.     separator_color = Color3.fromRGB(63, 63, 65),
  41.  
  42.     text_color = Color3.fromRGB(206, 206, 206),
  43.  
  44.     category_button_background = Color3.fromRGB(63, 62, 65),
  45.     category_button_border = Color3.fromRGB(72, 71, 74),
  46.  
  47.     checkbox_checked = Color3.fromRGB(132, 255, 130),
  48.     checkbox_outer = Color3.fromRGB(84, 81, 86),
  49.     checkbox_inner = Color3.fromRGB(132, 132, 136),
  50.  
  51.     slider_color = Color3.fromRGB(177, 177, 177),
  52.     slider_color_sliding = Color3.fromRGB(132, 255, 130),
  53.     slider_background = Color3.fromRGB(88, 84, 90),
  54.     slider_text = Color3.fromRGB(177, 177, 177),
  55.  
  56.     textbox_background = Color3.fromRGB(103, 103, 106),
  57.     textbox_background_hover = Color3.fromRGB(137, 137, 141),
  58.     textbox_text = Color3.fromRGB(195, 195, 195),
  59.     textbox_text_hover = Color3.fromRGB(232, 232, 232),
  60.     textbox_placeholder = Color3.fromRGB(135, 135, 138),
  61.  
  62.     dropdown_background = Color3.fromRGB(88, 88, 91),
  63.     dropdown_text = Color3.fromRGB(195, 195, 195),
  64.     dropdown_text_hover = Color3.fromRGB(232, 232, 232),
  65.     dropdown_scrollbar_color = Color3.fromRGB(118, 118, 121),
  66.    
  67.     button_background = Color3.fromRGB(103, 103, 106),
  68.     button_background_hover = Color3.fromRGB(137, 137, 141),
  69.     button_background_down = Color3.fromRGB(70, 70, 81),
  70. }
  71.  
  72. setmetatable(finity.gs, {
  73.     __index = function(_, service)
  74.         return game:GetService(service)
  75.     end,
  76.     __newindex = function(t, i)
  77.         t[i] = nil
  78.         return
  79.     end
  80. })
  81.  
  82.  
  83. local mouse = finity.gs["Players"].LocalPlayer:GetMouse()
  84.  
  85. function finity:Create(class, properties)
  86.     local object = Instance.new(class)
  87.  
  88.     for prop, val in next, properties do
  89.         if object[prop] and prop ~= "Parent" then
  90.             object[prop] = val
  91.         end
  92.     end
  93.  
  94.     return object
  95. end
  96.  
  97. function finity:addShadow(object, transparency)
  98.     local shadow = self:Create("ImageLabel", {
  99.         Name = "Shadow",
  100.         AnchorPoint = Vector2.new(0.5, 0.5),
  101.         BackgroundTransparency = 1,
  102.         Position = UDim2.new(0.5, 0, 0.5, 4),
  103.         Size = UDim2.new(1, 6, 1, 6),
  104.         Image = "rbxassetid://1316045217",
  105.         ImageTransparency = transparency and true or 0.5,
  106.         ImageColor3 = Color3.fromRGB(35, 35, 35),
  107.         ScaleType = Enum.ScaleType.Slice,
  108.         SliceCenter = Rect.new(10, 10, 118, 118)
  109.     })
  110.  
  111.     shadow.Parent = object
  112. end
  113.  
  114. function finity.new(isdark)
  115.     local finityObject = {}
  116.     local self2 = finityObject
  117.     local self = finity
  118.  
  119.     if not finity.gs["RunService"]:IsStudio() and self.gs["CoreGui"]:FindFirstChild("FinityUI") then
  120.         warn("finity:", "instance already exists in coregui!")
  121.        
  122.         return
  123.     end
  124.  
  125.     local theme = finity.theme
  126.  
  127.     if isdark == true then theme = finity.dark_theme end
  128.  
  129.     local toggled = true
  130.     local typing = false
  131.     local firstcat = false
  132.  
  133.     local finityData
  134.     finityData = {
  135.         UpConnection = nil,
  136.         ToggleKey = Enum.KeyCode.Home,
  137.     }
  138.  
  139.     self2.ChangeToggleKey = function(NewKey)
  140.         finityData.ToggleKey = NewKey
  141.         self2.tip.Text = "Press '".. string.sub(tostring(NewKey), 14) .."' to hide this menu"
  142.  
  143.         if finityData.UpConnection then
  144.             finityData.UpConnection:Disconnect()
  145.         end
  146.  
  147.         finityData.UpConnection = finity.gs["UserInputService"].InputEnded:Connect(function(Input)
  148.             if Input.KeyCode == finityData.ToggleKey and not typing then
  149.                 toggled = not toggled
  150.  
  151.                 if toggled then
  152.                     self2.container:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
  153.                 else
  154.                     self2.container:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), "Out", "Sine", 0.5, true)
  155.                 end
  156.             end
  157.         end)
  158.     end
  159.  
  160.     finityData.UpConnection = finity.gs["UserInputService"].InputEnded:Connect(function(Input)
  161.         if Input.KeyCode == finityData.ToggleKey and not typing then
  162.             toggled = not toggled
  163.  
  164.             if toggled then
  165.                 self2.container:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Sine", 0.5, true)
  166.             else
  167.                 self2.container:TweenPosition(UDim2.new(0.5, 0, 1.5, 0), "Out", "Sine", 0.5, true)
  168.             end
  169.         end
  170.     end)
  171.  
  172.     self2.userinterface = self:Create("ScreenGui", {
  173.         Name = "FinityUI",
  174.         ZIndexBehavior = Enum.ZIndexBehavior.Global,
  175.         ResetOnSpawn = false,
  176.     })
  177.  
  178.     self2.container = self:Create("Frame", {
  179.         Draggable = true,
  180.         Active = true,
  181.         Name = "Container",
  182.         AnchorPoint = Vector2.new(0.5, 0.5),
  183.         BackgroundTransparency = 0,
  184.         BackgroundColor3 = theme.main_container,
  185.         BorderSizePixel = 0,
  186.         Position = UDim2.new(0.5, 0, 0.5, 0),
  187.         Size = UDim2.new(0, 800, 0, 500),
  188.         ZIndex = 2
  189.     })
  190.  
  191.     self2.container.Draggable = true
  192.     self2.container.Active = true
  193.  
  194.     self2.sidebar = self:Create("Frame", {
  195.         Name = "Sidebar",
  196.         BackgroundColor3 = Color3.new(0.976471, 0.937255, 1),
  197.         BackgroundTransparency = 1,
  198.         BorderColor3 = Color3.new(0.745098, 0.713726, 0.760784),
  199.         Size = UDim2.new(0, 120, 1, -30),
  200.         Position = UDim2.new(0, 0, 0, 30),
  201.         ZIndex = 2,
  202.     })
  203.  
  204.     self2.categories = self:Create("Frame", {
  205.         Name = "Categories",
  206.         BackgroundColor3 = Color3.new(0.976471, 0.937255, 1),
  207.         ClipsDescendants = true,
  208.         BackgroundTransparency = 1,
  209.         BorderColor3 = Color3.new(0.745098, 0.713726, 0.760784),
  210.         Size = UDim2.new(1, -120, 1, -30),
  211.         AnchorPoint = Vector2.new(1, 0),
  212.         Position = UDim2.new(1, 0, 0, 30),
  213.         ZIndex = 2,
  214.     })
  215.     self2.categories.ClipsDescendants = true
  216.  
  217.     self2.topbar = self:Create("Frame", {
  218.         Name = "Topbar",
  219.         ZIndex = 2,
  220.         Size = UDim2.new(1,0,0,30),
  221.         BackgroundTransparency = 2
  222.     })
  223.  
  224.     self2.tip = self:Create("TextLabel", {
  225.         Name = "TopbarTip",
  226.         ZIndex = 2,
  227.         Size = UDim2.new(1, -30, 0, 30),
  228.         Position = UDim2.new(0, 30, 0, 0),
  229.         Text = "Press '".. string.sub(tostring(self.ToggleKey), 14) .."' to hide this menu",
  230.         Font = Enum.Font.GothamSemibold,
  231.         TextSize = 13,
  232.         TextXAlignment = Enum.TextXAlignment.Left,
  233.         BackgroundTransparency = 1,
  234.         TextColor3 = theme.text_color,
  235.     })
  236.  
  237.     local separator = self:Create("Frame", {
  238.         Name = "Separator",
  239.         BackgroundColor3 = theme.separator_color,
  240.         BorderSizePixel = 0,
  241.         Position = UDim2.new(0, 118, 0, 30),
  242.         Size = UDim2.new(0, 1, 1, -30),
  243.         ZIndex = 6,
  244.     })
  245.     separator.Parent = self2.container
  246.     separator = nil
  247.  
  248.     local separator = self:Create("Frame", {
  249.         Name = "Separator",
  250.         BackgroundColor3 = theme.separator_color,
  251.         BorderSizePixel = 0,
  252.         Position = UDim2.new(0, 0, 0, 30),
  253.         Size = UDim2.new(1, 0, 0, 1),
  254.         ZIndex = 6,
  255.     })
  256.     separator.Parent = self2.container
  257.     separator = nil
  258.  
  259.     local uipagelayout = self:Create("UIPageLayout", {
  260.         Padding = UDim.new(0, 10),
  261.         FillDirection = Enum.FillDirection.Vertical,
  262.         TweenTime = 0.7,
  263.         EasingStyle = Enum.EasingStyle.Quad,
  264.         EasingDirection = Enum.EasingDirection.InOut,
  265.         SortOrder = Enum.SortOrder.LayoutOrder,
  266.     })
  267.     uipagelayout.Parent = self2.categories
  268.     uipagelayout = nil
  269.  
  270.     local uipadding = self:Create("UIPadding", {
  271.         PaddingTop = UDim.new(0, 5),
  272.         PaddingLeft = UDim.new(0, 2)
  273.     })
  274.     uipadding.Parent = self2.sidebar
  275.     uipadding = nil
  276.  
  277.     local uilistlayout = self:Create("UIListLayout", {
  278.         SortOrder = Enum.SortOrder.LayoutOrder
  279.     })
  280.     uilistlayout.Parent = self2.sidebar
  281.     uilistlayout = nil
  282.  
  283.     function self2:Category(name)
  284.         local category = {}
  285.  
  286.         category.button = finity:Create("TextButton", {
  287.             Name = name,
  288.             BackgroundColor3 = theme.category_button_background,
  289.             BackgroundTransparency = 1,
  290.             BorderMode = Enum.BorderMode.Inset,
  291.             BorderColor3 = theme.category_button_border,
  292.             Size = UDim2.new(1, -4, 0, 25),
  293.             ZIndex = 2,
  294.             AutoButtonColor = false,
  295.             Font = Enum.Font.GothamSemibold,
  296.             Text = name,
  297.             TextColor3 = theme.text_color,
  298.             TextSize = 14
  299.         })
  300.  
  301.         category.container = finity:Create("ScrollingFrame", {
  302.             Name = name,
  303.             BackgroundTransparency = 1,
  304.             BorderSizePixel = 0,
  305.             Size = UDim2.new(1, 0, 1, 0),
  306.             ZIndex = 2,
  307.             CanvasSize = UDim2.new(0, 0, 0, 0)
  308.         })
  309.  
  310.         category.hider = finity:Create("Frame", {
  311.             Name = "Hider",
  312.             BackgroundTransparency = 0,
  313.             BorderSizePixel = 0,
  314.             BackgroundColor3 = theme.main_container,
  315.             Size = UDim2.new(1, 0, 1, 0),
  316.             ZIndex = 5
  317.         })
  318.  
  319.         category.L = finity:Create("Frame", {
  320.             Name = "L",
  321.             BackgroundColor3 = Color3.new(1, 1, 1),
  322.             BackgroundTransparency = 1,
  323.             Position = UDim2.new(0, 10, 0, 5),
  324.             Size = UDim2.new(0.5, -20, 1, -5),
  325.             ZIndex = 2
  326.         })
  327.  
  328.         category.R = finity:Create("Frame", {
  329.             Name = "R",
  330.             AnchorPoint = Vector2.new(1, 0),
  331.             BackgroundColor3 = Color3.new(1, 1, 1),
  332.             BackgroundTransparency = 1,
  333.             Position = UDim2.new(1, -10, 0, 5),
  334.             Size = UDim2.new(0.5, -20, 1, -5),
  335.             ZIndex = 2
  336.         })
  337.  
  338.         local uilistlayout = finity:Create("UIListLayout", {
  339.             SortOrder = Enum.SortOrder.LayoutOrder
  340.         })
  341.         uilistlayout.Parent = category.L
  342.         uilistlayout = nil
  343.  
  344.         local uilistlayout = finity:Create("UIListLayout", {
  345.             SortOrder = Enum.SortOrder.LayoutOrder
  346.         })
  347.         uilistlayout.Parent = category.R
  348.         uilistlayout = nil
  349.  
  350.         category.button.MouseEnter:Connect(function()
  351.             finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 0.5}):Play()
  352.         end)
  353.         category.button.MouseLeave:Connect(function()
  354.             finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
  355.         end)
  356.         category.button.MouseButton1Down:Connect(function()
  357.             for _, categoryf in next, self2.userinterface["Container"]["Categories"]:GetChildren() do
  358.                 if categoryf:IsA("ScrollingFrame") then
  359.                     if categoryf ~= category.container then
  360.                         finity.gs["TweenService"]:Create(categoryf.Hider, TweenInfo.new(0.3), {BackgroundTransparency = 0}):Play()
  361.                     end
  362.                 end
  363.             end
  364.  
  365.             finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 0.2}):Play()
  366.             finity.gs["TweenService"]:Create(category.hider, TweenInfo.new(0.3), {BackgroundTransparency = 1}):Play()
  367.  
  368.             self2.categories["UIPageLayout"]:JumpTo(category.container)
  369.         end)
  370.         category.button.MouseButton1Up:Connect(function()
  371.             finity.gs["TweenService"]:Create(category.button, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
  372.         end)
  373.  
  374.         category.container.Parent = self2.categories
  375.         category.button.Parent = self2.sidebar
  376.         category.R.Parent = category.container
  377.         category.L.Parent = category.container
  378.         category.hider.Parent = category.container
  379.  
  380.         local function calculateSector()
  381.             local R = #category.R:GetChildren() - 1
  382.             local L = #category.L:GetChildren() - 1
  383.  
  384.             if L > R then
  385.                 return "R"
  386.             else
  387.                 return "L"
  388.             end
  389.         end
  390.  
  391.         function category:Sector(name)
  392.             local sector = {}
  393.  
  394.             sector.frame = finity:Create("Frame", {
  395.                 Name = name,
  396.                 BackgroundColor3 = Color3.new(1, 1, 1),
  397.                 BackgroundTransparency = 1,
  398.                 Size = UDim2.new(1, 0, 0, 25),
  399.                 ZIndex = 2
  400.             })
  401.  
  402.             sector.container = finity:Create("Frame", {
  403.                 Name = "Container",
  404.                 BackgroundColor3 = Color3.new(1, 1, 1),
  405.                 BackgroundTransparency = 1,
  406.                 Position = UDim2.new(0, 0, 0, 22),
  407.                 Size = UDim2.new(1, -5, 1, -30),
  408.                 ZIndex = 2
  409.             })
  410.  
  411.             sector.title = finity:Create("TextLabel", {
  412.                 Name = "Title",
  413.                 Text = name,
  414.                 BackgroundColor3 = Color3.new(1, 1, 1),
  415.                 BackgroundTransparency = 1,
  416.                 Size = UDim2.new(1, -5, 0, 25),
  417.                 ZIndex = 2,
  418.                 Font = Enum.Font.GothamSemibold,
  419.                 TextColor3 = theme.text_color,
  420.                 TextSize = 14,
  421.                 TextXAlignment = Enum.TextXAlignment.Left,
  422.             })
  423.  
  424.             local uilistlayout = finity:Create("UIListLayout", {
  425.                 SortOrder = Enum.SortOrder.LayoutOrder
  426.             })
  427.  
  428.             uilistlayout.Changed:Connect(function()
  429.                 sector.frame.Size = UDim2.new(1, 0, 0, sector.container["UIListLayout"].AbsoluteContentSize.Y + 25)
  430.                 sector.container.Size = UDim2.new(1, 0, 0, sector.container["UIListLayout"].AbsoluteContentSize.Y)
  431.             end)
  432.             uilistlayout.Parent = sector.container
  433.             uilistlayout = nil
  434.  
  435.             function sector:Cheat(kind, name, callback, data)
  436.                 local cheat = {}
  437.                 cheat.value = nil
  438.  
  439.                 cheat.frame = finity:Create("Frame", {
  440.                     Name = name,
  441.                     BackgroundColor3 = Color3.new(1, 1, 1),
  442.                     BackgroundTransparency = 1,
  443.                     Size = UDim2.new(1, 0, 0, 25),
  444.                     ZIndex = 2,
  445.                 })
  446.  
  447.                 cheat.label = finity:Create("TextLabel", {
  448.                     Name = "Title",
  449.                     BackgroundColor3 = Color3.new(1, 1, 1),
  450.                     BackgroundTransparency = 1,
  451.                     Size = UDim2.new(1, 0, 1, 0),
  452.                     ZIndex = 2,
  453.                     Font = Enum.Font.Gotham,
  454.                     TextColor3 = theme.text_color,
  455.                     TextSize = 13,
  456.                     Text = name,
  457.                     TextXAlignment = Enum.TextXAlignment.Left
  458.                 })
  459.  
  460.                 cheat.container = finity:Create("Frame", {
  461.                     Name = "Container",
  462.                     AnchorPoint = Vector2.new(1, 0.5),
  463.                     BackgroundColor3 = Color3.new(1, 1, 1),
  464.                     BackgroundTransparency = 1,
  465.                     Position = UDim2.new(1, 0, 0.5, 0),
  466.                     Size = UDim2.new(0, 150, 0, 22),
  467.                     ZIndex = 2,
  468.                 })
  469.                
  470.                 if kind then
  471.                     if string.lower(kind) == "checkbox" then
  472.                         if data then
  473.                             if data.enabled then
  474.                                 cheat.value = true
  475.                             end
  476.                         end
  477.  
  478.                         cheat.checkbox = finity:Create("Frame", {
  479.                             Name = "Checkbox",
  480.                             AnchorPoint = Vector2.new(1, 0),
  481.                             BackgroundColor3 = Color3.new(1, 1, 1),
  482.                             BackgroundTransparency = 1,
  483.                             Position = UDim2.new(1, 0, 0, 0),
  484.                             Size = UDim2.new(0, 25, 0, 25),
  485.                             ZIndex = 2,
  486.                         })
  487.  
  488.                         cheat.outerbox = finity:Create("ImageLabel", {
  489.                             Name = "Outer",
  490.                             AnchorPoint = Vector2.new(1, 0.5),
  491.                             BackgroundColor3 = Color3.new(1, 1, 1),
  492.                             BackgroundTransparency = 1,
  493.                             Position = UDim2.new(1, 0, 0.5, 0),
  494.                             Size = UDim2.new(0, 20, 0, 20),
  495.                             ZIndex = 2,
  496.                             Image = "rbxassetid://3570695787",
  497.                             ImageColor3 = theme.checkbox_outer,
  498.                             ScaleType = Enum.ScaleType.Slice,
  499.                             SliceCenter = Rect.new(100, 100, 100, 100),
  500.                             SliceScale = 0.06,
  501.                         })
  502.  
  503.                         cheat.checkboxbutton = finity:Create("ImageButton", {
  504.                             AnchorPoint = Vector2.new(0.5, 0.5),
  505.                             Name = "CheckboxButton",
  506.                             BackgroundColor3 = Color3.new(1, 1, 1),
  507.                             BackgroundTransparency = 1,
  508.                             Position = UDim2.new(0.5, 0, 0.5, 0),
  509.                             Size = UDim2.new(0, 14, 0, 14),
  510.                             ZIndex = 2,
  511.                             Image = "rbxassetid://3570695787",
  512.                             ImageColor3 = theme.checkbox_inner,
  513.                             ScaleType = Enum.ScaleType.Slice,
  514.                             SliceCenter = Rect.new(100, 100, 100, 100),
  515.                             SliceScale = 0.04
  516.                         })
  517.  
  518.                         if data then
  519.                             if data.enabled then
  520.                                 finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
  521.                                 finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
  522.                             end
  523.                         end
  524.  
  525.                         cheat.checkboxbutton.MouseEnter:Connect(function()
  526.                             local lightertheme = Color3.fromRGB((theme.checkbox_outer.R * 255) + 20, (theme.checkbox_outer.G * 255) + 20, (theme.checkbox_outer.B * 255) + 20)
  527.                             finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = lightertheme}):Play()
  528.                         end)
  529.                         cheat.checkboxbutton.MouseLeave:Connect(function()
  530.                             if not cheat.value then
  531.                                 finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_outer}):Play()
  532.                             else
  533.                                 finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
  534.                             end
  535.                         end)
  536.                         cheat.checkboxbutton.MouseButton1Down:Connect(function()
  537.                             if cheat.value then
  538.                                 finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_outer}):Play()
  539.                             else
  540.                                 finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
  541.                             end
  542.                         end)
  543.                         cheat.checkboxbutton.MouseButton1Up:Connect(function()
  544.                             cheat.value = not cheat.value
  545.  
  546.                             if callback then
  547.                                 local s, e = pcall(function()
  548.                                     callback(cheat.value)
  549.                                 end)
  550.  
  551.                                 if not s then warn("error: ".. e) end
  552.                             end
  553.  
  554.                             if cheat.value then
  555.                                 finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_checked}):Play()
  556.                             else
  557.                                 finity.gs["TweenService"]:Create(cheat.outerbox, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_outer}):Play()
  558.                                 finity.gs["TweenService"]:Create(cheat.checkboxbutton, TweenInfo.new(0.2), {ImageColor3 = theme.checkbox_inner}):Play()
  559.                             end
  560.                         end)
  561.  
  562.                         cheat.checkboxbutton.Parent = cheat.outerbox
  563.                         cheat.outerbox.Parent = cheat.container
  564.                     elseif string.lower(kind) == "dropdown" then
  565.                         if data then
  566.                             if data.default then
  567.                                 cheat.value = data.default
  568.                             elseif data.options then
  569.                                 cheat.value = data.options[1]
  570.                             else
  571.                                 cheat.value = "None"
  572.                             end
  573.                         end
  574.  
  575.                         cheat.dropped = false
  576.  
  577.                         cheat.dropdown = finity:Create("ImageButton", {
  578.                             Name = "Dropdown",
  579.                             BackgroundColor3 = Color3.new(1, 1, 1),
  580.                             BackgroundTransparency = 1,
  581.                             Size = UDim2.new(1, 0, 1, 0),
  582.                             ZIndex = 2,
  583.                             Image = "rbxassetid://3570695787",
  584.                             ImageColor3 = theme.dropdown_background,
  585.                             ImageTransparency = 0.5,
  586.                             ScaleType = Enum.ScaleType.Slice,
  587.                             SliceCenter = Rect.new(100, 100, 100, 100),
  588.                             SliceScale = 0.02
  589.                         })
  590.  
  591.                         cheat.selected = finity:Create("TextLabel", {
  592.                             Name = "Selected",
  593.                             BackgroundColor3 = Color3.new(1, 1, 1),
  594.                             BackgroundTransparency = 1,
  595.                             Position = UDim2.new(0, 10, 0, 0),
  596.                             Size = UDim2.new(1, -35, 1, 0),
  597.                             ZIndex = 2,
  598.                             Font = Enum.Font.Gotham,
  599.                             Text = tostring(cheat.value),
  600.                             TextColor3 = theme.dropdown_text,
  601.                             TextSize = 13,
  602.                             TextXAlignment = Enum.TextXAlignment.Left
  603.                         })
  604.  
  605.                         cheat.list = finity:Create("ScrollingFrame", {
  606.                             Name = "List",
  607.                             BackgroundColor3 = theme.dropdown_background,
  608.                             BackgroundTransparency = 0.5,
  609.                             BorderSizePixel = 0,
  610.                             Position = UDim2.new(0, 0, 1, 0),
  611.                             Size = UDim2.new(1, 0, 0, 100),
  612.                             ZIndex = 3,
  613.                             BottomImage = "rbxassetid://967852042",
  614.                             MidImage = "rbxassetid://967852042",
  615.                             TopImage = "rbxassetid://967852042",
  616.                             ScrollBarThickness = 4,
  617.                             VerticalScrollBarInset = Enum.ScrollBarInset.None,
  618.                             ScrollBarImageColor3 = theme.dropdown_scrollbar_color
  619.                         })
  620.  
  621.                         local uilistlayout = finity:Create("UIListLayout", {
  622.                             SortOrder = Enum.SortOrder.LayoutOrder,
  623.                             Padding = UDim.new(0, 2)
  624.                         })
  625.                         uilistlayout.Parent = cheat.list
  626.                         uilistlayout = nil
  627.                         local uipadding = finity:Create("UIPadding", {
  628.                             PaddingLeft = UDim.new(0, 2)
  629.                         })
  630.                         uipadding.Parent = cheat.list
  631.                         uipadding = nil
  632.  
  633.                         for _, value in next, data.options do
  634.                             local button = finity:Create("TextButton", {
  635.                                 BackgroundColor3 = Color3.new(1, 1, 1),
  636.                                 BackgroundTransparency = 1,
  637.                                 Size = UDim2.new(1, 0, 0, 20),
  638.                                 ZIndex = 3,
  639.                                 Font = Enum.Font.Gotham,
  640.                                 Text = value,
  641.                                 TextColor3 = theme.dropdown_text,
  642.                                 TextSize = 13
  643.                             })
  644.  
  645.                             button.Parent = cheat.list
  646.  
  647.                             button.MouseEnter:Connect(function()
  648.                                 finity.gs["TweenService"]:Create(button, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text_hover}):Play()
  649.                             end)
  650.                             button.MouseLeave:Connect(function()
  651.                                 finity.gs["TweenService"]:Create(button, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text}):Play()
  652.                             end)
  653.                             button.MouseButton1Click:Connect(function()
  654.                                 if cheat.dropped then
  655.                                     cheat.value = value
  656.                                     cheat.selected.Text = value
  657.  
  658.                                     cheat.fadelist()
  659.                                    
  660.                                     if callback then
  661.                                         local s, e = pcall(function()
  662.                                             callback(cheat.value)
  663.                                         end)
  664.  
  665.                                         if not s then warn("error: ".. e) end
  666.                                     end
  667.                                 end
  668.                             end)
  669.                         end
  670.  
  671.                         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()
  672.  
  673.                         for _, button in next, cheat.list:GetChildren() do
  674.                             if button:IsA("TextButton") then
  675.                                 finity.gs["TweenService"]:Create(button, TweenInfo.new(0), {TextTransparency = 1}):Play()
  676.                             end
  677.                         end
  678.  
  679.                         function cheat.fadelist()
  680.                             cheat.dropped = not cheat.dropped
  681.  
  682.                             if cheat.dropped then
  683.                                 for _, button in next, cheat.list:GetChildren() do
  684.                                     if button:IsA("TextButton") then
  685.                                         finity.gs["TweenService"]:Create(button, TweenInfo.new(0.2), {TextTransparency = 0}):Play()
  686.                                     end
  687.                                 end
  688.  
  689.                                 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()
  690.                             else
  691.                                 for _, button in next, cheat.list:GetChildren() do
  692.                                     if button:IsA("TextButton") then
  693.                                         finity.gs["TweenService"]:Create(button, TweenInfo.new(0.2), {TextTransparency = 1}):Play()
  694.                                     end
  695.                                 end
  696.  
  697.                                 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()
  698.                             end
  699.                         end
  700.  
  701.                         cheat.dropdown.MouseEnter:Connect(function()
  702.                             finity.gs["TweenService"]:Create(cheat.selected, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text_hover}):Play()
  703.                         end)
  704.                         cheat.dropdown.MouseLeave:Connect(function()
  705.                             finity.gs["TweenService"]:Create(cheat.selected, TweenInfo.new(0.1), {TextColor3 = theme.dropdown_text}):Play()
  706.                         end)
  707.                         cheat.dropdown.MouseButton1Click:Connect(function()
  708.                             cheat.fadelist()
  709.                         end)
  710.  
  711.                         cheat.selected.Parent = cheat.dropdown
  712.                         cheat.dropdown.Parent = cheat.container
  713.                         cheat.list.Parent = cheat.container
  714.                     elseif string.lower(kind) == "textbox" then
  715.                         local placeholdertext = data and data.placeholder
  716.  
  717.                         cheat.background = finity:Create("ImageLabel", {
  718.                             Name = "Background",
  719.                             BackgroundColor3 = Color3.new(1, 1, 1),
  720.                             BackgroundTransparency = 1,
  721.                             Size = UDim2.new(1, 0, 1, 0),
  722.                             ZIndex = 2,
  723.                             Image = "rbxassetid://3570695787",
  724.                             ImageColor3 = theme.textbox_background,
  725.                             ImageTransparency = 0.5,
  726.                             ScaleType = Enum.ScaleType.Slice,
  727.                             SliceCenter = Rect.new(100, 100, 100, 100),
  728.                             SliceScale = 0.02
  729.                         })
  730.  
  731.                         cheat.textbox = finity:Create("TextBox", {
  732.                             Name = "Textbox",
  733.                             BackgroundColor3 = Color3.new(1, 1, 1),
  734.                             BackgroundTransparency = 1,
  735.                             Position = UDim2.new(0, 0, 0, 0),
  736.                             Size = UDim2.new(1, 0, 1, 0),
  737.                             ZIndex = 2,
  738.                             Font = Enum.Font.Gotham,
  739.                             Text = "",
  740.                             TextColor3 = theme.textbox_text,
  741.                             PlaceholderText = placeholdertext or "Value",
  742.                             TextSize = 13,
  743.                             TextXAlignment = Enum.TextXAlignment.Center
  744.                         })
  745.  
  746.                         cheat.background.MouseEnter:Connect(function()
  747.                             finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text_hover}):Play()
  748.                         end)
  749.                         cheat.background.MouseLeave:Connect(function()
  750.                             finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text}):Play()
  751.                         end)
  752.                         cheat.textbox.Focused:Connect(function()
  753.                             typing = true
  754.  
  755.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.textbox_background_hover}):Play()
  756.                         end)
  757.                         cheat.textbox.FocusLost:Connect(function()
  758.                             typing = false
  759.  
  760.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.textbox_background}):Play()
  761.                             finity.gs["TweenService"]:Create(cheat.textbox, TweenInfo.new(0.1), {TextColor3 = theme.textbox_text}):Play()
  762.  
  763.                             cheat.value = cheat.textbox.Text
  764.  
  765.                             if callback then
  766.                                 local s, e = pcall(function()
  767.                                     callback(cheat.value)
  768.                                 end)
  769.  
  770.                                 if not s then warn("error: "..e) end
  771.                             end
  772.                         end)
  773.  
  774.                         cheat.background.Parent = cheat.container
  775.                         cheat.textbox.Parent = cheat.container
  776.                     elseif string.lower(kind) == "slider" then
  777.                         cheat.value = 0
  778.  
  779.                         local suffix = data.suffix or ""
  780.                         local minimum = data.min or 0
  781.                         local maximum = data.max or 1
  782.                        
  783.                         local moveconnection
  784.                         local releaseconnection
  785.  
  786.                         cheat.sliderbar = finity:Create("ImageButton", {
  787.                             Name = "Sliderbar",
  788.                             AnchorPoint = Vector2.new(1, 0.5),
  789.                             BackgroundColor3 = Color3.new(1, 1, 1),
  790.                             BackgroundTransparency = 1,
  791.                             Position = UDim2.new(1, 0, 0.5, 0),
  792.                             Size = UDim2.new(1, 0, 0, 6),
  793.                             ZIndex = 2,
  794.                             Image = "rbxassetid://3570695787",
  795.                             ImageColor3 = theme.slider_background,
  796.                             ImageTransparency = 0.5,
  797.                             ScaleType = Enum.ScaleType.Slice,
  798.                             SliceCenter = Rect.new(100, 100, 100, 100),
  799.                             SliceScale = 0.02,
  800.                         })
  801.  
  802.                         cheat.numbervalue = finity:Create("TextLabel", {
  803.                             Name = "Value",
  804.                             AnchorPoint = Vector2.new(0, 0.5),
  805.                             BackgroundColor3 = Color3.new(1, 1, 1),
  806.                             BackgroundTransparency = 1,
  807.                             Position = UDim2.new(0.5, 5, 0.5, 0),
  808.                             Size = UDim2.new(1, 0, 0, 13),
  809.                             ZIndex = 2,
  810.                             Font = Enum.Font.Gotham,
  811.                             TextXAlignment = Enum.TextXAlignment.Left,
  812.                             Text = "",
  813.                             TextTransparency = 1,
  814.                             TextColor3 = theme.slider_text,
  815.                             TextSize = 13,
  816.                         })
  817.  
  818.                         cheat.visiframe = finity:Create("ImageLabel", {
  819.                             Name = "Frame",
  820.                             BackgroundColor3 = Color3.new(1, 1, 1),
  821.                             BackgroundTransparency = 1,
  822.                             Size = UDim2.new(0.5, 0, 1, 0),
  823.                             ZIndex = 2,
  824.                             Image = "rbxassetid://3570695787",
  825.                             ImageColor3 = theme.slider_color,
  826.                             ScaleType = Enum.ScaleType.Slice,
  827.                             SliceCenter = Rect.new(100, 100, 100, 100),
  828.                             SliceScale = 0.02
  829.                         })
  830.  
  831.                         cheat.sliderbar.MouseButton1Down:Connect(function()
  832.                             local size = math.clamp(mouse.X - cheat.sliderbar.AbsolutePosition.X, 0, 150)
  833.                             local percent = size / 150
  834.  
  835.                             cheat.value = math.floor((minimum + (maximum - minimum) * percent) * 100) / 100
  836.                             cheat.numbervalue.Text = tostring(cheat.value) .. suffix
  837.  
  838.                             if callback then
  839.                                 local s, e = pcall(function()
  840.                                     callback(cheat.value)
  841.                                 end)
  842.  
  843.                                 if not s then warn("error: ".. e) end
  844.                             end
  845.  
  846.                             finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
  847.                                 Size = UDim2.new(size / 150, 0, 1, 0),
  848.                                 ImageColor3 = theme.slider_color_sliding
  849.                             }):Play()
  850.  
  851.                             finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
  852.                                 Position = UDim2.new(size / 150, 5, 0.5, 0),
  853.                                 TextTransparency = 0
  854.                             }):Play()
  855.  
  856.                             moveconnection = mouse.Move:Connect(function()
  857.                                 local size = math.clamp(mouse.X - cheat.sliderbar.AbsolutePosition.X, 0, 150)
  858.                                 local percent = size / 150
  859.  
  860.                                 cheat.value = math.floor((minimum + (maximum - minimum) * percent) * 100) / 100
  861.                                 cheat.numbervalue.Text = tostring(cheat.value) .. suffix
  862.  
  863.                                 if callback then
  864.                                     local s, e = pcall(function()
  865.                                         callback(cheat.value)
  866.                                     end)
  867.  
  868.                                     if not s then warn("error: ".. e) end
  869.                                 end
  870.  
  871.                                 finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
  872.                                     Size = UDim2.new(size / 150, 0, 1, 0),
  873.                                 ImageColor3 = theme.slider_color_sliding
  874.                                 }):Play()
  875.  
  876.                                 finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
  877.                                     Position = UDim2.new(size / 150, 5, 0.5, 0),
  878.                                     TextTransparency = 0
  879.                                 }):Play()
  880.                             end)
  881.  
  882.                             releaseconnection = finity.gs["UserInputService"].InputEnded:Connect(function(Mouse)
  883.                                 if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  884.  
  885.                                     finity.gs["TweenService"]:Create(cheat.visiframe, TweenInfo.new(0.1), {
  886.                                         ImageColor3 = theme.slider_color
  887.                                     }):Play()
  888.  
  889.                                     finity.gs["TweenService"]:Create(cheat.numbervalue, TweenInfo.new(0.1), {
  890.                                         TextTransparency = 1
  891.                                     }):Play()
  892.  
  893.                                     moveconnection:Disconnect()
  894.                                     moveconnection = nil
  895.                                     releaseconnection:Disconnect()
  896.                                     releaseconnection = nil
  897.                                 end
  898.                             end)
  899.                         end)
  900.  
  901.                         cheat.visiframe.Parent = cheat.sliderbar
  902.                         cheat.numbervalue.Parent = cheat.sliderbar
  903.                         cheat.sliderbar.Parent = cheat.container
  904.                     elseif string.lower(kind) == "button" then
  905.                         local button_text = data and data.text
  906.  
  907.                         cheat.background = finity:Create("ImageLabel", {
  908.                             Name = "Background",
  909.                             BackgroundColor3 = Color3.new(1, 1, 1),
  910.                             BackgroundTransparency = 1,
  911.                             Size = UDim2.new(1, 0, 1, 0),
  912.                             ZIndex = 2,
  913.                             Image = "rbxassetid://3570695787",
  914.                             ImageColor3 = theme.button_background,
  915.                             ImageTransparency = 0.5,
  916.                             ScaleType = Enum.ScaleType.Slice,
  917.                             SliceCenter = Rect.new(100, 100, 100, 100),
  918.                             SliceScale = 0.02
  919.                         })
  920.  
  921.                         cheat.button = finity:Create("TextButton", {
  922.                             Name = "Button",
  923.                             BackgroundColor3 = Color3.new(1, 1, 1),
  924.                             BackgroundTransparency = 1,
  925.                             Position = UDim2.new(0, 0, 0, 0),
  926.                             Size = UDim2.new(1, 0, 1, 0),
  927.                             ZIndex = 2,
  928.                             Font = Enum.Font.Gotham,
  929.                             Text = button_text or "Button",
  930.                             TextColor3 = theme.textbox_text,
  931.                             TextSize = 13,
  932.                             TextXAlignment = Enum.TextXAlignment.Center
  933.                         })
  934.  
  935.                         cheat.button.MouseEnter:Connect(function()
  936.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_hover}):Play()
  937.                         end)
  938.                         cheat.button.MouseLeave:Connect(function()
  939.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  940.                         end)
  941.                         cheat.button.MouseButton1Down:Connect(function()
  942.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background_down}):Play()
  943.                         end)
  944.                         cheat.button.MouseButton1Up:Connect(function()
  945.                             finity.gs["TweenService"]:Create(cheat.background, TweenInfo.new(0.2), {ImageColor3 = theme.button_background}):Play()
  946.                            
  947.                             if callback then
  948.                                 local s, e = pcall(function()
  949.                                     callback()
  950.                                 end)
  951.  
  952.                                 if not s then warn("error: ".. e) end
  953.                             end
  954.                         end)
  955.  
  956.                         cheat.background.Parent = cheat.container
  957.                         cheat.button.Parent = cheat.container
  958.                     end
  959.                 end
  960.  
  961.                 cheat.frame.Parent = sector.container
  962.                 cheat.label.Parent = cheat.frame
  963.                 cheat.container.Parent = cheat.frame
  964.  
  965.                 return cheat
  966.             end
  967.  
  968.             sector.frame.Parent = category[calculateSector()]
  969.             sector.container.Parent = sector.frame
  970.             sector.title.Parent = sector.frame
  971.  
  972.             return sector
  973.         end
  974.  
  975.         return category
  976.     end
  977.  
  978.     self:addShadow(self2.container, 0)
  979.  
  980.     self2.categories.ClipsDescendants = true
  981.    
  982.     if not finity.gs["RunService"]:IsStudio() then
  983.         self2.userinterface.Parent = self.gs["CoreGui"]
  984.     else
  985.         self2.userinterface.Parent = self.gs["Players"].LocalPlayer:WaitForChild("PlayerGui")
  986.     end
  987.    
  988.     self2.container.Parent = self2.userinterface
  989.     self2.categories.Parent = self2.container
  990.     self2.sidebar.Parent = self2.container
  991.     self2.topbar.Parent = self2.container
  992.     self2.tip.Parent = self2.topbar
  993.  
  994.     return self2, finityData
  995. end
  996.  
  997. return finity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement