Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- made by samet (joestar._3 on discord)
- -- https://discord.gg/VhvTd5HV8d
- -- example at bottom
- if getgenv().Library then
- getgenv().Library:Unload()
- end
- local Library do
- local Workspace = game:GetService("Workspace")
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local HttpService = game:GetService("HttpService")
- local RunService = game:GetService("RunService")
- local CoreGui = cloneref and cloneref(game:GetService("CoreGui")) or game:GetService("CoreGui")
- local TweenService = game:GetService("TweenService")
- gethui = gethui or function()
- return CoreGui
- end
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- local FromRGB = Color3.fromRGB
- local FromHSV = Color3.fromHSV
- local FromHex = Color3.fromHex
- local RGBSequence = ColorSequence.new
- local RGBSequenceKeypoint = ColorSequenceKeypoint.new
- local UDim2New = UDim2.new
- local UDimNew = UDim.new
- local Vector2New = Vector2.new
- local MathClamp = math.clamp
- local MathFloor = math.floor
- local TableInsert = table.insert
- local TableFind = table.find
- local TableRemove = table.remove
- local TableConcat = table.concat
- local TableClone = table.clone
- local TableUnpack = table.unpack
- local StringFormat = string.format
- local StringFind = string.find
- local StringGSub = string.gsub
- local StringLen = string.len
- local StringSub = string.sub
- local InstanceNew = Instance.new
- Library = {
- Theme = { },
- MenuKeybind = tostring(Enum.KeyCode.Z),
- Flags = { },
- Tween = {
- Time = 0.4,
- Style = Enum.EasingStyle.Quint,
- Direction = Enum.EasingDirection.Out
- },
- FadeSpeed = 0.2,
- Folders = {
- Directory = "esdeeeeee",
- Configs = "esdeeeeee/Configs",
- Assets = "esdeeeeee/Assets",
- Autoload = "esdeeeeee/Autoload",
- },
- -- Ignore below
- Pages = { },
- Sections = { },
- Connections = { },
- Threads = { },
- ThemeMap = { },
- ThemeItems = { },
- OpenFrames = { },
- SetFlags = { },
- UnnamedConnections = 0,
- UnnamedFlags = 0,
- Holder = nil,
- NotifHolder = nil,
- UnusedHolder = nil,
- Font = nil
- }
- local Keys = {
- ["Unknown"] = "Unknown",
- ["Backspace"] = "Back",
- ["Tab"] = "Tab",
- ["Clear"] = "Clear",
- ["Return"] = "Return",
- ["Pause"] = "Pause",
- ["Escape"] = "Escape",
- ["Space"] = "Space",
- ["QuotedDouble"] = '"',
- ["Hash"] = "#",
- ["Dollar"] = "$",
- ["Percent"] = "%",
- ["Ampersand"] = "&",
- ["Quote"] = "'",
- ["LeftParenthesis"] = "(",
- ["RightParenthesis"] = " )",
- ["Asterisk"] = "*",
- ["Plus"] = "+",
- ["Comma"] = ",",
- ["Minus"] = "-",
- ["Period"] = ".",
- ["Slash"] = "`",
- ["Three"] = "3",
- ["Seven"] = "7",
- ["Eight"] = "8",
- ["Colon"] = ":",
- ["Semicolon"] = ";",
- ["LessThan"] = "<",
- ["GreaterThan"] = ">",
- ["Question"] = "?",
- ["Equals"] = "=",
- ["At"] = "@",
- ["LeftBracket"] = "LeftBracket",
- ["RightBracket"] = "RightBracked",
- ["BackSlash"] = "BackSlash",
- ["Caret"] = "^",
- ["Underscore"] = "_",
- ["Backquote"] = "`",
- ["LeftCurly"] = "{",
- ["Pipe"] = "|",
- ["RightCurly"] = "}",
- ["Tilde"] = "~",
- ["Delete"] = "Delete",
- ["End"] = "End",
- ["KeypadZero"] = "Keypad0",
- ["KeypadOne"] = "Keypad1",
- ["KeypadTwo"] = "Keypad2",
- ["KeypadThree"] = "Keypad3",
- ["KeypadFour"] = "Keypad4",
- ["KeypadFive"] = "Keypad5",
- ["KeypadSix"] = "Keypad6",
- ["KeypadSeven"] = "Keypad7",
- ["KeypadEight"] = "Keypad8",
- ["KeypadNine"] = "Keypad9",
- ["KeypadPeriod"] = "KeypadP",
- ["KeypadDivide"] = "KeypadD",
- ["KeypadMultiply"] = "KeypadM",
- ["KeypadMinus"] = "KeypadM",
- ["KeypadPlus"] = "KeypadP",
- ["KeypadEnter"] = "KeypadE",
- ["KeypadEquals"] = "KeypadE",
- ["Insert"] = "Insert",
- ["Home"] = "Home",
- ["PageUp"] = "PageUp",
- ["PageDown"] = "PageDown",
- ["RightShift"] = "RightShift",
- ["LeftShift"] = "LeftShift",
- ["RightControl"] = "RightControl",
- ["LeftControl"] = "LeftControl",
- ["LeftAlt"] = "LeftAlt",
- ["RightAlt"] = "RightAlt"
- }
- local Themes = {
- ["Preset"] = {
- ["Background"] = FromRGB(16, 18, 18),
- ["Inline"] = FromRGB(21, 24, 24),
- ["Element"] = FromRGB(30, 34, 34),
- ["Accent"] = FromRGB(255, 255, 255),
- ["Border"] = FromRGB(30, 34, 34),
- ["Border 2"] = FromRGB(56, 62, 62)
- }
- }
- Library.__index = Library
- Library.Sections.__index = Library.Sections
- Library.Pages.__index = Library.Pages
- Library.Theme = TableClone(Themes["Preset"])
- -- Folders
- for Index, Value in Library.Folders do
- if not isfolder(Value) then
- makefolder(Value)
- end
- end
- -- Tweening
- local Tween = { } do
- Tween.__index = Tween
- Tween.Create = function(self, Item, Info, Goal, IsRawItem)
- Item = IsRawItem and Item or Item.Instance
- Info = Info or TweenInfo.new(Library.Tween.Time, Library.Tween.Style, Library.Tween.Direction)
- local NewTween = {
- Tween = TweenService:Create(Item, Info, Goal),
- Info = Info,
- Goal = Goal,
- Item = Item
- }
- NewTween.Tween:Play()
- setmetatable(NewTween, Tween)
- return NewTween
- end
- Tween.GetProperty = function(self, Item)
- Item = Item or self.Item
- if Item:IsA("Frame") then
- return { "BackgroundTransparency" }
- elseif Item:IsA("TextLabel") or Item:IsA("TextButton") then
- return { "TextTransparency", "BackgroundTransparency" }
- elseif Item:IsA("ImageLabel") or Item:IsA("ImageButton") then
- return { "BackgroundTransparency", "ImageTransparency" }
- elseif Item:IsA("ScrollingFrame") then
- return { "BackgroundTransparency", "ScrollBarImageTransparency" }
- elseif Item:IsA("TextBox") then
- return { "TextTransparency", "BackgroundTransparency" }
- elseif Item:IsA("UIStroke") then
- return { "Transparency" }
- end
- end
- Tween.FadeItem = function(self, Item, Property, Visibility, Speed)
- local Item = Item or self.Item
- local OldTransparency = Item[Property]
- Item[Property] = Visibility and 1 or OldTransparency
- local NewTween = Tween:Create(Item, TweenInfo.new(Speed or Library.Tween.Time, Library.Tween.Style, Library.Tween.Direction), {
- [Property] = Visibility and OldTransparency or 1
- }, true)
- Library:Connect(NewTween.Tween.Completed, function()
- if not Visibility then
- task.wait()
- Item[Property] = OldTransparency
- end
- end)
- return NewTween
- end
- Tween.Get = function(self)
- if not self.Tween then
- return
- end
- return self.Tween, self.Info, self.Goal
- end
- Tween.Pause = function(self)
- if not self.Tween then
- return
- end
- self.Tween:Pause()
- end
- Tween.Play = function(self)
- if not self.Tween then
- return
- end
- self.Tween:Play()
- end
- Tween.Clean = function(self)
- if not self.Tween then
- return
- end
- Tween:Pause()
- self = nil
- end
- end
- -- Instances
- local Instances = { } do
- Instances.__index = Instances
- Instances.Create = function(self, Class, Properties)
- local NewItem = {
- Instance = InstanceNew(Class),
- Properties = Properties,
- Class = Class
- }
- setmetatable(NewItem, Instances)
- for Property, Value in NewItem.Properties do
- NewItem.Instance[Property] = Value
- end
- return NewItem
- end
- Instances.AddToTheme = function(self, Properties)
- if not self.Instance then
- return
- end
- Library:AddToTheme(self, Properties)
- end
- Instances.ChangeItemTheme = function(self, Properties)
- if not self.Instance then
- return
- end
- Library:ChangeItemTheme(self, Properties)
- end
- Instances.Connect = function(self, Event, Callback, Name)
- if not self.Instance then
- return
- end
- if not self.Instance[Event] then
- return
- end
- return Library:Connect(self.Instance[Event], Callback, Name)
- end
- Instances.Tween = function(self, Info, Goal)
- if not self.Instance then
- return
- end
- return Tween:Create(self, Info, Goal)
- end
- Instances.Disconnect = function(self, Name)
- if not self.Instance then
- return
- end
- return Library:Disconnect(Name)
- end
- Instances.Clean = function(self)
- if not self.Instance then
- return
- end
- self.Instance:Destroy()
- self = nil
- end
- Instances.MakeDraggable = function(self)
- if not self.Instance then
- return
- end
- local Gui = self.Instance
- local Dragging = false
- local DragStart
- local StartPosition
- local Set = function(Input)
- local DragDelta = Input.Position - DragStart
- self:Tween(TweenInfo.new(0.16, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(StartPosition.X.Scale, StartPosition.X.Offset + DragDelta.X, StartPosition.Y.Scale, StartPosition.Y.Offset + DragDelta.Y)})
- end
- local InputChanged
- self:Connect("InputBegan", function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- Dragging = true
- DragStart = Input.Position
- StartPosition = Gui.Position
- if InputChanged then
- return
- end
- InputChanged = Input.Changed:Connect(function()
- if Input.UserInputState == Enum.UserInputState.End then
- Dragging = false
- InputChanged:Disconnect()
- InputChanged = nil
- end
- end)
- end
- end)
- Library:Connect(UserInputService.InputChanged, function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
- if Dragging then
- Set(Input)
- end
- end
- end)
- return Dragging
- end
- Instances.MakeResizeable = function(self, Minimum, Maximum)
- if not self.Instance then
- return
- end
- local Gui = self.Instance
- local Resizing = false
- local Start = UDim2New()
- local Delta = UDim2New()
- local ResizeMax = Gui.Parent.AbsoluteSize - Gui.AbsoluteSize
- local ResizeButton = Instances:Create("ImageButton", {
- Parent = Gui,
- Image = "rbxassetid://",
- AnchorPoint = Vector2New(1, 1),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 8, 0, 8),
- Position = UDim2New(1, -4, 1, -4),
- Name = "\0",
- BorderSizePixel = 0,
- BackgroundTransparency = 1,
- ZIndex = 5,
- AutoButtonColor = false,
- Visible = true,
- }) ResizeButton:AddToTheme({ImageColor3 = "Accent"})
- local InputChanged
- ResizeButton:Connect("InputBegan", function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- Resizing = true
- Start = Gui.Size - UDim2New(0, Input.Position.X, 0, Input.Position.Y)
- if InputChanged then
- return
- end
- InputChanged = Input.Changed:Connect(function()
- if Input.UserInputState == Enum.UserInputState.End then
- Resizing = false
- InputChanged:Disconnect()
- InputChanged = nil
- end
- end)
- end
- end)
- Library:Connect(UserInputService.InputChanged, function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
- if Resizing then
- ResizeMax = Maximum or Gui.Parent.AbsoluteSize - Gui.AbsoluteSize
- Delta = Start + UDim2New(0, Input.Position.X, 0, Input.Position.Y)
- Delta = UDim2New(0, math.clamp(Delta.X.Offset, Minimum.X, ResizeMax.X), 0, math.clamp(Delta.Y.Offset, Minimum.Y, ResizeMax.Y))
- Tween:Create(Gui, TweenInfo.new(0.17, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = Delta}, true)
- end
- end
- end)
- return Resizing
- end
- Instances.OnHover = function(self, Function)
- if not self.Instance then
- return
- end
- return Library:Connect(self.Instance.MouseEnter, Function)
- end
- Instances.OnHoverLeave = function(self, Function)
- if not self.Instance then
- return
- end
- return Library:Connect(self.Instance.MouseLeave, Function)
- end
- end
- -- Custom font
- local CustomFont = { } do
- function CustomFont:New(Name, Weight, Style, Data)
- if not isfile(Data.Id) then
- writefile(Data.Id, game:HttpGet(Data.Url))
- end
- local Data = {
- name = Name,
- faces = {
- {
- name = Name,
- weight = Weight,
- style = Style,
- assetId = getcustomasset(Data.Id)
- }
- }
- }
- writefile(`{Library.Folders.Fonts}/{Name}.font`, HttpService:JSONEncode(Data))
- return Font.new(getcustomasset(`{Library.Folders.Fonts}/{Name}.font`), Enum.FontWeight.Regular, Enum.FontStyle.Normal)
- end
- Library.Font = CustomFont:New("InterSemiBold", "Regular", "Normal", {
- Id = "Inter",
- Url = "https://github.com/sametexe001/luas/raw/refs/heads/main/fonts/InterSemibold.ttf"
- })
- end
- Library.Holder = Instances:Create("ScreenGui", {
- Parent = gethui(),
- Name = "\0",
- ZIndexBehavior = Enum.ZIndexBehavior.Global,
- DisplayOrder = 2,
- ResetOnSpawn = false
- })
- Library.UnusedHolder = Instances:Create("ScreenGui", {
- Parent = gethui(),
- Name = "\0",
- ZIndexBehavior = Enum.ZIndexBehavior.Global,
- Enabled = false,
- ResetOnSpawn = false
- })
- Library.NotifHolder = Instances:Create("Frame", {
- Parent = Library.Holder.Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- Size = UDim2New(0, 0, 1, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIListLayout", {
- Parent = Library.NotifHolder.Instance,
- Name = "\0",
- Padding = UDimNew(0, 12),
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- Instances:Create("UIPadding", {
- Parent = Library.NotifHolder.Instance,
- Name = "\0",
- PaddingTop = UDimNew(0, 12),
- PaddingBottom = UDimNew(0, 12),
- PaddingRight = UDimNew(0, 12),
- PaddingLeft = UDimNew(0, 12)
- })
- Library.Unload = function(self)
- for Index, Value in self.Connections do
- Value.Connection:Disconnect()
- end
- for Index, Value in self.Threads do
- coroutine.close(Value)
- end
- if self.Holder then
- self.Holder:Clean()
- end
- Library = nil
- getgenv().Library = nil
- end
- Library.GetImage = function(self, Image)
- local ImageData = self.Images[Image]
- if not ImageData then
- return
- end
- return getcustomasset(self.Folders.Assets .. "/" .. ImageData[1])
- end
- Library.Round = function(self, Number, Float)
- local Multiplier = 1 / (Float or 1)
- return MathFloor(Number * Multiplier) / Multiplier
- end
- Library.Thread = function(self, Function)
- local NewThread = coroutine.create(Function)
- coroutine.wrap(function()
- coroutine.resume(NewThread)
- end)()
- TableInsert(self.Threads, NewThread)
- return NewThread
- end
- Library.SafeCall = function(self, Function, ...)
- local Arguements = { ... }
- local Success, Result = pcall(Function, TableUnpack(Arguements))
- if not Success then
- warn(Result)
- return false
- end
- return Success
- end
- Library.Connect = function(self, Event, Callback, Name)
- Name = Name or StringFormat("connection_number_%s_%s", self.UnnamedConnections + 1, HttpService:GenerateGUID(false))
- local NewConnection = {
- Event = Event,
- Callback = Callback,
- Name = Name,
- Connection = nil
- }
- Library:Thread(function()
- NewConnection.Connection = Event:Connect(Callback)
- end)
- TableInsert(self.Connections, NewConnection)
- return NewConnection
- end
- Library.Disconnect = function(self, Name)
- for _, Connection in self.Connections do
- if Connection.Name == Name then
- Connection.Connection:Disconnect()
- break
- end
- end
- end
- Library.NextFlag = function(self)
- local FlagNumber = self.UnnamedFlags + 1
- return StringFormat("flag_number_%s_%s", FlagNumber, HttpService:GenerateGUID(false))
- end
- Library.AddToTheme = function(self, Item, Properties)
- Item = Item.Instance or Item
- local ThemeData = {
- Item = Item,
- Properties = Properties,
- }
- for Property, Value in ThemeData.Properties do
- if type(Value) == "string" then
- Item[Property] = self.Theme[Value]
- else
- Item[Property] = Value()
- end
- end
- TableInsert(self.ThemeItems, ThemeData)
- self.ThemeMap[Item] = ThemeData
- end
- Library.ToRich = function(self, Text, Color)
- return `<font color="rgb({MathFloor(Color.R * 255)}, {MathFloor(Color.G * 255)}, {MathFloor(Color.B * 255)})">{Text}</font>`
- end
- Library.GetConfig = function(self)
- local Config = { }
- local Success, Result = Library:SafeCall(function()
- for Index, Value in Library.Flags do
- if type(Value) == "table" and Value.Key then
- Config[Index] = {Key = tostring(Value.Key), Mode = Value.Mode}
- elseif type(Value) == "table" and Value.Color then
- Config[Index] = {Color = "#" .. Value.HexValue, Alpha = Value.Alpha}
- else
- Config[Index] = Value
- end
- end
- end)
- return HttpService:JSONEncode(Config)
- end
- Library.LoadConfig = function(self, Config)
- local Decoded = HttpService:JSONDecode(Config)
- local Success, Result = Library:SafeCall(function()
- for Index, Value in Decoded do
- local SetFunction = Library.SetFlags[Index]
- if not SetFunction then
- continue
- end
- if type(Value) == "table" and Value.Key then
- SetFunction(Value)
- elseif type(Value) == "table" and Value.Color then
- SetFunction(Value.Color, Value.Alpha)
- else
- SetFunction(Value)
- end
- end
- end)
- return Success, Result
- end
- Library.DeleteConfig = function(self, Config)
- if isfile(Library.Folders.Configs .. "/" .. Config) then
- delfile(Library.Folders.Configs .. "/" .. Config)
- end
- end
- Library.RefreshConfigsList = function(self, Elements)
- local List = { "None" }
- for _, Value in listfiles(Library.Folders.Configs) do
- local FileName = string.match(Value, "[^\\/]+$")
- table.insert(List, FileName)
- end
- for _, Element in Elements do
- Element:Refresh(List)
- end
- end
- Library.ChangeItemTheme = function(self, Item, Properties)
- Item = Item.Instance or Item
- if not self.ThemeMap[Item] then
- return
- end
- self.ThemeMap[Item].Properties = Properties
- self.ThemeMap[Item] = self.ThemeMap[Item]
- end
- Library.ChangeTheme = function(self, Theme, Color)
- self.Theme[Theme] = Color
- for _, Item in self.ThemeItems do
- for Property, Value in Item.Properties do
- if type(Value) == "string" and Value == Theme then
- Item.Item[Property] = Color
- elseif type(Value) == "function" then
- Item.Item[Property] = Value()
- end
- end
- end
- end
- Library.IsMouseOverFrame = function(self, Frame)
- Frame = Frame.Instance
- local MousePosition = Vector2New(Mouse.X, Mouse.Y)
- return MousePosition.X >= Frame.AbsolutePosition.X and MousePosition.X <= Frame.AbsolutePosition.X + Frame.AbsoluteSize.X
- and MousePosition.Y >= Frame.AbsolutePosition.Y and MousePosition.Y <= Frame.AbsolutePosition.Y + Frame.AbsoluteSize.Y
- end
- Library.Lerp = function(self, Start, Finish, Time)
- return Start + (Finish - Start) * Time
- end
- Library.CompareVectors = function(self, PointA, PointB)
- return (PointA.X < PointB.X) or (PointA.Y < PointB.Y)
- end
- Library.IsClipped = function(self, Object, Column)
- local Parent = Column
- local BoundryTop = Parent.AbsolutePosition
- local BoundryBottom = BoundryTop + Parent.AbsoluteSize
- local Top = Object.AbsolutePosition
- local Bottom = Top + Object.AbsoluteSize
- return Library:CompareVectors(Top, BoundryTop) or Library:CompareVectors(BoundryBottom, Bottom)
- end
- do
- Library.CreateColorpicker = function(self, Data)
- local Colorpicker = {
- Hue = 0,
- Saturation = 0,
- Value = 0,
- Color = FromRGB(0, 0, 0),
- HexValue = "000000",
- Flag = Data.Flag,
- IsOpen = false
- }
- local Items = { } do
- Items["ColorpickerButton"] = Instances:Create("TextButton", {
- Parent = Data.Parent.Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- AutoButtonColor = false,
- Size = UDim2New(0, 14, 0, 14),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(164, 229, 255)
- })
- Instances:Create("UIStroke", {
- Parent = Items["ColorpickerButton"].Instance,
- Name = "\0",
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
- Color = FromRGB(56, 62, 62),
- Thickness = 1.5
- }):AddToTheme({Color = "Border 2"})
- Instances:Create("UICorner", {
- Parent = Items["ColorpickerButton"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Items["ColorpickerWindow"] = Instances:Create("Frame", {
- Parent = Library.UnusedHolder.Instance,
- Name = "\0",
- Visible = false,
- Position = UDim2New(0, 115, 0, 102),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 200, 0, 220),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(16, 18, 18)
- }) Items["ColorpickerWindow"]:AddToTheme({BackgroundColor3 = "Background"})
- Instances:Create("UICorner", {
- Parent = Items["ColorpickerWindow"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Inline"] = Instances:Create("Frame", {
- Parent = Items["ColorpickerWindow"].Instance,
- Name = "\0",
- Position = UDim2New(0, 6, 0, 6),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, -12, 1, -12),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Inline"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UIStroke", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Instances:Create("UICorner", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Palette"] = Instances:Create("TextButton", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "-,",
- AutoButtonColor = false,
- Position = UDim2New(0, 6, 0, 6),
- Size = UDim2New(1, -12, 1, -45),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(164, 229, 255)
- })
- Instances:Create("UICorner", {
- Parent = Items["Palette"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Palette"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["Saturation"] = Instances:Create("ImageLabel", {
- Parent = Items["Palette"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- Image = "rbxassetid://130624743341203",
- BackgroundTransparency = 1,
- Size = UDim2New(1, 0, 1, 0),
- ZIndex = 2,
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UICorner", {
- Parent = Items["Saturation"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Value"] = Instances:Create("ImageLabel", {
- Parent = Items["Palette"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 2, 1, 0),
- Image = "rbxassetid://96192970265863",
- BackgroundTransparency = 1,
- Position = UDim2New(0, -1, 0, 0),
- ZIndex = 3,
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UICorner", {
- Parent = Items["Value"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["PaletteDragger"] = Instances:Create("Frame", {
- Parent = Items["Palette"].Instance,
- Name = "\0",
- Size = UDim2New(0, 5, 0, 5),
- Position = UDim2New(0, 5, 0, 5),
- BorderColor3 = FromRGB(0, 0, 0),
- ZIndex = 3,
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UICorner", {
- Parent = Items["PaletteDragger"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(1, 0)
- })
- Instances:Create("UIStroke", {
- Parent = Items["PaletteDragger"].Instance,
- Name = "\0",
- Color = FromRGB(120, 120, 120),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
- Thickness = 1.5
- })
- Items["Hue"] = Instances:Create("TextButton", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- AutoButtonColor = false,
- AnchorPoint = Vector2New(0, 1),
- Position = UDim2New(0, 6, 1, -6),
- Size = UDim2New(1, -12, 0, 22),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UICorner", {
- Parent = Items["Hue"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Hue"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Instances:Create("UIGradient", {
- Parent = Items["Hue"].Instance,
- Name = "\0",
- Color = RGBSequence{RGBSequenceKeypoint(0, FromRGB(255, 0, 0)), RGBSequenceKeypoint(0.17, FromRGB(255, 255, 0)), RGBSequenceKeypoint(0.33, FromRGB(0, 255, 0)), RGBSequenceKeypoint(0.5, FromRGB(0, 255, 255)), RGBSequenceKeypoint(0.67, FromRGB(0, 0, 255)), RGBSequenceKeypoint(0.83, FromRGB(255, 0, 255)), RGBSequenceKeypoint(1, FromRGB(255, 0, 0))}
- })
- Items["HueDragger"] = Instances:Create("Frame", {
- Parent = Items["Hue"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 3, 1, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIStroke", {
- Parent = Items["HueDragger"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- end
- local Debounce = false
- local RenderStepped
- function Colorpicker:Get()
- return Colorpicker.Color
- end
- function Colorpicker:SetVisibility(Bool)
- Items["ColorpickerButton"].Instance.Visible = Bool
- end
- function Colorpicker:SetOpen(Bool)
- if Debounce then
- return
- end
- Colorpicker.IsOpen = Bool
- Debounce = true
- if Colorpicker.IsOpen then
- Items["ColorpickerWindow"].Instance.Visible = true
- Items["ColorpickerWindow"].Instance.Parent = Library.Holder.Instance
- RenderStepped = RunService.RenderStepped:Connect(function()
- Items["ColorpickerWindow"].Instance.Position = UDim2New(0, Items["ColorpickerButton"].Instance.AbsolutePosition.X + 18, 0, Items["ColorpickerButton"].Instance.AbsolutePosition.Y - 25)
- end)
- for Index, Value in Library.OpenFrames do
- if not Data.Section.IsSettings then
- Value:SetOpen(false)
- end
- end
- Library.OpenFrames[Colorpicker] = Colorpicker
- else
- if Library.OpenFrames[Colorpicker] then
- Library.OpenFrames[Colorpicker] = nil
- end
- if RenderStepped then
- RenderStepped:Disconnect()
- RenderStepped = nil
- end
- end
- local Descendants = Items["ColorpickerWindow"].Instance:GetDescendants()
- TableInsert(Descendants, Items["ColorpickerWindow"].Instance)
- local NewTween
- for Index, Value in Descendants do
- local TransparencyProperty = Tween:GetProperty(Value)
- if not TransparencyProperty then
- continue
- end
- if not Value.ClassName:find("UI") then
- Value.ZIndex = Colorpicker.IsOpen and 4 or 1
- end
- if type(TransparencyProperty) == "table" then
- for _, Property in TransparencyProperty do
- NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
- end
- else
- NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
- end
- end
- NewTween.Tween.Completed:Connect(function()
- Debounce = false
- Items["ColorpickerWindow"].Instance.Visible = Colorpicker.IsOpen
- task.wait(0.2)
- Items["ColorpickerWindow"].Instance.Parent = not Colorpicker.IsOpen and Library.UnusedHolder.Instance or Library.Holder.Instance
- end)
- end
- function Colorpicker:Update()
- local Hue, Saturation, Value = Colorpicker.Hue, Colorpicker.Saturation, Colorpicker.Value
- Colorpicker.Color = FromHSV(Hue, Saturation, Value)
- Colorpicker.HexValue = Colorpicker.Color:ToHex()
- Library.Flags[Colorpicker.Flag] = {
- Color = Colorpicker.Color,
- HexValue = Colorpicker.HexValue,
- }
- Items["ColorpickerButton"]:Tween(nil, {BackgroundColor3 = Colorpicker.Color})
- Items["Palette"]:Tween(nil, {BackgroundColor3 = FromHSV(Hue, 1, 1)})
- if Data.Callback then
- Library:SafeCall(Data.Callback, Colorpicker.Color, Colorpicker.Alpha)
- end
- end
- local SlidingPalette = false
- local PaletteChanged
- function Colorpicker:SlidePalette(Input)
- if not Input or not SlidingPalette then
- return
- end
- local InputPosition = Input.Position
- local AbsolutePosition = Items["Palette"].Instance.AbsolutePosition
- local AbsoluteSize = Items["Palette"].Instance.AbsoluteSize
- local ValueX = MathClamp((InputPosition.X - AbsolutePosition.X) / AbsoluteSize.X, 0, 1)
- local ValueY = MathClamp((InputPosition.Y - AbsolutePosition.Y) / AbsoluteSize.Y, 0, 1)
- Colorpicker.Saturation = ValueX
- Colorpicker.Value = 1 - ValueY
- local SlideX = MathClamp((InputPosition.X - AbsolutePosition.X) / AbsoluteSize.X, 0, 0.98)
- local SlideY = MathClamp((InputPosition.Y - AbsolutePosition.Y) / AbsoluteSize.Y, 0, 0.98)
- Items["PaletteDragger"]:Tween(TweenInfo.new(0.1, Enum.EasingStyle.Linear), {Position = UDim2New(SlideX, 0, SlideY, 0)})
- Colorpicker:Update()
- end
- local SlidingHue = false
- local HueChanged
- function Colorpicker:SlideHue(Input)
- if not Input or not SlidingHue then
- return
- end
- local InputPosition = Input.Position
- local AbsolutePosition = Items["Hue"].Instance.AbsolutePosition
- local AbsoluteSize = Items["Hue"].Instance.AbsoluteSize
- local ValueX = MathClamp((InputPosition.X - AbsolutePosition.X) / AbsoluteSize.X, 0, 1)
- Colorpicker.Hue = ValueX
- local SlideX = MathClamp((InputPosition.X - AbsolutePosition.X) / AbsoluteSize.X, 0, 0.995)
- Items["HueDragger"]:Tween(TweenInfo.new(0.1, Enum.EasingStyle.Linear), {Position = UDim2New(SlideX, 0, 0, 0)})
- Colorpicker:Update()
- end
- function Colorpicker:Set(Color, Alpha)
- if type(Color) == "table" then
- Color = FromRGB(Color[1], Color[2], Color[3])
- Alpha = Color[4]
- elseif type(Color) == "string" then
- Color = FromHex(Color)
- end
- Colorpicker.Hue, Colorpicker.Saturation, Colorpicker.Value = Color:ToHSV()
- Colorpicker.Alpha = Alpha or 0
- local PaletteValueX = MathClamp(Colorpicker.Saturation, 0, 0.98)
- local PaletteValueY = MathClamp(1 - Colorpicker.Value, 0, 0.98)
- local HuePositionX = MathClamp(Colorpicker.Hue, 0, 0.99)
- Items["PaletteDragger"]:Tween(TweenInfo.new(0.35, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(PaletteValueX, 0, PaletteValueY, 0)})
- Items["HueDragger"]:Tween(TweenInfo.new(0.35, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(HuePositionX, 0, 0, 0)})
- Colorpicker:Update()
- end
- Items["ColorpickerButton"]:Connect("MouseButton1Down", function()
- Colorpicker:SetOpen(not Colorpicker.IsOpen)
- end)
- Items["ColorpickerButton"]:Connect("TouchTap", function()
- Colorpicker:SetOpen(not Colorpicker.IsOpen)
- end)
- local function OnPaletteInputBegan(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- SlidingPalette = true
- Colorpicker:SlidePalette(Input)
- if PaletteChanged then
- return
- end
- PaletteChanged = Input.Changed:Connect(function()
- if Input.UserInputState == Enum.UserInputState.End then
- SlidingPalette = false
- PaletteChanged:Disconnect()
- PaletteChanged = nil
- end
- end)
- end
- end
- Items["Palette"]:Connect("InputBegan", OnPaletteInputBegan)
- local function OnHueInputBegan(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- SlidingHue = true
- Colorpicker:SlideHue(Input)
- if HueChanged then
- return
- end
- HueChanged = Input.Changed:Connect(function()
- if Input.UserInputState == Enum.UserInputState.End then
- SlidingHue = false
- HueChanged:Disconnect()
- HueChanged = nil
- end
- end)
- end
- end
- Items["Hue"]:Connect("InputBegan", OnHueInputBegan)
- Library:Connect(UserInputService.InputBegan, function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- if Colorpicker.IsOpen then
- if Library:IsMouseOverFrame(Items["ColorpickerWindow"]) then
- return
- end
- Colorpicker:SetOpen(false)
- end
- end
- end)
- Library:Connect(UserInputService.InputChanged, function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
- if SlidingPalette then
- Colorpicker:SlidePalette(Input)
- end
- if SlidingHue then
- Colorpicker:SlideHue(Input)
- end
- end
- end)
- Items["ColorpickerButton"]:Connect("Changed", function(Property)
- if Property == "AbsolutePosition" and Colorpicker.IsOpen then
- Colorpicker.IsOpen = not Library:IsClipped(Items["ColorpickerButton"].Instance, Data.Section.Items["Section"].Instance.Parent)
- Items["ColorpickerWindow"].Instance.Visible = Colorpicker.IsOpen
- end
- end)
- if Data.Default then
- Colorpicker:Set(Data.Default)
- end
- Library.SetFlags[Colorpicker.Flag] = function(Color, Alpha)
- Colorpicker:Set(Color, Alpha)
- end
- return Colorpicker, Items
- end
- Library.CreateKeybind = function(self, Data)
- local Keybind = {
- Flag = Data.Flag,
- Key = "",
- Value = "",
- Mode = "",
- Toggled = false,
- Picking = false,
- IsOpen = false
- }
- local Items = { } do
- Items["KeyButton"] = Instances:Create("TextButton", {
- Parent = Data.Parent.Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "-",
- AutoButtonColor = false,
- Size = UDim2New(0, 0, 1, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 12,
- BackgroundColor3 = FromRGB(30, 34, 34)
- }) Items["KeyButton"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UICorner", {
- Parent = Items["KeyButton"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Instances:Create("UIPadding", {
- Parent = Items["KeyButton"].Instance,
- Name = "\0",
- PaddingRight = UDimNew(0, 4),
- PaddingLeft = UDimNew(0, 5)
- })
- Items["KeybindWindow"] = Instances:Create("Frame", {
- Parent = Library.UnusedHolder.Instance,
- Name = "\0",
- Visible = false,
- Position = UDim2New(0, 231, 0, 102),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 67, 0, 92),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(16, 18, 18)
- }) Items["KeybindWindow"]:AddToTheme({BackgroundColor3 = "Background"})
- Instances:Create("UICorner", {
- Parent = Items["KeybindWindow"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Inline"] = Instances:Create("Frame", {
- Parent = Items["KeybindWindow"].Instance,
- Name = "\0",
- Position = UDim2New(0, 6, 0, 6),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, -12, 1, -12),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Inline"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UIStroke", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Instances:Create("UICorner", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Toggle"] = Instances:Create("TextButton", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "Toggle",
- AutoButtonColor = false,
- BackgroundTransparency = 1,
- Size = UDim2New(1, 0, 0, 20),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIListLayout", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- Padding = UDimNew(0, 5),
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- Instances:Create("UIPadding", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- PaddingTop = UDimNew(0, 4)
- })
- Items["Hold"] = Instances:Create("TextButton", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "Hold",
- AutoButtonColor = false,
- BackgroundTransparency = 1,
- Size = UDim2New(1, 0, 0, 20),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Always"] = Instances:Create("TextButton", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "Always",
- AutoButtonColor = false,
- BackgroundTransparency = 1,
- Size = UDim2New(1, 0, 0, 20),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- end
- local Modes = {
- ["Always"] = Items["Always"],
- ["Hold"] = Items["Hold"],
- ["Toggle"] = Items["Toggle"]
- }
- local Debounce = false
- local RenderStepped
- function Keybind:SetOpen(Bool)
- if Debounce then
- return
- end
- Keybind.IsOpen = Bool
- Debounce = true
- if Keybind.IsOpen then
- Items["KeybindWindow"].Instance.Visible = true
- Items["KeybindWindow"].Instance.Parent = Library.Holder.Instance
- RenderStepped = RunService.RenderStepped:Connect(function()
- Items["KeybindWindow"].Instance.Position = UDim2New(0, Items["KeyButton"].Instance.AbsolutePosition.X + 18, 0, Items["KeyButton"].Instance.AbsolutePosition.Y - 25)
- end)
- for Index, Value in Library.OpenFrames do
- if not Data.Section.IsSettings then
- Value:SetOpen(false)
- end
- end
- Library.OpenFrames[Keybind] = Keybind
- else
- if Library.OpenFrames[Keybind] then
- Library.OpenFrames[Keybind] = nil
- end
- if RenderStepped then
- RenderStepped:Disconnect()
- RenderStepped = nil
- end
- end
- local Descendants = Items["KeybindWindow"].Instance:GetDescendants()
- TableInsert(Descendants, Items["KeybindWindow"].Instance)
- local NewTween
- for Index, Value in Descendants do
- local TransparencyProperty = Tween:GetProperty(Value)
- if not TransparencyProperty then
- continue
- end
- if not Value.ClassName:find("UI") then
- Value.ZIndex = Keybind.IsOpen and 2 or 1
- end
- if type(TransparencyProperty) == "table" then
- for _, Property in TransparencyProperty do
- NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
- end
- else
- NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
- end
- end
- NewTween.Tween.Completed:Connect(function()
- Debounce = false
- Items["KeybindWindow"].Instance.Visible = Keybind.IsOpen
- task.wait(0.2)
- Items["KeybindWindow"].Instance.Parent = not Keybind.IsOpen and Library.UnusedHolder.Instance or Library.Holder.Instance
- end)
- end
- function Keybind:SetMode(Mode)
- for Index, Value in Modes do
- if Index == Mode then
- Value:Tween(nil, {TextColor3 = FromRGB(255, 255, 255)})
- else
- Value:Tween(nil, {TextColor3 = FromRGB(100, 100, 100)})
- end
- end
- Library.Flags[Keybind.Flag] = {
- Mode = Keybind.Mode,
- Key = Keybind.Key,
- Toggled = Keybind.Toggled
- }
- if Data.Callback then
- Library:SafeCall(Data.Callback, Keybind.Toggled)
- end
- end
- function Keybind:Get()
- return Keybind.Key, Keybind.Mode, Keybind.Toggled
- end
- function Keybind:Set(Key)
- if StringFind(tostring(Key), "Enum") then
- Keybind.Key = tostring(Key)
- Key = Key.Name == "Backspace" and "None" or Key.Name
- local KeyString = Keys[Keybind.Key] or StringGSub(Key, "Enum.", "") or "None"
- local TextToDisplay = StringGSub(StringGSub(KeyString, "KeyCode.", ""), "UserInputType.", "") or "None"
- Keybind.Value = TextToDisplay
- Items["KeyButton"].Instance.Text = TextToDisplay
- Library.Flags[Keybind.Flag] = {
- Mode = Keybind.Mode,
- Key = Keybind.Key,
- Toggled = Keybind.Toggled
- }
- if Data.Callback then
- Library:SafeCall(Data.Callback, Keybind.Toggled)
- end
- elseif type(Key) == "table" then
- local RealKey = Key.Key == "Backspace" and "None" or Key.Key
- Keybind.Key = tostring(Key.Key)
- if Key.Mode then
- Keybind.Mode = Key.Mode
- Keybind:SetMode(Key.Mode)
- else
- Keybind.Mode = "Toggle"
- Keybind:SetMode("Toggle")
- end
- local KeyString = Keys[Keybind.Key] or StringGSub(tostring(RealKey), "Enum.", "") or RealKey
- local TextToDisplay = KeyString and StringGSub(StringGSub(KeyString, "KeyCode.", ""), "UserInputType.", "") or "None"
- TextToDisplay = StringGSub(StringGSub(KeyString, "KeyCode.", ""), "UserInputType.", "")
- Keybind.Value = TextToDisplay
- Items["KeyButton"].Instance.Text = TextToDisplay
- if Data.Callback then
- Library:SafeCall(Data.Callback, Keybind.Toggled)
- end
- elseif TableFind({"Toggle", "Hold", "Always"}, Key) then
- Keybind.Mode = Key
- Keybind:SetMode(Key)
- if Data.Callback then
- Library:SafeCall(Data.Callback, Keybind.Toggled)
- end
- end
- Keybind.Picking = false
- end
- function Keybind:Press(Bool)
- if Keybind.Mode == "Toggle" then
- Keybind.Toggled = not Keybind.Toggled
- elseif Keybind.Mode == "Hold" then
- Keybind.Toggled = Bool
- elseif Keybind.Mode == "Always" then
- Keybind.Toggled = true
- end
- Library.Flags[Keybind.Flag] = {
- Mode = Keybind.Mode,
- Key = Keybind.Key,
- Toggled = Keybind.Toggled
- }
- if Data.Callback then
- Library:SafeCall(Data.Callback, Keybind.Toggled)
- end
- end
- Items["KeyButton"]:Connect("MouseButton1Click", function()
- Keybind.Picking = true
- Items["KeyButton"].Instance.Text = "."
- Library:Thread(function()
- local Count = 1
- while true do
- if not Keybind.Picking then
- break
- end
- if Count == 4 then
- Count = 1
- end
- Items["KeyButton"].Instance.Text = Count == 1 and "." or Count == 2 and ".." or Count == 3 and "..."
- Count += 1
- task.wait(0.35)
- end
- end)
- local InputBegan
- InputBegan = UserInputService.InputBegan:Connect(function(Input)
- if Input.UserInputType == Enum.UserInputType.Keyboard then
- Keybind:Set(Input.KeyCode)
- else
- Keybind:Set(Input.UserInputType)
- end
- InputBegan:Disconnect()
- InputBegan = nil
- end)
- end)
- Items["KeyButton"]:Connect("MouseButton2Down", function()
- Keybind:SetOpen(not Keybind.IsOpen)
- end)
- Items["KeyButton"]:Connect("Changed", function(Property)
- if Property == "AbsolutePosition" and Keybind.IsOpen then
- Keybind.IsOpen = not Library:IsClipped(Items["KeybindWindow"].Instance, Data.Section.Items["Section"].Instance.Parent)
- Items["KeybindWindow"].Instance.Visible = Keybind.IsOpen
- end
- end)
- Items["Toggle"]:Connect("MouseButton1Down", function()
- Keybind.Mode = "Toggle"
- Keybind:SetMode("Toggle")
- end)
- Items["Hold"]:Connect("MouseButton1Down", function()
- Keybind.Mode = "Hold"
- Keybind:SetMode("Hold")
- end)
- Items["Always"]:Connect("MouseButton1Down", function()
- Keybind.Mode = "Always"
- Keybind:SetMode("Always")
- end)
- Library:Connect(UserInputService.InputBegan, function(Input)
- if Keybind.Value == "None" then
- return
- end
- if tostring(Input.KeyCode) == Keybind.Key then
- if Keybind.Mode == "Toggle" then
- Keybind:Press()
- elseif Keybind.Mode == "Hold" then
- Keybind:Press(true)
- elseif Keybind.Mode == "Always" then
- Keybind:Press(true)
- end
- elseif tostring(Input.UserInputType) == Keybind.Key then
- if Keybind.Mode == "Toggle" then
- Keybind:Press()
- elseif Keybind.Mode == "Hold" then
- Keybind:Press(true)
- elseif Keybind.Mode == "Always" then
- Keybind:Press(true)
- end
- end
- if Input.UserInputType == Enum.UserInputType.MouseButton1 then
- if not Keybind.IsOpen then
- return
- end
- if Library:IsMouseOverFrame(Items["KeybindWindow"]) then
- return
- end
- Keybind:SetOpen(false)
- end
- end)
- Library:Connect(UserInputService.InputEnded, function(Input)
- if Keybind.Value == "None" then
- return
- end
- if tostring(Input.KeyCode) == Keybind.Key then
- if Keybind.Mode == "Hold" then
- Keybind:Press(false)
- elseif Keybind.Mode == "Always" then
- Keybind:Press(true)
- end
- elseif tostring(Input.UserInputType) == Keybind.Key then
- if Keybind.Mode == "Hold" then
- Keybind:Press(false)
- elseif Keybind.Mode == "Always" then
- Keybind:Press(true)
- end
- end
- end)
- if Data.Default then
- Keybind:Set({
- Mode = Data.Mode or "Toggle",
- Key = Data.Default,
- })
- end
- Library.SetFlags[Keybind.Flag] = function(Value)
- Keybind:Set(Value)
- end
- return Keybind, Items
- end
- Library.Notification = function(self, Name, Duration, Icon)
- local Items = { } do
- Items["Notification"] = Instances:Create("Frame", {
- Parent = Library.NotifHolder.Instance,
- Name = "\0",
- Size = UDim2New(0, 0, 0, 30),
- BorderColor3 = FromRGB(0, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- BackgroundColor3 = FromRGB(16, 18, 18)
- }) Items["Notification"]:AddToTheme({BackgroundColor3 = "Background"})
- Instances:Create("UICorner", {
- Parent = Items["Notification"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["UIStroke"] = Instances:Create("UIStroke", {
- Parent = Items["Notification"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }) Items["UIStroke"]:AddToTheme({Color = "Border"})
- Instances:Create("UIPadding", {
- Parent = Items["Notification"].Instance,
- Name = "\0",
- PaddingRight = UDimNew(0, 8),
- PaddingLeft = UDimNew(0, 8)
- })
- if Icon then
- Items["Icon"] = Instances:Create("ImageLabel", {
- Parent = Items["Notification"].Instance,
- Name = "\0",
- ImageColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(0, 0.5),
- Image = "rbxassetid://"..Icon,
- BackgroundTransparency = 1,
- Position = UDim2New(0, 0, 0.5, 0),
- Size = UDim2New(0, 16, 0, 16),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- end
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Notification"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Name,
- AnchorPoint = Vector2New(0, 0.5),
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, Icon and 24 or 0, 0.5, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- end
- local Size = Items["Notification"].Instance.AbsoluteSize
- for Index, Value in Items do
- if Value.Instance:IsA("Frame") then
- Value.Instance.BackgroundTransparency = 1
- elseif Value.Instance:IsA("TextLabel") then
- Value.Instance.TextTransparency = 1
- elseif Value.Instance:IsA("ImageLabel") then
- Value.Instance.ImageTransparency = 1
- elseif Value.Instance:IsA("UIStroke") then
- Value.Instance.Transparency = 1
- end
- end
- task.wait(0.3)
- Items["Notification"].Instance.AutomaticSize = Enum.AutomaticSize.Y
- Library:Thread(function()
- for Index, Value in Items do
- if Value.Instance:IsA("Frame") then
- Value:Tween(nil, {BackgroundTransparency = 0})
- elseif Value.Instance:IsA("TextLabel") then
- Value:Tween(nil, {TextTransparency = 0})
- elseif Value.Instance:IsA("ImageLabel") then
- Value:Tween(nil, {ImageTransparency = 0.5})
- elseif Value.Instance:IsA("UIStroke") then
- Value:Tween(nil, {Transparency = 0})
- end
- end
- Items["Notification"]:Tween(nil, {Size = UDim2New(0, Size.X, 0, Size.Y)})
- task.delay(Duration, function()
- for Index, Value in Items do
- if Value.Instance:IsA("Frame") then
- Value:Tween(nil, {BackgroundTransparency = 1})
- elseif Value.Instance:IsA("TextLabel") then
- Value:Tween(nil, {TextTransparency = 1})
- elseif Value.Instance:IsA("ImageLabel") then
- Value:Tween(nil, {ImageTransparency = 1})
- elseif Value.Instance:IsA("UIStroke") then
- Value:Tween(nil, {Transparency = 1})
- end
- end
- Items["Notification"]:Tween(nil, {Size = UDim2New(0, 0, 0, 0)})
- task.wait(0.5)
- Items["Notification"]:Clean()
- end)
- end)
- end
- Library.Window = function(self, Data)
- local StartTime = tick()
- Data = Data or { }
- local Window = {
- Name = Data.Name or Data.name or "Window",
- SubTitle = Data.SubTitle or Data.subtitle,
- ExpiresIn = Data.ExpiresIn or Data.expiresin or "23d",
- Logo = Data.Logo or Data.logo or nil,
- Size = Data.Size or Data.size or UDim2.fromOffset(568, 350),
- Pages = { },
- Items = { },
- IsOpen = false
- }
- local Items = { } do
- local FirstLetterOfName = StringSub(Window.Name, 1, 1)
- Items["MainFrame"] = Instances:Create("Frame", {
- Parent = Library.Holder.Instance,
- Name = "\0",
- AnchorPoint = Vector2New(0.5, 0.5),
- Position = UDim2New(0.5, 0, 0.5, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = Window.Size,
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(16, 18, 18)
- }) Items["MainFrame"]:AddToTheme({BackgroundColor3 = "Background"})
- Items["MainFrame"]:MakeDraggable()
- Items["MainFrame"]:MakeResizeable(Vector2New(Items["MainFrame"].Instance.AbsoluteSize.X, Items["MainFrame"].Instance.AbsoluteSize.Y), Vector2New(9999, 9999))
- Instances:Create("UICorner", {
- Parent = Items["MainFrame"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Side"] = Instances:Create("Frame", {
- Parent = Items["MainFrame"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 215, 1, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Title"] = Instances:Create("Frame", {
- Parent = Items["Side"].Instance,
- Name = "\0",
- Position = UDim2New(0, 6, 0, 6),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, -12, 0, 60),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Title"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UICorner", {
- Parent = Items["Title"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Title"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["Background"] = Instances:Create("Frame", {
- Parent = Items["Title"].Instance,
- Name = "\0",
- AnchorPoint = Vector2New(0, 0.5),
- Position = UDim2New(0, 12, 0.5, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 40, 0, 40),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(207, 207, 207)
- })
- Instances:Create("UICorner", {
- Parent = Items["Background"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Background"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Background"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = FirstLetterOfName,
- AnchorPoint = Vector2New(0.5, 0.5),
- BackgroundTransparency = 1,
- Position = UDim2New(0.5, 0, 0.5, 0),
- Size = UDim2New(1, -10, 1, -10),
- BorderSizePixel = 0,
- TextSize = 22,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- if Window.Logo and Window.Logo ~= "" then
- Items["LogoImage"] = Instances:Create("ImageLabel", {
- Parent = Items["Background"].Instance,
- Name = "\0",
- AnchorPoint = Vector2New(0.5, 0.5),
- Position = UDim2New(0.5, 0, 0.5, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 1, 0),
- BorderSizePixel = 0,
- Image = Window.Logo,
- BackgroundTransparency = 1,
- ScaleType = Enum.ScaleType.Fit,
- ZIndex = 2
- })
- local LogoCorner = Instances:Create("UICorner", {
- Parent = Items["LogoImage"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Text"].Instance.Visible = false
- end
- Items["RealTitle"] = Instances:Create("TextLabel", {
- Parent = Items["Title"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Window.Name,
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 65, 0, 14),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Game"] = Instances:Create("TextLabel", {
- Parent = Items["Title"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- TextTransparency = 0.5,
- Text = Window.SubTitle,
- Size = UDim2New(0, 0, 0, 15),
- BorderSizePixel = 0,
- BackgroundTransparency = 1,
- Position = UDim2New(0, 65, 0, 30),
- BorderColor3 = FromRGB(0, 0, 0),
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Pages"] = Instances:Create("Frame", {
- Parent = Items["Side"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- Position = UDim2New(0, 0, 0, 75),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 1, -80),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIListLayout", {
- Parent = Items["Pages"].Instance,
- Name = "\0",
- Padding = UDimNew(0, 8),
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- Instances:Create("UIPadding", {
- Parent = Items["Pages"].Instance,
- Name = "\0",
- PaddingLeft = UDimNew(0, 8)
- })
- Items["Content"] = Instances:Create("Frame", {
- Parent = Items["MainFrame"].Instance,
- Name = "\0",
- Position = UDim2New(0, 220, 0, 6),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, -226, 1, -12),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Content"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UICorner", {
- Parent = Items["Content"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Content"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["Bottom_"] = Instances:Create("Frame", {
- Parent = Items["Side"].Instance,
- Name = "\0",
- AnchorPoint = Vector2New(0, 1),
- Position = UDim2New(0, 6, 1, -6),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, -12, 0, 45),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Bottom_"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UICorner", {
- Parent = Items["Bottom_"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Bottom_"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["SubExpires"] = Instances:Create("TextLabel", {
- Parent = Items["Bottom_"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- TextTransparency = 0.5,
- Text = "Sub expires in "..Window.ExpiresIn,
- Size = UDim2New(0, 0, 0, 15),
- BorderSizePixel = 0,
- BackgroundTransparency = 1,
- Position = UDim2New(0, 10, 0, 8),
- BorderColor3 = FromRGB(0, 0, 0),
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 12,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["SessionDuration"] = Instances:Create("TextLabel", {
- Parent = Items["Bottom_"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "Session duration: ",
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 10, 0, 23),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 12,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Library:Thread(function()
- while task.wait(1) do
- local SecondsPassed = MathFloor(tick() - StartTime)
- local MinutesPassed = MathFloor(SecondsPassed / 60)
- if MinutesPassed > 0 then
- SecondsPassed = SecondsPassed - MinutesPassed * 60
- end
- Items["SessionDuration"].Instance.Text = "Session duration: "..MinutesPassed..":"..SecondsPassed
- end
- end)
- Window.Items = Items
- end
- local Debounce = false
- function Window:SetCenter()
- local CenterPosition = Items["MainFrame"].Instance.AbsolutePosition
- task.wait()
- Items["MainFrame"].Instance.AnchorPoint = Vector2New(0, 0)
- Items["MainFrame"].Instance.Position = UDim2New(0, CenterPosition.X, 0, CenterPosition.Y)
- end
- function Window:SetOpen(Bool)
- if Debounce then
- return
- end
- Window.IsOpen = Bool
- Debounce = true
- if Window.IsOpen then
- Items["MainFrame"].Instance.Visible = true
- end
- local Descendants = Items["MainFrame"].Instance:GetDescendants()
- TableInsert(Descendants, Items["MainFrame"].Instance)
- local NewTween
- for Index, Value in Descendants do
- local TransparencyProperty = Tween:GetProperty(Value)
- if not TransparencyProperty then
- continue
- end
- if type(TransparencyProperty) == "table" then
- for _, Property in TransparencyProperty do
- NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
- end
- else
- NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
- end
- end
- NewTween.Tween.Completed:Connect(function()
- Debounce = false
- Items["MainFrame"].Instance.Visible = Window.IsOpen
- end)
- end
- Library:Connect(UserInputService.InputBegan, function(Input)
- if tostring(Input.KeyCode) == Library.MenuKeybind or tostring(Input.UserInputType) == Library.MenuKeybind then
- Window:SetOpen(not Window.IsOpen)
- end
- end)
- Window:SetCenter()
- task.wait()
- Window:SetOpen(true)
- return setmetatable(Window, Library)
- end
- Library.Page = function(self, Data)
- Data = Data or { }
- local Page = {
- Window = self,
- Name = Data.Name or Data.name or "Page",
- Icon = Data.Icon or Data.icon or "136879043989014",
- Items = { },
- SubPages = { },
- Active = false
- }
- local Items = { } do
- Items["Inactive"] = Instances:Create("TextButton", {
- Parent = Page.Window.Items["Pages"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- AutoButtonColor = false,
- BackgroundTransparency = 1,
- Size = UDim2New(0, 200, 0, 30),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Inactive"]:AddToTheme({BackgroundColor3 = "Inline"})
- Items["UIStroke"] = Instances:Create("UIStroke", {
- Parent = Items["Inactive"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- Transparency = 1,
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }) Items["UIStroke"]:AddToTheme({Color = "Border"})
- Instances:Create("UICorner", {
- Parent = Items["Inactive"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Icon"] = Instances:Create("ImageLabel", {
- Parent = Items["Inactive"].Instance,
- Name = "\0",
- ImageColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(0, 0.5),
- Image = "rbxassetid://"..Page.Icon,
- BackgroundTransparency = 1,
- Position = UDim2New(0, 10, 0.5, 0),
- Size = UDim2New(0, 16, 0, 16),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Inactive"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Page.Name,
- AnchorPoint = Vector2New(0, 0.5),
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 38, 0.5, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Page"] = Instances:Create("Frame", {
- Parent = Library.UnusedHolder.Instance,
- Name = "\0",
- Visible = false,
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 1, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["PageName"] = Instances:Create("TextLabel", {
- Parent = Items["Page"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Page.Name,
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 15, 0, 15),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 18,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["SubPages"] = Instances:Create("Frame", {
- Parent = Items["Page"].Instance,
- Name = "\0",
- Size = UDim2New(0, 0, 0, 30),
- Position = UDim2New(0, 13, 0, 42),
- BorderColor3 = FromRGB(0, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- BackgroundColor3 = FromRGB(16, 18, 18)
- }) Items["SubPages"]:AddToTheme({BackgroundColor3 = "Background"})
- Instances:Create("UIPadding", {
- Parent = Items["SubPages"].Instance,
- Name = "\0",
- PaddingTop = UDimNew(0, 2),
- PaddingBottom = UDimNew(0, 2),
- PaddingRight = UDimNew(0, 2),
- PaddingLeft = UDimNew(0, 2)
- })
- Instances:Create("UIListLayout", {
- Parent = Items["SubPages"].Instance,
- Name = "\0",
- Padding = UDimNew(0, 2),
- FillDirection = Enum.FillDirection.Horizontal,
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- Instances:Create("UICorner", {
- Parent = Items["SubPages"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Columns"] = Instances:Create("Frame", {
- Parent = Items["Page"].Instance,
- Name = "\0",
- Size = UDim2New(1, -20, 1, -82),
- Position = UDim2New(0, 10, 0, 75),
- BorderColor3 = FromRGB(0, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- BackgroundColor3 = FromRGB(255, 255, 255),
- BackgroundTransparency = 1
- })
- Page.Items = Items
- end
- local Debounce = false
- function Page:Turn(Bool)
- if Debounce then
- return
- end
- Page.Active = Bool
- Debounce = true
- Items["Page"].Instance.Visible = Bool
- Items["Page"].Instance.Parent = Bool and Page.Window.Items["Content"].Instance or Library.UnusedHolder.Instance
- if Page.Active then
- Items["Inactive"]:Tween(nil, {BackgroundTransparency = 0})
- Items["Icon"]:Tween(nil, {ImageColor3 = Library.Theme.Accent})
- Items["Text"]:Tween(nil, {TextColor3 = Library.Theme.Accent})
- Items["UIStroke"]:Tween(nil, {Transparency = 0})
- else
- Items["Inactive"]:Tween(nil, {BackgroundTransparency = 1})
- Items["Icon"]:Tween(nil, {ImageColor3 = FromRGB(100, 100, 100)})
- Items["Text"]:Tween(nil, {TextColor3 = FromRGB(100, 100, 100)})
- Items["UIStroke"]:Tween(nil, {Transparency = 1})
- end
- Debounce = false
- end
- Items["Inactive"]:Connect("MouseButton1Down", function()
- for Index, Value in Page.Window.Pages do
- if Value == Page and Page.Active then
- return
- end
- Value:Turn(Value == Page)
- end
- end)
- if #Page.Window.Pages == 0 then
- Page:Turn(true)
- end
- TableInsert(Page.Window.Pages, Page)
- return setmetatable(Page, Library.Pages)
- end
- Library.Category = function(self, Name)
- local Items = { } do
- Items["Category"] = Instances:Create("TextLabel", {
- Parent = self.Items["Pages"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- TextTransparency = 0.5,
- Text = Name,
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- BorderColor3 = FromRGB(0, 0, 0),
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 12,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- end
- return Items
- end
- Library.Pages.SubPage = function(self, Data)
- Data = Data or { }
- local Page = {
- Window = self.Window,
- Page = self,
- Name = Data.Name or Data.name or "SubPage",
- Columns = 1,
- Items = { },
- ColumnsData = { },
- Active = false
- }
- local Items = { } do
- Items["Inactive"] = Instances:Create("TextButton", {
- Parent = Page.Page.Items["SubPages"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- TextTransparency = 0.5,
- Text = Page.Name,
- AutoButtonColor = false,
- Size = UDim2New(0, 0, 1, 0),
- BackgroundTransparency = 1,
- BorderSizePixel = 0,
- BorderColor3 = FromRGB(0, 0, 0),
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(30, 34, 34)
- }) Items["Inactive"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UIPadding", {
- Parent = Items["Inactive"].Instance,
- Name = "\0",
- PaddingRight = UDimNew(0, 8),
- PaddingLeft = UDimNew(0, 8)
- })
- Instances:Create("UICorner", {
- Parent = Items["Inactive"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Page"] = Instances:Create("Frame", {
- Parent = Library.UnusedHolder.Instance,
- Name = "\0",
- Visible = false,
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 1, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- local NewColumn = Instances:Create("ScrollingFrame", {
- Parent = Items["Page"].Instance,
- Name = "\0",
- ScrollBarImageColor3 = FromRGB(0, 0, 0),
- Active = true,
- BorderColor3 = FromRGB(0, 0, 0),
- ScrollBarThickness = 0,
- BackgroundTransparency = 1,
- Size = UDim2New(1, 0, 1, 0),
- Position = UDim2New(0, 0, 0, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255),
- AutomaticCanvasSize = Enum.AutomaticSize.Y,
- CanvasSize = UDim2New(0, 0, 0, 0),
- ScrollBarImageTransparency = 0.5,
- })
- Instances:Create("UIPadding", {
- Parent = NewColumn.Instance,
- Name = "\0",
- PaddingTop = UDimNew(0, 10),
- PaddingBottom = UDimNew(0, 10),
- PaddingRight = UDimNew(0, 20),
- PaddingLeft = UDimNew(0, 5)
- })
- Instances:Create("UIListLayout", {
- Parent = NewColumn.Instance,
- Name = "\0",
- Padding = UDimNew(0, 12),
- SortOrder = Enum.SortOrder.LayoutOrder,
- HorizontalAlignment = Enum.HorizontalAlignment.Center
- })
- Page.ColumnsData[1] = NewColumn
- end
- function Page:Turn(Bool)
- if Page.Active == Bool then return end
- Page.Active = Bool
- Items["Page"].Instance.Visible = Bool
- Items["Page"].Instance.Parent = Bool and Page.Page.Items["Columns"].Instance or Library.UnusedHolder.Instance
- if Page.Active then
- Items["Inactive"]:Tween(nil, {BackgroundTransparency = 0, TextTransparency = 0})
- Items["Inactive"]:Tween(nil, {TextColor3 = Library.Theme.Accent})
- else
- Items["Inactive"]:Tween(nil, {BackgroundTransparency = 1, TextTransparency = 0.5})
- Items["Inactive"]:Tween(nil, {TextColor3 = FromRGB(100, 100, 100)})
- end
- end
- Items["Inactive"]:Connect("MouseButton1Down", function()
- for _, Value in Page.Page.SubPages do
- Value:Turn(Value == Page)
- end
- end)
- if #Page.Page.SubPages == 0 then
- Page:Turn(true)
- end
- table.insert(Page.Page.SubPages, Page)
- return setmetatable(Page, Library.Pages)
- end
- Library.Pages.Section = function(self, Data)
- Data = Data or { }
- local Section = {
- Window = self.Window,
- Page = self,
- Name = Data.Name or Data.name or "Section",
- Icon = Data.Icon or Data.icon or "",
- Side = 1,
- Items = { }
- }
- local Items = { } do
- Items["Section"] = Instances:Create("Frame", {
- Parent = Section.Page.ColumnsData[1].Instance,
- Name = "\0",
- Size = UDim2New(1, 0, 0, 25),
- BorderColor3 = FromRGB(0, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.Y,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["Section"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UICorner", {
- Parent = Items["Section"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Section"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["Icon"] = Instances:Create("ImageLabel", {
- Parent = Items["Section"].Instance,
- Name = "\0",
- ImageColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Image = "rbxassetid://"..Section.Icon,
- BackgroundTransparency = 1,
- Position = UDim2New(0, 12, 0, 12),
- Size = UDim2New(0, 16, 0, 16),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIPadding", {
- Parent = Items["Section"].Instance,
- Name = "\0",
- PaddingBottom = UDimNew(0, 12)
- })
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Section"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Section.Name,
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 35, 0, 12),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Content"] = Instances:Create("Frame", {
- Parent = Items["Section"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 12, 0, 42),
- Size = UDim2New(1, -24, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.Y,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIListLayout", {
- Parent = Items["Content"].Instance,
- Name = "\0",
- Padding = UDimNew(0, 8),
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- Section.Items = Items
- end
- return setmetatable(Section, Library.Sections)
- end
- Library.Sections.Toggle = function(self, Data)
- Data = Data or { }
- local Toggle = {
- Window = self.Window,
- Page = self.Page,
- Section = self,
- Name = Data.Name or Data.name or "Toggle",
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Default = Data.Default or Data.default or false,
- Callback = Data.Callback or Data.callback or function() end,
- Value = false
- }
- local Items = { } do
- Items["Toggle"] = Instances:Create("TextButton", {
- Parent = Toggle.Section.Items["Content"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- AutoButtonColor = false,
- BackgroundTransparency = 1,
- Size = UDim2New(1, 0, 0, 16),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Toggle"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Toggle.Name,
- AnchorPoint = Vector2New(0, 0.5),
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 0, 0.5, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Indicator"] = Instances:Create("Frame", {
- Parent = Items["Toggle"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(1, 0),
- BackgroundTransparency = 1,
- Position = UDim2New(1, 0, 0, 0),
- Size = UDim2New(0, 14, 0, 14),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(30, 33, 33)
- }) Items["Indicator"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UIStroke", {
- Parent = Items["Indicator"].Instance,
- Name = "\0",
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
- Color = FromRGB(56, 62, 62),
- Thickness = 2
- }):AddToTheme({Color = "Border 2"})
- Instances:Create("UICorner", {
- Parent = Items["Indicator"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Items["Inline"] = Instances:Create("Frame", {
- Parent = Items["Indicator"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 1, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- }) Items["Inline"]:AddToTheme({BackgroundColor3 = "Accent"})
- Instances:Create("UICorner", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Items["CheckImage"] = Instances:Create("ImageLabel", {
- Parent = Items["Inline"].Instance,
- Name = "\0",
- ImageColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(0.5, 0.5),
- Image = "rbxassetid://132128200461292",
- ImageTransparency = 1,
- BackgroundTransparency = 1,
- Position = UDim2New(0.5, 0, 0.5, 0),
- Size = UDim2New(1, -4, 1, -4),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["SubElements"] = Instances:Create("Frame", {
- Parent = Items["Toggle"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(1, 0),
- BackgroundTransparency = 1,
- Position = UDim2New(1, -25, 0, 0),
- Size = UDim2New(0, 0, 1, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIListLayout", {
- Parent = Items["SubElements"].Instance,
- Name = "\0",
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Right,
- Padding = UDimNew(0, 6),
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- end
- function Toggle:Get()
- return Toggle.Value
- end
- function Toggle:Set(Value)
- Toggle.Value = Value
- Library.Flags[Toggle.Flag] = Value
- if Toggle.Value then
- Items["Inline"]:Tween(nil, {BackgroundTransparency = 0})
- Items["CheckImage"]:Tween(nil, {ImageTransparency = 0})
- Items["Text"]:Tween(nil, {TextColor3 = FromRGB(255, 255, 255)})
- else
- Items["Inline"]:Tween(nil, {BackgroundTransparency = 1})
- Items["CheckImage"]:Tween(nil, {ImageTransparency = 1})
- Items["Text"]:Tween(nil, {TextColor3 = FromRGB(100, 100, 100)})
- end
- if Toggle.Callback then
- Library:SafeCall(Toggle.Callback, Toggle.Value)
- end
- end
- function Toggle:SetVisibility(Bool)
- Items["Toggle"].Instance.Visible = Bool
- end
- function Toggle:Colorpicker(Data)
- Data = Data or { }
- local Colorpicker = {
- Window = Toggle.Window,
- Page = Toggle.Page,
- Section = Toggle.Section,
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Default = Data.Default or Data.default or Color3.fromRGB(255, 255, 255),
- Callback = Data.Callback or Data.callback or function() end
- }
- local NewColorpicker, ColorpickerItems = Library:CreateColorpicker({
- Parent = Items["SubElements"],
- Page = Colorpicker.Page,
- Section = Colorpicker.Section,
- Flag = Colorpicker.Flag,
- Default = Colorpicker.Default,
- Callback = Colorpicker.Callback
- })
- return NewColorpicker
- end
- function Toggle:Keybind(Data)
- Data = Data or { }
- local Keybind = {
- Window = Toggle.Window,
- Page = Toggle.Page,
- Section = Toggle.Section,
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Default = Data.Default or Data.default or Enum.KeyCode.E,
- Callback = Data.Callback or Data.callback or function() end,
- Mode = Data.Mode or Data.mode or "Toggle"
- }
- local NewKeybind = Library:CreateKeybind({
- Parent = Items["SubElements"],
- Page = Keybind.Page,
- Section = Keybind.Section,
- Flag = Keybind.Flag,
- Default = Keybind.Default,
- Mode = Keybind.Mode,
- Callback = Keybind.Callback
- })
- return NewKeybind
- end
- Items["Toggle"]:Connect("MouseButton1Down", function()
- Toggle:Set(not Toggle.Value)
- end)
- Toggle:Set(Toggle.Default)
- Library.SetFlags[Toggle.Flag] = function(Value)
- Toggle:Set(Value)
- end
- return Toggle
- end
- Library.Sections.Button = function(self, Data)
- Data = Data or { }
- local Button = {
- Window = self.Window,
- Page = self.Page,
- Section = self,
- Name = Data.Name or Data.name,
- Callback = Data.Callback or Data.callback or function() end
- }
- local Items = { } do
- Items["Button"] = Instances:Create("TextButton", {
- Parent = Button.Section.Items["Content"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Button.Name,
- AutoButtonColor = false,
- Size = UDim2New(1, 0, 0, 25),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(30, 34, 34)
- })
- Items["Button"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UICorner", {
- Parent = Items["Button"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Button"].Instance,
- Name = "\0",
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
- Color = FromRGB(56, 62, 62),
- Thickness = 2
- }):AddToTheme({Color = "Border 2"})
- Instances:Create("UIPadding", {
- Parent = Items["Button"].Instance,
- Name = "\0",
- PaddingBottom = UDimNew(0, 1)
- })
- end
- function Button:SetVisibility(Bool)
- Items["Button"].Instance.Visible = Bool
- end
- function Button:Press()
- Items["Button"]:ChangeItemTheme({BackgroundColor3 = "Accent"})
- Items["Button"]:Tween(nil, {
- BackgroundColor3 = Library.Theme.Accent,
- TextColor3 = FromRGB(0, 0, 0)
- })
- task.wait(0.1)
- Items["Button"]:ChangeItemTheme({BackgroundColor3 = "Element"})
- Items["Button"]:Tween(nil, {
- BackgroundColor3 = Library.Theme.Element,
- TextColor3 = FromRGB(255, 255, 255) -- White text on element background
- })
- Library:SafeCall(Button.Callback)
- end
- Items["Button"]:Connect("MouseEnter", function()
- Items["Button"]:Tween(nil, {TextColor3 = Library.Theme.Accent})
- end)
- Items["Button"]:Connect("MouseLeave", function()
- Items["Button"]:Tween(nil, {TextColor3 = FromRGB(255, 255, 255)})
- end)
- Items["Button"]:Connect("MouseButton1Down", function()
- Button:Press()
- end)
- return Button
- end
- Library.Sections.Slider = function(self, Data)
- Data = Data or { }
- local Slider = {
- Window = self.Window,
- Page = self.Page,
- Section = self,
- Name = Data.Name or Data.name or "Slider",
- Min = Data.Min or Data.min or 0,
- Max = Data.Max or Data.max or 100,
- Callback = Data.Callback or Data.callback or function() end,
- Default = Data.Default or Data.default or 0,
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Decimals = Data.Decimals or Data.decimals or 1,
- Suffix = Data.Suffix or Data.suffix or "",
- Value = 0,
- Sliding = false
- }
- local Items = { } do
- Items["Slider"] = Instances:Create("Frame", {
- Parent = Slider.Section.Items["Content"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 0, 30),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Slider"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Slider.Name,
- BackgroundTransparency = 1,
- Size = UDim2New(0, 0, 0, 15),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Value"] = Instances:Create("TextLabel", {
- Parent = Items["Slider"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- AnchorPoint = Vector2New(1, 0),
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(1, 0, 0, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["RealSlider"] = Instances:Create("TextButton", {
- Parent = Items["Slider"].Instance,
- Text = "",
- AutoButtonColor = false,
- Name = "\0",
- AnchorPoint = Vector2New(0, 1),
- Position = UDim2New(0, 0, 1, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 0, 5),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(30, 34, 34)
- }) Items["RealSlider"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UICorner", {
- Parent = Items["RealSlider"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(1, 0)
- })
- Items["Accent"] = Instances:Create("Frame", {
- Parent = Items["RealSlider"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0.4000000059604645, 0, 1, 0),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- }) Items["Accent"]:AddToTheme({BackgroundColor3 = "Accent"})
- Instances:Create("UICorner", {
- Parent = Items["Accent"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Items["Circle"] = Instances:Create("Frame", {
- Parent = Items["Accent"].Instance,
- Name = "\0",
- AnchorPoint = Vector2New(1, 0.5),
- Position = UDim2New(1, 5, 0.5, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(0, 8, 0, 8),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- }) Items["Circle"]:AddToTheme({BackgroundColor3 = "Accent"})
- Instances:Create("UICorner", {
- Parent = Items["Circle"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 7)
- })
- Instances:Create("UIGradient", {
- Parent = Items["Accent"].Instance,
- Name = "\0",
- Color = RGBSequence{RGBSequenceKeypoint(0, FromRGB(180, 180, 180)), RGBSequenceKeypoint(1, FromRGB(255, 255, 255))}
- })
- end
- function Slider:Get()
- return Slider.Value
- end
- function Slider:SetVisibility(Bool)
- Items["Slider"].Instance.Visible = Bool
- end
- function Slider:Set(Value)
- Slider.Value = Library:Round(MathClamp(Value, Slider.Min, Slider.Max), Slider.Decimals)
- Library.Flags[Slider.Flag] = Slider.Value
- Items["Accent"]:Tween(TweenInfo.new(0.35, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2New((Slider.Value - Slider.Min) / (Slider.Max - Slider.Min), -2, 1, 0)})
- Items["Value"].Instance.Text = StringFormat("%s%s", Slider.Value, Slider.Suffix)
- if Slider.Callback then
- Library:SafeCall(Slider.Callback, Slider.Value)
- end
- end
- local InputChanged
- local InputChanged2
- Items["RealSlider"]:Connect("InputBegan", function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- Slider.Sliding = true
- local SizeX = (Input.Position.X - Items["RealSlider"].Instance.AbsolutePosition.X) / Items["RealSlider"].Instance.AbsoluteSize.X
- local Value = ((Slider.Max - Slider.Min) * SizeX) + Slider.Min
- Slider:Set(Value)
- if InputChanged then
- return
- end
- InputChanged = Input.Changed:Connect(function()
- if Input.UserInputState == Enum.UserInputState.End then
- Slider.Sliding = false
- InputChanged:Disconnect()
- InputChanged = nil
- end
- end)
- end
- end)
- Items["Circle"]:Connect("InputBegan", function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- Slider.Sliding = true
- local SizeX = (Input.Position.X - Items["RealSlider"].Instance.AbsolutePosition.X) / Items["RealSlider"].Instance.AbsoluteSize.X
- local Value = ((Slider.Max - Slider.Min) * SizeX) + Slider.Min
- Slider:Set(Value)
- if InputChanged2 or InputChanged then
- return
- end
- InputChanged2 = Input.Changed:Connect(function()
- if Input.UserInputState == Enum.UserInputState.End then
- Slider.Sliding = false
- InputChanged2:Disconnect()
- InputChanged2 = nil
- end
- end)
- end
- end)
- Library:Connect(UserInputService.InputChanged, function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
- if Slider.Sliding then
- local SizeX = (Input.Position.X - Items["RealSlider"].Instance.AbsolutePosition.X) / Items["RealSlider"].Instance.AbsoluteSize.X
- local Value = ((Slider.Max - Slider.Min) * SizeX) + Slider.Min
- Slider:Set(Value)
- end
- end
- end)
- Slider:Set(Slider.Default)
- Library.SetFlags[Slider.Flag] = function(Value)
- Slider:Set(Value)
- end
- return Slider
- end
- Library.Sections.Dropdown = function(self, Data)
- Data = Data or { }
- local Dropdown = {
- Window = self.Window,
- Page = self.Page,
- Section = self,
- Name = Data.Name or Data.name or "Dropdown",
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Items = Data.Items or Data.items or { },
- Default = Data.Default or Data.default or "",
- Callback = Data.Callback or Data.callback or function() end,
- Multi = Data.Multi or Data.multi or false,
- Value = { },
- Options = { },
- IsOpen = false
- }
- local Items = { } do
- Items["Dropdown"] = Instances:Create("Frame", {
- Parent = Dropdown.Section.Items["Content"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 0, 25),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Dropdown"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Dropdown.Name,
- AnchorPoint = Vector2New(0, 0.5),
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 0, 0.5, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["RealDropdown"] = Instances:Create("TextButton", {
- Parent = Items["Dropdown"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(0, 0, 0),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- AutoButtonColor = false,
- AnchorPoint = Vector2New(1, 0.5),
- Position = UDim2New(1, 0, 0.5, 0),
- Size = UDim2New(0, 80, 0, 25),
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(30, 34, 34)
- }) Items["RealDropdown"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UICorner", {
- Parent = Items["RealDropdown"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Items["Value"] = Instances:Create("TextLabel", {
- Parent = Items["RealDropdown"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "...",
- AnchorPoint = Vector2New(0, 0.5),
- Size = UDim2New(1, -6, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 6, 0.5, 0),
- BorderSizePixel = 0,
- TextSize = 12,
- TextXAlignment = Enum.TextXAlignment.Left,
- TextTruncate = Enum.TextTruncate.AtEnd,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Icon"] = Instances:Create("ImageLabel", {
- Parent = Items["RealDropdown"].Instance,
- Name = "\0",
- ImageColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(1, 0.5),
- Image = "rbxassetid://135448248851234",
- BackgroundTransparency = 1,
- Position = UDim2New(1, -5, 0.5, 0),
- Size = UDim2New(0, 16, 0, 16),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["OptionHolder"] = Instances:Create("Frame", {
- Parent = Library.UnusedHolder.Instance,
- Name = "\0",
- Visible = false,
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(0, 0),
- Position = UDim2New(1, 0, 0.5, 0),
- Size = UDim2New(0, 80, 0, 0), -- Dynamic height handles this now
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(21, 24, 24)
- }) Items["OptionHolder"]:AddToTheme({BackgroundColor3 = "Inline"})
- Instances:Create("UIStroke", {
- Parent = Items["OptionHolder"].Instance,
- Name = "\0",
- Color = FromRGB(30, 33, 33),
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- }):AddToTheme({Color = "Border"})
- Items["Holder"] = Instances:Create("ScrollingFrame", {
- Parent = Items["OptionHolder"].Instance,
- Name = "\0",
- Active = true,
- AutomaticCanvasSize = Enum.AutomaticSize.Y, -- Dynamic scrolling canvas
- ScrollBarThickness = 4,
- Size = UDim2New(1, 0, 1, 0),
- BorderSizePixel = 0,
- BackgroundTransparency = 1,
- ScrollingDirection = Enum.ScrollingDirection.Y,
- BorderColor3 = FromRGB(0, 0, 0),
- BackgroundColor3 = FromRGB(255, 255, 255),
- CanvasSize = UDim2New(0, 0, 0, 0)
- }) Items["Holder"]:AddToTheme({ScrollBarImageColor3 = "Accent"})
- Instances:Create("UIListLayout", {
- Parent = Items["Holder"].Instance,
- Name = "\0",
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- Instances:Create("UIPadding", {
- Parent = Items["OptionHolder"].Instance,
- Name = "\0",
- PaddingBottom = UDimNew(0, 4)
- })
- end
- function Dropdown:Get()
- return Dropdown.Value
- end
- function Dropdown:SetVisibility(Bool)
- Items["Dropdown"].Instance.Visible = Bool
- end
- local Debounce = false
- local RenderStepped
- function Dropdown:SetOpen(Bool)
- if Debounce then
- return
- end
- Dropdown.IsOpen = Bool
- Debounce = true
- if Dropdown.IsOpen then
- Items["OptionHolder"].Instance.Visible = true
- Items["OptionHolder"].Instance.Parent = Library.Holder.Instance
- RenderStepped = RunService.RenderStepped:Connect(function()
- -- Count the options to calculate height dynamically up to a limit
- local OptionCount = 0
- for _ in pairs(Dropdown.Options) do OptionCount = OptionCount + 1 end
- -- Calculates height (25px per item) but caps out at 125px (5 items max viewable)
- local CalculatedHeight = math.clamp(OptionCount * 25, 25, 125)
- Items["OptionHolder"].Instance.Position = UDim2New(0, Items["RealDropdown"].Instance.AbsolutePosition.X, 0, Items["RealDropdown"].Instance.AbsolutePosition.Y + 28)
- Items["OptionHolder"].Instance.Size = UDim2New(0, Items["RealDropdown"].Instance.AbsoluteSize.X, 0, CalculatedHeight)
- end)
- for Index, Value in Library.OpenFrames do
- if Value ~= Dropdown and not Dropdown.Section.IsSettings then
- Value:SetOpen(false)
- end
- end
- Library.OpenFrames[Dropdown] = Dropdown
- else
- if Library.OpenFrames[Dropdown] then
- Library.OpenFrames[Dropdown] = nil
- end
- if RenderStepped then
- RenderStepped:Disconnect()
- RenderStepped = nil
- end
- end
- local Descendants = Items["OptionHolder"].Instance:GetDescendants()
- TableInsert(Descendants, Items["OptionHolder"].Instance)
- local NewTween
- for Index, Value in Descendants do
- local TransparencyProperty = Tween:GetProperty(Value)
- if not TransparencyProperty then
- continue
- end
- if not Value.ClassName:find("UI") then
- Value.ZIndex = Dropdown.IsOpen and 3 or 1
- end
- if type(TransparencyProperty) == "table" then
- for _, Property in TransparencyProperty do
- NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
- end
- else
- NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
- end
- end
- NewTween.Tween.Completed:Connect(function()
- Debounce = false
- Items["OptionHolder"].Instance.Visible = Dropdown.IsOpen
- task.wait(0.2)
- Items["OptionHolder"].Instance.Parent = not Dropdown.IsOpen and Library.UnusedHolder.Instance or Library.Holder.Instance
- end)
- end
- function Dropdown:Set(Option)
- if Dropdown.Multi then
- if type(Option) ~= "table" then
- return
- end
- Dropdown.Value = Option
- Library.Flags[Dropdown.Flag] = Option
- for Index, Value in Option do
- local OptionData = Dropdown.Options[Value]
- if not OptionData then
- continue
- end
- OptionData.Selected = true
- OptionData:Toggle("Active")
- end
- Items["Value"].Instance.Text = TableConcat(Option, ", ")
- else
- if not Dropdown.Options[Option] then
- return
- end
- local OptionData = Dropdown.Options[Option]
- Dropdown.Value = Option
- Library.Flags[Dropdown.Flag] = Option
- for Index, Value in Dropdown.Options do
- if Value ~= OptionData then
- Value.Selected = false
- Value:Toggle("Inactive")
- else
- Value.Selected = true
- Value:Toggle("Active")
- end
- end
- Items["Value"].Instance.Text = Option
- end
- if Dropdown.Callback then
- Library:SafeCall(Dropdown.Callback, Dropdown.Value)
- end
- end
- function Dropdown:Add(Option)
- local OptionButton = Instances:Create("TextButton", {
- Parent = Items["Holder"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Option,
- AutoButtonColor = false,
- BackgroundTransparency = 1,
- Size = UDim2New(1, -6, 0, 25), -- Shrunk size slightly to leave space for scrollbar
- BorderSizePixel = 0,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- }) OptionButton:AddToTheme({BackgroundColor3 = "Accent"})
- local OptionData = {
- Button = OptionButton,
- Name = Option,
- Selected = false
- }
- function OptionData:Toggle(Value)
- if Value == "Active" then
- OptionData.Button:Tween(nil, {BackgroundTransparency = 0, TextColor3 = FromRGB(0, 0, 0)})
- else
- OptionData.Button:Tween(nil, {BackgroundTransparency = 1, TextColor3 = FromRGB(100, 100, 100)})
- end
- end
- function OptionData:Set()
- OptionData.Selected = not OptionData.Selected
- if Dropdown.Multi then
- local Index = TableFind(Dropdown.Value, OptionData.Name)
- if Index then
- TableRemove(Dropdown.Value, Index)
- else
- TableInsert(Dropdown.Value, OptionData.Name)
- end
- OptionData:Toggle(Index and "Inactive" or "Active")
- Library.Flags[Dropdown.Flag] = Dropdown.Value
- local TextFormat = #Dropdown.Value > 0 and TableConcat(Dropdown.Value, ", ") or "..."
- Items["Value"].Instance.Text = TextFormat
- else
- if OptionData.Selected then
- Dropdown.Value = OptionData.Name
- Library.Flags[Dropdown.Flag] = OptionData.Name
- OptionData.Selected = true
- OptionData:Toggle("Active")
- for Index, Value in Dropdown.Options do
- if Value ~= OptionData then
- Value.Selected = false
- Value:Toggle("Inactive")
- end
- end
- Items["Value"].Instance.Text = OptionData.Name
- else
- Dropdown.Value = nil
- Library.Flags[Dropdown.Flag] = nil
- OptionData.Selected = false
- OptionData:Toggle("Inactive")
- Items["Value"].Instance.Text = "..."
- end
- end
- if Dropdown.Callback then
- Library:SafeCall(Dropdown.Callback, Dropdown.Value)
- end
- end
- OptionData.Button:Connect("MouseButton1Down", function()
- OptionData:Set()
- end)
- Dropdown.Options[OptionData.Name] = OptionData
- return OptionData
- end
- function Dropdown:Remove(Option)
- if Dropdown.Options[Option] then
- Dropdown.Options[Option].Button:Clean()
- Dropdown.Options[Option] = nil
- end
- end
- function Dropdown:Refresh(List)
- for Index, Value in Dropdown.Options do
- Dropdown:Remove(Value.Name)
- end
- for Index, Value in List do
- Dropdown:Add(Value)
- end
- end
- Items["RealDropdown"]:Connect("MouseButton1Down", function()
- Dropdown:SetOpen(not Dropdown.IsOpen)
- end)
- Library:Connect(UserInputService.InputBegan, function(Input)
- if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
- if Dropdown.IsOpen then
- if Library:IsMouseOverFrame(Items["OptionHolder"]) then
- return
- end
- Dropdown:SetOpen(false)
- end
- end
- end)
- Items["RealDropdown"]:Connect("Changed", function(Property)
- if Property == "AbsolutePosition" and Dropdown.IsOpen then
- Dropdown.IsOpen = not Library:IsClipped(Items["OptionHolder"].Instance, Dropdown.Section.Items["Section"].Instance.Parent)
- Items["OptionHolder"].Instance.Visible = Dropdown.IsOpen
- end
- end)
- for Index, Value in Dropdown.Items do
- Dropdown:Add(Value)
- end
- if Dropdown.Default then
- Dropdown:Set(Dropdown.Default)
- end
- Library.SetFlags[Dropdown.Flag] = function(Value)
- Dropdown:Set(Value)
- end
- return Dropdown
- end
- Library.Sections.Label = function(self, Name)
- local Label = {
- Window = self.Window,
- Page = self.Page,
- Section = self,
- Name = Name or "Label"
- }
- local Items = { } do
- Items["Label"] = Instances:Create("Frame", {
- Parent = Label.Section.Items["Content"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 0, 17),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Text"] = Instances:Create("TextLabel", {
- Parent = Items["Label"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- TextColor3 = FromRGB(100, 100, 100),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = Label.Name,
- AnchorPoint = Vector2New(0, 0.5),
- Size = UDim2New(0, 0, 0, 15),
- BackgroundTransparency = 1,
- Position = UDim2New(0, 0, 0.5, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- TextSize = 14,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["SubElements"] = Instances:Create("Frame", {
- Parent = Items["Label"].Instance,
- Name = "\0",
- BorderColor3 = FromRGB(0, 0, 0),
- AnchorPoint = Vector2New(1, 0),
- BackgroundTransparency = 1,
- Position = UDim2New(1, 0, 0, 0),
- Size = UDim2New(0, 0, 1, 0),
- BorderSizePixel = 0,
- AutomaticSize = Enum.AutomaticSize.X,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Instances:Create("UIListLayout", {
- Parent = Items["SubElements"].Instance,
- Name = "\0",
- FillDirection = Enum.FillDirection.Horizontal,
- HorizontalAlignment = Enum.HorizontalAlignment.Right,
- Padding = UDimNew(0, 6),
- SortOrder = Enum.SortOrder.LayoutOrder
- })
- end
- function Label:SetText(Text)
- Text = tostring(Text)
- Items["Label"].Instance.Text = Text
- end
- function Label:SetVisibility(Bool)
- Items["Label"].Instance.Visible = Bool
- end
- function Label:Colorpicker(Data)
- Data = Data or { }
- local Colorpicker = {
- Window = Label.Window,
- Page = Label.Page,
- Section = Label.Section,
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Default = Data.Default or Data.default or Color3.fromRGB(255, 255, 255),
- Callback = Data.Callback or Data.callback or function() end
- }
- local NewColorpicker, ColorpickerItems = Library:CreateColorpicker({
- Parent = Items["SubElements"],
- Page = Colorpicker.Page,
- Section = Colorpicker.Section,
- Flag = Colorpicker.Flag,
- Default = Colorpicker.Default,
- Callback = Colorpicker.Callback
- })
- return NewColorpicker
- end
- function Label:Keybind(Data)
- Data = Data or { }
- local Keybind = {
- Window = Label.Window,
- Page = Label.Page,
- Section = Label.Section,
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Default = Data.Default or Data.default or Enum.KeyCode.E,
- Callback = Data.Callback or Data.callback or function() end,
- Mode = Data.Mode or Data.mode or "Toggle"
- }
- local NewKeybind = Library:CreateKeybind({
- Parent = Items["SubElements"],
- Page = Keybind.Page,
- Section = Keybind.Section,
- Flag = Keybind.Flag,
- Default = Keybind.Default,
- Mode = Keybind.Mode,
- Callback = Keybind.Callback
- })
- return NewKeybind
- end
- return Label
- end
- Library.Sections.Textbox = function(self, Data)
- Data = Data or { }
- local Textbox = {
- Window = self.Window,
- Page = self.Page,
- Section = self,
- Flag = Data.Flag or Data.flag or Library:NextFlag(),
- Default = Data.Default or Data.default or "",
- Callback = Data.Callback or Data.callback or function() end,
- Placeholder = Data.Placeholder or Data.placeholder or "Placeholder",
- Numeric = Data.Numeric or Data.numeric or false,
- Finished = Data.Finished or Data.finished or false,
- Value = ""
- }
- local Items = { } do
- Items["Textbox"] = Instances:Create("Frame", {
- Parent = Textbox.Section.Items["Content"].Instance,
- Name = "\0",
- BackgroundTransparency = 1,
- BorderColor3 = FromRGB(0, 0, 0),
- Size = UDim2New(1, 0, 0, 25),
- BorderSizePixel = 0,
- BackgroundColor3 = FromRGB(255, 255, 255)
- })
- Items["Input"] = Instances:Create("TextBox", {
- Parent = Items["Textbox"].Instance,
- Name = "\0",
- FontFace = Library.Font,
- CursorPosition = -1,
- TextColor3 = FromRGB(255, 255, 255),
- BorderColor3 = FromRGB(0, 0, 0),
- Text = "",
- Size = UDim2New(1, 0, 1, 0),
- ClipsDescendants = true,
- BorderSizePixel = 0,
- PlaceholderColor3 = FromRGB(100, 100, 100),
- TextXAlignment = Enum.TextXAlignment.Left,
- PlaceholderText = Textbox.Placeholder,
- TextSize = 14,
- BackgroundColor3 = FromRGB(30, 34, 34)
- }) Items["Input"]:AddToTheme({BackgroundColor3 = "Element"})
- Instances:Create("UICorner", {
- Parent = Items["Input"].Instance,
- Name = "\0",
- CornerRadius = UDimNew(0, 4)
- })
- Instances:Create("UIStroke", {
- Parent = Items["Input"].Instance,
- Name = "\0",
- ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
- Color = FromRGB(56, 62, 62),
- Thickness = 2
- }):AddToTheme({Color = "Border 2"})
- Instances:Create("UIPadding", {
- Parent = Items["Input"].Instance,
- Name = "\0",
- PaddingLeft = UDimNew(0, 8)
- })
- end
- function Textbox:Get()
- return Textbox.Value
- end
- function Textbox:SetVisibility(Bool)
- Items["Textbox"].Instance.Visible = Bool
- end
- function Textbox:Set(Value)
- if Textbox.Numeric then
- if (not tonumber(Value)) and StringLen(tostring(Value)) > 0 then
- Value = Textbox.Value
- end
- end
- Textbox.Value = Value
- Items["Input"].Instance.Text = Value
- Library.Flags[Textbox.Flag] = Value
- if Textbox.Callback then
- Library:SafeCall(Textbox.Callback, Value)
- end
- end
- if Textbox.Finished then
- Items["Input"]:Connect("FocusLost", function(PressedEnterQuestionMark)
- if PressedEnterQuestionMark then
- Textbox:Set(Items["Input"].Instance.Text)
- end
- end)
- else
- Items["Input"].Instance:GetPropertyChangedSignal("Text"):Connect(function()
- Textbox:Set(Items["Input"].Instance.Text)
- end)
- end
- if Textbox.Default then
- Textbox:Set(Textbox.Default)
- end
- Library.SetFlags[Textbox.Flag] = function(Value)
- Textbox:Set(Value)
- end
- return Textbox
- end
- end
- Library.CreateSettingsPage = function(self, Window)
- local SettingsPage = Window:Page({Name = "Settings", Icon = "72732892493295"}) do
- local ConfigsSubPage = SettingsPage:SubPage({Name = "Configs"})
- local ThemingSubPage = SettingsPage:SubPage({Name = "Theming"})
- local SettingsSubPage = SettingsPage:SubPage({Name = "Settings"})
- do -- Configs
- local ConfigsSection = ConfigsSubPage:Section({Name = "Configs", Side = 1, Icon = "97491613646216"})
- local ConfigName = ""
- local ConfigSelected
- local ConfigsList = ConfigsSection:Dropdown({
- Name = "Configs",
- Flag = "ConfigsList",
- Items = { },
- Multi = false,
- Callback = function(Value)
- ConfigSelected = Value
- end
- })
- local AutoloadDropdown = ConfigsSection:Dropdown({
- Name = "Auto Load Config",
- Flag = "AutoloadList",
- Items = { },
- Multi = false,
- Callback = function(Value)
- local path = Library.Folders.Autoload .. "/autoload.txt"
- if Value and Value ~= "None" then
- writefile(path, Value)
- elseif Value == "None" then
- if isfile(path) then
- delfile(path)
- end
- end
- end
- })
- ConfigsSection:Textbox({
- Default = "",
- Flag = "ConfigName",
- Placeholder = "Config name",
- Callback = function(Value)
- ConfigName = Value
- end
- })
- ConfigsSection:Button({
- Name = "Create",
- Callback = function()
- if ConfigName and ConfigName ~= "" then
- if not isfile(Library.Folders.Configs .. "/" .. ConfigName .. ".json") then
- writefile(Library.Folders.Configs .. "/" .. ConfigName .. ".json", Library:GetConfig())
- Library:RefreshConfigsList({ConfigsList, AutoloadDropdown})
- end
- end
- end})
- ConfigsSection:Button({
- Name = "Delete",
- Callback = function()
- if ConfigSelected and ConfigSelected ~= "None" then
- Library:DeleteConfig(ConfigSelected)
- Library:RefreshConfigsList({ConfigsList, AutoloadDropdown})
- end
- end})
- ConfigsSection:Button({
- Name = "Load",
- Callback = function()
- if ConfigSelected and ConfigSelected ~= "None" then
- local success = Library:LoadConfig(readfile(Library.Folders.Configs .. "/" .. ConfigSelected))
- if success then
- -- Removes .json from the name for a cleaner notification
- local cleanName = string.gsub(ConfigSelected, "%.json$", "")
- Library:Notification("Successfully loaded: " .. cleanName, 3)
- else
- Library:Notification("Failed to load config.", 3)
- end
- end
- end})
- ConfigsSection:Button({
- Name = "Save",
- Callback = function()
- if ConfigName and ConfigName ~= "" then
- writefile(Library.Folders.Configs .. "/" .. ConfigName .. ".json", Library:GetConfig())
- Library:RefreshConfigsList({ConfigsList, AutoloadDropdown})
- end
- end})
- ConfigsSection:Button({
- Name = "Refresh",
- Callback = function()
- Library:RefreshConfigsList({ConfigsList, AutoloadDropdown})
- end})
- Library:RefreshConfigsList({ConfigsList, AutoloadDropdown})
- task.spawn(function()
- local autoloadPath = Library.Folders.Autoload .. "/autoload.txt"
- if isfile(autoloadPath) then
- local configName = readfile(autoloadPath)
- local configPath = Library.Folders.Configs .. "/" .. configName
- if isfile(configPath) then
- task.wait(3)
- local success = Library:LoadConfig(readfile(configPath))
- AutoloadDropdown:Set(configName)
- if success then
- local cleanName = string.gsub(configName, "%.json$", "")
- Library:Notification("Auto-loaded: " .. cleanName, 4)
- end
- else
- AutoloadDropdown:Set("None")
- end
- else
- AutoloadDropdown:Set("None")
- end
- end)
- end
- do -- Theming
- local ThemingSection = ThemingSubPage:Section({Name = "Theming", Icon = "131595494666590", Side = 1})
- for Index, Value in Library.Theme do
- ThemingSection:Label(Index):Colorpicker({
- Flag = Index.."Theme",
- Default = Value,
- Callback = function(Value)
- Library.Theme[Index] = Value
- Library:ChangeTheme(Index, Value)
- end
- })
- end
- end
- do -- Settings
- local SettingsSection = SettingsSubPage:Section({Name = "Settings", Icon = "72732892493295", Side = 1})
- SettingsSection:Button({
- Name = "Unload",
- Callback = function()
- Library:Unload()
- end
- })
- SettingsSection:Label("Menu Keybind"):Keybind({
- Name = "Menu Keybind",
- Flag = "MenuKeybind",
- Default = Library.MenuKeybind,
- Mode = "Toggle",
- Callback = function()
- Library.MenuKeybind = Library.Flags["MenuKeybind"].Key
- end
- })
- SettingsSection:Slider({
- Name = "Tween Speed",
- Default = 0.3,
- Flag = "Tween Speed",
- Decimals = 0.01,
- Suffix = "s",
- Max = 10,
- Min = 0,
- Callback = function(Value)
- Library.Tween.Time = Value
- end
- })
- SettingsSection:Dropdown({
- Name = "Tween Style",
- Flag = "Tween style",
- Items = { "Linear", "Quad", "Quart", "Back", "Bounce", "Circular", "Cubic", "Elastic", "Exponential", "Sine", "Quint" },
- Default = "Quart",
- Callback = function(Value)
- if not Value then Value = "Quint" end
- Library.Tween.Style = Enum.EasingStyle[Value]
- end
- })
- SettingsSection:Dropdown({
- Name = "Tween Direction",
- Flag = "Tween direction",
- Items = { "In", "Out", "InOut" },
- Default = "Out",
- Callback = function(Value)
- if not Value then Value = "Out" end
- Library.Tween.Direction = Enum.EasingDirection[Value]
- end
- })
- end
- end
- end
- end
- getgenv().Library = Library
- return Library
Advertisement
Add Comment
Please, Sign In to add comment