Advertisement
nick_exe_

Lunar Library v0.1.0 Beta

Aug 31st, 2022 (edited)
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.40 KB | None | 0 0
  1. local lunar = {}
  2.  
  3. local lunarInterface = Instance.new("ScreenGui")
  4.  
  5. lunarInterface.Name = "LunarInterface"
  6. lunarInterface.Parent = game.CoreGui
  7. lunarInterface.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  8.  
  9. local lunarFlags = Instance.new("Folder", lunarInterface)
  10. lunarFlags.Name = "LunarFlags"
  11.  
  12. lunar.Flags = lunarFlags
  13.  
  14. function lunar:NewWindow(propTable)
  15.     local Window = Instance.new("Frame")
  16.     local TopBar = Instance.new("Frame")
  17.     local Minimize = Instance.new("ImageButton")
  18.     local Close = Instance.new("ImageButton")
  19.     local Lunar = Instance.new("ImageButton")
  20.     local Title = Instance.new("TextLabel")
  21.     local SidebarTabs = Instance.new("Frame")
  22.     local Lister = Instance.new("UIListLayout")
  23.     local Contents = Instance.new("ScrollingFrame")
  24.     local Lister_2 = Instance.new("UIListLayout")
  25.  
  26.     Window.Name = "Window"
  27.     Window.Parent = lunarInterface
  28.     Window.AnchorPoint = Vector2.new(0.5, 0.5)
  29.     Window.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  30.     Window.BorderSizePixel = 0
  31.     Window.ClipsDescendants = true
  32.     Window.Position = UDim2.new(0.5, 0, 0.5, 0)
  33.     Window.Size = UDim2.new(0, 500, 0, 300)
  34.     Window.ZIndex = 1
  35.  
  36.     TopBar.Name = "TopBar"
  37.     TopBar.Parent = Window
  38.     TopBar.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  39.     TopBar.BorderSizePixel = 0
  40.     TopBar.Size = UDim2.new(1, 0, 0, 30)
  41.     TopBar.ZIndex = 1000
  42.  
  43.     Close.Name = "Minimize"
  44.     Close.Parent = TopBar
  45.     Close.BackgroundTransparency = 1.000
  46.     Close.Position = UDim2.new(0, 470, 0, 0)
  47.     Close.Size = UDim2.new(0, 30, 0, 30)
  48.     Close.ZIndex = 2
  49.     Close.Image = "rbxassetid://3926305904"
  50.     Close.ImageRectOffset = Vector2.new(284, 4)
  51.     Close.ImageRectSize = Vector2.new(24, 24)
  52.  
  53.     local isClosed = false
  54.  
  55.     Close.MouseButton1Click:Connect(function()
  56.         if isClosed == false then
  57.             isClosed = true
  58.             Window:TweenSize(UDim2.new(0,500,0,0), "Out","Quad", 0.5, true)
  59.         else
  60.             isClosed = false
  61.             Window:TweenSize(UDim2.new(0,500,0,300), "Out","Quad", 0.5, true)
  62.         end
  63.     end)
  64.  
  65.     if propTable["OpenKey"] then
  66.         game:GetService("UserInputService").InputBegan:Connect(function(input)
  67.             if input.KeyCode == propTable["OpenKey"] then
  68.                 if isClosed == false then
  69.                     isClosed = true
  70.                     Window:TweenSize(UDim2.new(0,500,0,0), "Out","Quad", 0.5, true)
  71.                 else
  72.                     isClosed = false
  73.                     Window:TweenSize(UDim2.new(0,500,0,300), "Out","Quad", 0.5, true)
  74.                 end
  75.             end
  76.         end)
  77.     end
  78.  
  79.  
  80.     Minimize.Name = "Close"
  81.     Minimize.Parent = TopBar
  82.     Minimize.BackgroundTransparency = 1.000
  83.     Minimize.LayoutOrder = 6
  84.     Minimize.Position = UDim2.new(0, 440, 0, 0)
  85.     Minimize.Size = UDim2.new(0, 30, 0, 30)
  86.     Minimize.ZIndex = 2
  87.     Minimize.Image = "rbxassetid://3926307971"
  88.     Minimize.ImageRectOffset = Vector2.new(884, 284)
  89.     Minimize.ImageRectSize = Vector2.new(36, 36)
  90.  
  91.     local isMinimized = false
  92.  
  93.     Minimize.MouseButton1Click:Connect(function()
  94.         if isMinimized == false then
  95.             isMinimized = true
  96.             Window:TweenSize(UDim2.new(0,500,0,30), "Out","Quad", 0.5, true)
  97.         else
  98.             isMinimized = false
  99.             Window:TweenSize(UDim2.new(0,500,0,300), "Out","Quad", 0.5, true)
  100.         end
  101.     end)
  102.  
  103.     Lunar.Name = "Lunar"
  104.     Lunar.Parent = TopBar
  105.     Lunar.BackgroundTransparency = 1.000
  106.     Lunar.LayoutOrder = 11
  107.     Lunar.Position = UDim2.new(0, 5, 0, 5)
  108.     Lunar.Rotation = 180.000
  109.     Lunar.Size = UDim2.new(0, 20, 0, 20)
  110.     Lunar.ZIndex = 2
  111.     Lunar.Image = "rbxassetid://3926307971"
  112.     Lunar.ImageRectOffset = Vector2.new(324, 204)
  113.     Lunar.ImageRectSize = Vector2.new(36, 36)
  114.     Lunar.ScaleType = Enum.ScaleType.Fit
  115.  
  116.     Title.Name = "Title"
  117.     Title.Parent = TopBar
  118.     Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  119.     Title.BackgroundTransparency = 1.000
  120.     Title.Position = UDim2.new(0, 25, 0, 0)
  121.     Title.Size = UDim2.new(0, 300, 1, 0)
  122.     Title.Font = Enum.Font.GothamBold
  123.     Title.Text = "Lunar Library"
  124.     Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  125.     Title.TextSize = 20.000
  126.     Title.TextXAlignment = Enum.TextXAlignment.Left
  127.  
  128.     SidebarTabs.Name = "SidebarTabs"
  129.     SidebarTabs.Parent = Window
  130.     SidebarTabs.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  131.     SidebarTabs.BorderColor3 = Color3.fromRGB(35, 35, 35)
  132.     SidebarTabs.BorderSizePixel = 0
  133.     SidebarTabs.Position = UDim2.new(0, 0, 0, 30)
  134.     SidebarTabs.Size = UDim2.new(0, 100, 0, 270)
  135.     SidebarTabs.ZIndex = -1
  136.  
  137.     Lister.Name = "Lister"
  138.     Lister.Parent = SidebarTabs
  139.     Lister.SortOrder = Enum.SortOrder.LayoutOrder
  140.  
  141.     Contents.Name = "Contents"
  142.     Contents.Parent = Window
  143.     Contents.Active = true
  144.     Contents.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  145.     Contents.BackgroundTransparency = 1.000
  146.     Contents.BorderSizePixel = 0
  147.     Contents.Position = UDim2.new(0, 100, 0, 40)
  148.     Contents.Size = UDim2.new(0, 400, 0, 260)
  149.     Contents.ScrollBarThickness = 0
  150.  
  151.     Lister_2.Name = "Lister"
  152.     Lister_2.Parent = Contents
  153.     Lister_2.HorizontalAlignment = Enum.HorizontalAlignment.Center
  154.     Lister_2.SortOrder = Enum.SortOrder.LayoutOrder
  155.     Lister_2.Padding = UDim.new(0, 5)
  156.  
  157.     if propTable["Name"] then
  158.         Title.Text = propTable["Name"]
  159.         Window.Name = propTable["Name"]
  160.     end
  161.  
  162.     if propTable["Icon"] then
  163.         Lunar.Image = tonumber(propTable["Icon"])
  164.     end
  165.  
  166.     local windowFunctions = {}
  167.  
  168.     function windowFunctions:NewTab(tabProps)
  169.         local Tab = Instance.new("TextButton")
  170.         local TabContents = Instance.new("Frame")
  171.         local Lister = Instance.new("UIListLayout")
  172.  
  173.         Lister.Name = "Lister"
  174.         Lister.Parent = TabContents
  175.         Lister.HorizontalAlignment = Enum.HorizontalAlignment.Center
  176.         Lister.SortOrder = Enum.SortOrder.LayoutOrder
  177.         Lister.Padding = UDim.new(0, 5)
  178.  
  179.         Tab.Name = "Tab"
  180.         Tab.Parent = SidebarTabs
  181.         Tab.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  182.         Tab.BackgroundTransparency = 1.000
  183.         Tab.BorderSizePixel = 0
  184.         Tab.Size = UDim2.new(1, 0, 0, 25)
  185.         Tab.Font = Enum.Font.GothamBold
  186.         Tab.Text = "Tab"
  187.         Tab.TextColor3 = Color3.fromRGB(175, 175, 175)
  188.         Tab.TextSize = 17.000
  189.         Tab.MouseButton1Click:Connect(function()
  190.             for i, otherTab in pairs(Contents:GetChildren()) do
  191.                 if otherTab:IsA("Frame") then
  192.                     otherTab.Visible = false
  193.                 end
  194.             end
  195.  
  196.             for i, otherTabButton in pairs(SidebarTabs:GetChildren()) do
  197.                 if otherTabButton:IsA("TextButton") then
  198.                     otherTabButton.TextColor3 = Color3.fromRGB(175,175,175)
  199.                 end
  200.             end
  201.  
  202.             Tab.TextColor3 = Color3.fromRGB(255,255,255)
  203.             TabContents.Visible = true
  204.         end)
  205.  
  206.         if tabProps["Name"] then
  207.             Tab.Name = tabProps["Name"]
  208.             Tab.Text = tabProps["Name"]
  209.         end
  210.  
  211.         TabContents.Name = Tab.Name
  212.         TabContents.Parent = Contents
  213.         TabContents.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  214.         TabContents.BackgroundTransparency = 1
  215.         TabContents.Size = UDim2.new(1, 0, 1, 0)
  216.  
  217.         local tabFunctions = {}
  218.  
  219.         function tabFunctions:AddButton(buttonProps)
  220.             local Button = Instance.new("Frame")
  221.             local ButtonRound = Instance.new("UICorner")
  222.             local ButtonTitle = Instance.new("TextLabel")
  223.             local Touch = Instance.new("TextButton")
  224.             local TouchIcon = Instance.new("ImageButton")
  225.  
  226.             Button.Name = "Button"
  227.             Button.Parent = TabContents
  228.             Button.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  229.             Button.Size = UDim2.new(0.899999976, 0, 0, 40)
  230.  
  231.             ButtonRound.CornerRadius = UDim.new(0, 10)
  232.             ButtonRound.Name = "Round"
  233.             ButtonRound.Parent = Button
  234.  
  235.             ButtonTitle.Name = "Title"
  236.             ButtonTitle.Parent = Button
  237.             ButtonTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  238.             ButtonTitle.BackgroundTransparency = 1.000
  239.             ButtonTitle.Position = UDim2.new(0, 10, 0, 0)
  240.             ButtonTitle.Size = UDim2.new(0.800000012, 0, 1, 0)
  241.             ButtonTitle.Font = Enum.Font.GothamBold
  242.             ButtonTitle.Text = "Button"
  243.             ButtonTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  244.             ButtonTitle.TextSize = 20.000
  245.             ButtonTitle.TextXAlignment = Enum.TextXAlignment.Left
  246.  
  247.             Touch.Name = "Touch"
  248.             Touch.Parent = Button
  249.             Touch.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  250.             Touch.BackgroundTransparency = 1.000
  251.             Touch.Size = UDim2.new(1, 0, 1, 0)
  252.             Touch.Font = Enum.Font.Gotham
  253.             Touch.Text = ""
  254.             Touch.TextColor3 = Color3.fromRGB(255, 255, 255)
  255.             Touch.TextSize = 1.000
  256.  
  257.             TouchIcon.Name = "TouchIcon"
  258.             TouchIcon.Parent = Button
  259.             TouchIcon.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  260.             TouchIcon.BackgroundTransparency = 1.000
  261.             TouchIcon.Position = UDim2.new(0, 325, 0, 5)
  262.             TouchIcon.Size = UDim2.new(0, 30, 0, 30)
  263.             TouchIcon.ZIndex = 2
  264.             TouchIcon.Image = "rbxassetid://3926305904"
  265.             TouchIcon.ImageColor3 = Color3.fromRGB(175, 175, 175)
  266.             TouchIcon.ImageRectOffset = Vector2.new(164, 844)
  267.             TouchIcon.ImageRectSize = Vector2.new(36, 36)
  268.             TouchIcon.ScaleType = Enum.ScaleType.Fit
  269.  
  270.             if buttonProps["Name"] then
  271.                 ButtonTitle.Text = buttonProps["Name"]
  272.                 Button.Name = buttonProps["Name"]
  273.             end
  274.  
  275.             if buttonProps["Icon"] then
  276.                 TouchIcon.Image = tostring(buttonProps["Icon"])
  277.             end
  278.  
  279.             if buttonProps["PressFunction"] then
  280.                 Touch.MouseButton1Click:Connect(buttonProps["PressFunction"])
  281.             end
  282.         end
  283.  
  284.         function tabFunctions:AddToggleButton(toggleButtonProps)
  285.             local ToggleButton = Instance.new("Frame")
  286.             local ToggleRound = Instance.new("UICorner")
  287.             local ToggleTitle = Instance.new("TextLabel")
  288.             local Toggle = Instance.new("TextButton")
  289.             local ToggleRound_2 = Instance.new("UICorner")
  290.  
  291.             ToggleButton.Name = "ToggleButton"
  292.             ToggleButton.Parent = TabContents
  293.             ToggleButton.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  294.             ToggleButton.Size = UDim2.new(0.899999976, 0, 0, 40)
  295.  
  296.             ToggleRound.CornerRadius = UDim.new(0, 10)
  297.             ToggleRound.Name = "Round"
  298.             ToggleRound.Parent = ToggleButton
  299.  
  300.             ToggleTitle.Name = "Title"
  301.             ToggleTitle.Parent = ToggleButton
  302.             ToggleTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  303.             ToggleTitle.BackgroundTransparency = 1.000
  304.             ToggleTitle.Position = UDim2.new(0, 10, 0, 0)
  305.             ToggleTitle.Size = UDim2.new(0.800000012, 0, 1, 0)
  306.             ToggleTitle.Font = Enum.Font.GothamBold
  307.             ToggleTitle.Text = "Toggle Button"
  308.             ToggleTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  309.             ToggleTitle.TextSize = 20.000
  310.             ToggleTitle.TextXAlignment = Enum.TextXAlignment.Left
  311.  
  312.             Toggle.Name = "Toggle"
  313.             Toggle.Parent = ToggleButton
  314.             Toggle.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  315.             Toggle.Position = UDim2.new(0, 325, 0, 5)
  316.             Toggle.Size = UDim2.new(0, 30, 0, 30)
  317.             Toggle.AutoButtonColor = false
  318.             Toggle.Font = Enum.Font.GothamMedium
  319.             Toggle.Text = ""
  320.             Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  321.             Toggle.TextSize = 1
  322.  
  323.             local toggleOnColor = Color3.fromRGB(0, 105, 235)
  324.             local toggleOn = false
  325.  
  326.             ToggleRound_2.Name = "Round"
  327.             ToggleRound_2.Parent = Toggle
  328.  
  329.             if toggleButtonProps["Flag"] then
  330.                 local newFlag = Instance.new("BoolValue", lunar.Flags)
  331.                 newFlag.Name = toggleButtonProps["Flag"]
  332.                 newFlag.Value = false
  333.             end
  334.  
  335.             if toggleButtonProps["Name"] then
  336.                 ToggleTitle.Text = toggleButtonProps["Name"]
  337.                 ToggleButton.Name = toggleButtonProps["Name"]
  338.             end
  339.  
  340.             if toggleButtonProps["OnColor"] then
  341.                 toggleOnColor = toggleButtonProps["OnColor"]
  342.             end
  343.  
  344.             if toggleButtonProps["Default"] then
  345.                 toggleOn = toggleButtonProps["Default"]
  346.  
  347.                 if toggleOn == true then
  348.                     Toggle.BackgroundColor3 = toggleOnColor
  349.  
  350.                     if toggleButtonProps["Flag"] then
  351.                         lunar.Flags[toggleButtonProps["Flag"]].Value = true
  352.                     end
  353.                 elseif toggleOn == false then
  354.                     Toggle.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  355.  
  356.                     if toggleButtonProps["Flag"] then
  357.                         lunar.Flags[toggleButtonProps["Flag"]].Value = false
  358.                     end
  359.                 end
  360.             end
  361.  
  362.             Toggle.MouseButton1Click:Connect(function()
  363.                 if toggleOn == true then
  364.                     Toggle.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  365.                     toggleOn = false
  366.  
  367.                     if toggleButtonProps["Flag"] then
  368.                         lunar.Flags[toggleButtonProps["Flag"]].Value = false
  369.                     end
  370.                 elseif toggleOn == false then
  371.                     Toggle.BackgroundColor3 = toggleOnColor
  372.                     toggleOn = true
  373.  
  374.                     if toggleButtonProps["Flag"] then
  375.                         lunar.Flags[toggleButtonProps["Flag"]].Value = true
  376.                     end
  377.                 end
  378.             end)
  379.         end
  380.  
  381.         function tabFunctions:AddSlider(sliderProps)
  382.             local UIS = game:GetService("UserInputService")
  383.  
  384.  
  385.             local Slider = Instance.new("Frame")
  386.             local SliderRound = Instance.new("UICorner")
  387.             local SliderTitle = Instance.new("TextLabel")
  388.             local SliderBar = Instance.new("Frame")
  389.             local SliderRound_2 = Instance.new("UICorner")
  390.             local Target = Instance.new("TextButton")
  391.             local SliderRound_3 = Instance.new("UICorner")
  392.  
  393.             Slider.Name = "Slider"
  394.             Slider.Parent = TabContents
  395.             Slider.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  396.             Slider.Size = UDim2.new(0.899999976, 0, 0, 60)
  397.  
  398.             SliderRound.CornerRadius = UDim.new(0, 10)
  399.             SliderRound.Name = "Round"
  400.             SliderRound.Parent = Slider
  401.  
  402.             SliderTitle.Name = "Title"
  403.             SliderTitle.Parent = Slider
  404.             SliderTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  405.             SliderTitle.BackgroundTransparency = 1.000
  406.             SliderTitle.Position = UDim2.new(0, 10, 0, 0)
  407.             SliderTitle.Size = UDim2.new(0.800000012, 0, 0, 40)
  408.             SliderTitle.Font = Enum.Font.GothamBold
  409.             SliderTitle.Text = "Slider"
  410.             SliderTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  411.             SliderTitle.TextSize = 20.000
  412.             SliderTitle.TextXAlignment = Enum.TextXAlignment.Left
  413.  
  414.             SliderBar.Name = "SliderBar"
  415.             SliderBar.Parent = Slider
  416.             SliderBar.AnchorPoint = Vector2.new(0.5, 0.5)
  417.             SliderBar.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  418.             SliderBar.Position = UDim2.new(0.5, 0, 0.75, 0)
  419.             SliderBar.Size = UDim2.new(0.899999976, 0, 0.100000001, 0)
  420.  
  421.             SliderRound_2.Name = "Round"
  422.             SliderRound_2.Parent = SliderBar
  423.  
  424.             Target.Name = "Target"
  425.             Target.Parent = SliderBar
  426.             Target.AnchorPoint = Vector2.new(0, 0.5)
  427.             Target.BackgroundColor3 = Color3.fromRGB(150, 150, 150)
  428.             Target.Size = UDim2.new(0, 5, 0, 20)
  429.             Target.TextSize = 1.000
  430.             Target.Text = ""
  431.  
  432.             SliderRound_3.CornerRadius = UDim.new(0, 30)
  433.             SliderRound_3.Name = "Round"
  434.             SliderRound_3.Parent = Target
  435.  
  436.             local SliderValue = Instance.new("TextLabel")
  437.  
  438.             SliderValue.Name = "SliderValue"
  439.             SliderValue.Parent = Slider
  440.             SliderValue.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  441.             SliderValue.BackgroundTransparency = 1.000
  442.             SliderValue.Size = UDim2.new(1, 0, 0, 40)
  443.             SliderValue.Font = Enum.Font.GothamBold
  444.             SliderValue.Text = "0"
  445.             SliderValue.TextColor3 = Color3.fromRGB(255, 255, 255)
  446.             SliderValue.TextSize = 25.000
  447.  
  448.             local SliderMaximum = 50
  449.  
  450.             local dragging = false
  451.  
  452.             if sliderProps["Name"] then
  453.                 SliderTitle.Text = sliderProps["Name"]
  454.                 Slider.Name = sliderProps["Name"]
  455.             end
  456.  
  457.             if sliderProps["MaxValue"] then
  458.                 SliderMaximum = sliderProps["MaxValue"]
  459.             end
  460.  
  461.             Target.MouseButton1Down:Connect(function()
  462.                 dragging = true
  463.             end)
  464.  
  465.             UIS.InputEnded:Connect(function(input)
  466.                 if input.UserInputType == Enum.UserInputType.MouseButton1 then
  467.                     dragging = false
  468.                 end
  469.             end)
  470.  
  471.             local sliderFlag = nil
  472.  
  473.             if sliderProps["Flag"] then
  474.                 local newFlag = Instance.new("IntValue", lunar.Flags)
  475.                 newFlag.Name = sliderProps["Flag"]
  476.                 newFlag.Value = 0
  477.                 sliderFlag = newFlag
  478.             end
  479.  
  480.             if sliderProps["Default"] then
  481.                 SliderValue.Text = tostring(sliderProps["Default"])
  482.                 Target.Position.X = 1/SliderMaximum * sliderProps["Default"]
  483.                 if sliderFlag then
  484.                     sliderFlag.Value = sliderProps["Default"]
  485.                 end
  486.             end
  487.  
  488.             UIS.InputChanged:Connect(function(input)
  489.                 if input.UserInputType == Enum.UserInputType.MouseMovement then
  490.                     if dragging == true then
  491.                         local mousePos = UIS:GetMouseLocation()
  492.                         local relativePos = mousePos - Slider.AbsolutePosition
  493.                         local percentage = math.clamp(relativePos.X/SliderBar.AbsoluteSize.X,0,1)
  494.                         Target.Position = UDim2.new(percentage,0,0,0)
  495.  
  496.                         SliderValue.Text = math.round(percentage * SliderMaximum)
  497.  
  498.                         if sliderFlag then
  499.                             sliderFlag.Value = math.round(percentage * SliderMaximum)
  500.                         end
  501.                     end
  502.                 end
  503.             end)
  504.         end
  505.  
  506.         function tabFunctions:AddTextbox(tProps)
  507.             local Textbox = Instance.new("Frame")
  508.             local TextboxRound = Instance.new("UICorner")
  509.             local TextboxTitle = Instance.new("TextLabel")
  510.             local TextBoxInput = Instance.new("TextBox")
  511.             local TextboxRound_2 = Instance.new("UICorner")
  512.  
  513.             Textbox.Name = "Textbox"
  514.             Textbox.Parent = TabContents
  515.             Textbox.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  516.             Textbox.Size = UDim2.new(0.899999976, 0, 0, 60)
  517.  
  518.             TextboxRound.CornerRadius = UDim.new(0, 10)
  519.             TextboxRound.Name = "Round"
  520.             TextboxRound.Parent = Textbox
  521.  
  522.             TextboxTitle.Name = "Title"
  523.             TextboxTitle.Parent = Textbox
  524.             TextboxTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  525.             TextboxTitle.BackgroundTransparency = 1.000
  526.             TextboxTitle.Position = UDim2.new(0, 10, 0, 0)
  527.             TextboxTitle.Size = UDim2.new(0.800000012, 0, 0, 40)
  528.             TextboxTitle.Font = Enum.Font.GothamBold
  529.             TextboxTitle.Text = "TextBox"
  530.             TextboxTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  531.             TextboxTitle.TextSize = 20.000
  532.             TextboxTitle.TextXAlignment = Enum.TextXAlignment.Left
  533.  
  534.             TextBoxInput.Parent = Textbox
  535.             TextBoxInput.AnchorPoint = Vector2.new(0.5, 0.5)
  536.             TextBoxInput.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  537.             TextBoxInput.Position = UDim2.new(0.5, 0, 0.699999988, 0)
  538.             TextBoxInput.Size = UDim2.new(0.899999976, 0, 0.400000006, 0)
  539.             TextBoxInput.ClearTextOnFocus = false
  540.             TextBoxInput.Font = Enum.Font.GothamBold
  541.             TextBoxInput.PlaceholderText = "Input"
  542.             TextBoxInput.Text = ""
  543.             TextBoxInput.TextColor3 = Color3.fromRGB(255, 255, 255)
  544.             TextBoxInput.TextSize = 20.000
  545.  
  546.             TextboxRound_2.CornerRadius = UDim.new(0, 5)
  547.             TextboxRound_2.Name = "Round"
  548.             TextboxRound_2.Parent = TextBoxInput
  549.  
  550.             if tProps["Name"] then
  551.                 TextboxTitle.Text = tProps["Name"]
  552.                 TextBoxInput.Name = tProps["Name"]
  553.             end
  554.  
  555.             if tProps["PlaceholderText"] then
  556.                 TextBoxInput.PlaceholderText = tProps["PlaceholderText"]
  557.             end
  558.  
  559.             local textFlag = nil
  560.  
  561.             if tProps["Flag"] then
  562.                 local newFlag = Instance.new("StringValue", lunar.Flags)
  563.                 newFlag.Name = tProps["Flag"]
  564.                 newFlag.Value = ""
  565.                 textFlag = newFlag
  566.             end
  567.  
  568.             TextBoxInput.FocusLost:Connect(function()
  569.                 if textFlag then
  570.                     textFlag.Value = TextBoxInput.Text
  571.                 end
  572.             end)
  573.         end
  574.  
  575.         function tabFunctions:AddKeybind(kProps)
  576.             local Keybind = Instance.new("Frame")
  577.             local KeybindRound = Instance.new("UICorner")
  578.             local KeybindTitle = Instance.new("TextLabel")
  579.             local BindButton = Instance.new("TextButton")
  580.             local KeybindRound_2 = Instance.new("UICorner")
  581.  
  582.             Keybind.Name = "Keybind"
  583.             Keybind.Parent = TabContents
  584.             Keybind.BackgroundColor3 = Color3.fromRGB(75, 75, 75)
  585.             Keybind.Size = UDim2.new(0.899999976, 0, 0, 40)
  586.  
  587.             KeybindRound.CornerRadius = UDim.new(0, 10)
  588.             KeybindRound.Name = "KeybindRound"
  589.             KeybindRound.Parent = Keybind
  590.  
  591.             KeybindTitle.Name = "KeybindTItle"
  592.             KeybindTitle.Parent = Keybind
  593.             KeybindTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  594.             KeybindTitle.BackgroundTransparency = 1.000
  595.             KeybindTitle.Position = UDim2.new(0, 10, 0, 0)
  596.             KeybindTitle.Size = UDim2.new(0.800000012, 0, 1, 0)
  597.             KeybindTitle.Font = Enum.Font.GothamBold
  598.             KeybindTitle.Text = "Keybind"
  599.             KeybindTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  600.             KeybindTitle.TextSize = 20.000
  601.             KeybindTitle.TextXAlignment = Enum.TextXAlignment.Left
  602.  
  603.             BindButton.Name = "BindButton"
  604.             BindButton.Parent = Keybind
  605.             BindButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
  606.             BindButton.Position = UDim2.new(0, 325, 0, 5)
  607.             BindButton.Size = UDim2.new(0, 30, 0, 30)
  608.             BindButton.AutoButtonColor = false
  609.             BindButton.Font = Enum.Font.GothamBlack
  610.             BindButton.Text = "E"
  611.             BindButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  612.             BindButton.TextScaled = true
  613.             BindButton.TextSize = 1.000
  614.             BindButton.TextWrapped = true
  615.  
  616.             KeybindRound_2.Name = "KeybindRound"
  617.             KeybindRound_2.Parent = BindButton
  618.  
  619.             local bindFlag = nil
  620.  
  621.             if kProps["Name"] then
  622.                 KeybindTitle.Text = kProps["Name"]
  623.                 Keybind.Name = kProps["Name"]
  624.             end
  625.  
  626.             if kProps["Flag"] then
  627.                 local newFlag = Instance.new("StringValue", lunar.Flags)
  628.                 newFlag.Name = kProps["Flag"]
  629.                 newFlag.Value = ""
  630.                 bindFlag = newFlag
  631.             end
  632.  
  633.             if kProps["Default"] then
  634.                 BindButton.Text = string.sub(tostring(kProps["Default"]), 14)
  635.                 if bindFlag then
  636.                     bindFlag.Value = string.sub(tostring(kProps["Default"]), 14)
  637.                 end
  638.             end
  639.  
  640.             local UIS = game:GetService("UserInputService")
  641.  
  642.             BindButton.MouseButton1Click:Connect(function()
  643.                 BindButton.Text = "Press Key"
  644.             end)
  645.  
  646.             UIS.InputBegan:Connect(function(input)
  647.                 if input.UserInputType == Enum.UserInputType.Keyboard then
  648.                     if BindButton.Text == "Press Key" then
  649.                         BindButton.Text = string.sub(tostring(input.KeyCode), 14)
  650.  
  651.                         if bindFlag then
  652.                             bindFlag.Value = string.sub(tostring(input.KeyCode), 14)
  653.                         end
  654.                     end
  655.                 end
  656.             end)
  657.         end
  658.  
  659.         return tabFunctions
  660.     end
  661.  
  662.     return windowFunctions
  663. end
  664.  
  665. --[[
  666.  
  667. Properties:
  668.  
  669. --All flags are OPTIONAL!
  670. --If you do not put anything in the tables, the object will use defaults.
  671.  
  672.             lunar:NewWindow({
  673.                 Name - <string> The name of the window.
  674.                 Icon - <numberValue> The ID of the icon.
  675.                 OpenKey - <Enum.KeyCode> The key for opening/closing the window.
  676.             })
  677.  
  678.             Window:NewTab({
  679.                 Name - <string> The name of the tab.
  680.             })
  681.  
  682.             Tab:AddButton({
  683.                 Name - <string> The name of the button.
  684.                 Icon - <numberValue> The ID of the icon.
  685.                 PressFunction - <function> the function that fires when the button is pressed.
  686.             })
  687.  
  688.             Tab:AddToggleButton({
  689.                 Name - <string> The name of the toggle button.
  690.                 Flag - <stringValue> The name of the flag that the toggle will report to (optional)
  691.                 OnColor - <Color3_RGB> The color that shows when the toggle is on.
  692.                 Default - <boolValue> The default value of the toggle button.
  693.             })
  694.  
  695.             Tab:AddSlider({
  696.                 Name - <string> The name of the slider.
  697.                 Flag - <stringValue> The name of the flag that the slider will report to (optional)
  698.                 MaxValue - <int/numberValue> The maxmimum slider amount.
  699.                 Default - <int/numberValue> The default slider amount.
  700.             })
  701.  
  702.             Tab:AddTextbox({
  703.                 Name - <string> The name of the slider.
  704.                 Flag - <stringValue> The name of the flag that the textbox will report to (optional)
  705.                 PlaceholderText - <string> The text that appears when there is no text inputted.
  706.             })
  707.  
  708.             Tab:AddKeybind({
  709.                 Name - <string> The name of the slider.
  710.                 Flag - <stringValue> The name of the flag that the bind will report to (optional)
  711.                 Default - <Enum.KeyCode> The default value of the keybind.
  712.             })
  713.  
  714. ]]--
  715.  
  716. --made by nick // thank you for using lunar!--
  717.  
  718. return lunar
  719.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement