Messi33536086

Untitled

Mar 22nd, 2026
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 160.68 KB | None | 0 0
  1. -- Made by samet
  2. -- Example at bottom
  3.  
  4. if getgenv().Library then
  5. getgenv().Library:Unload()
  6. end
  7.  
  8. local Library do
  9. local Workspace = game:GetService("Workspace")
  10. local UserInputService = game:GetService("UserInputService")
  11. local Players = game:GetService("Players")
  12. local HttpService = game:GetService("HttpService")
  13. local RunService = game:GetService("RunService")
  14. local CoreGui = cloneref and cloneref(game:GetService("CoreGui")) or game:GetService("CoreGui")
  15. local TweenService = game:GetService("TweenService")
  16. local Lighting = game:GetService("Lighting")
  17.  
  18. gethui = gethui or function()
  19. return CoreGui
  20. end
  21.  
  22. local LocalPlayer = Players.LocalPlayer
  23. local Camera = Workspace.CurrentCamera
  24. local Mouse = LocalPlayer:GetMouse()
  25.  
  26. local FromRGB = Color3.fromRGB
  27. local FromHSV = Color3.fromHSV
  28. local FromHex = Color3.fromHex
  29.  
  30. local RGBSequence = ColorSequence.new
  31. local RGBSequenceKeypoint = ColorSequenceKeypoint.new
  32. local NumSequence = NumberSequence.new
  33. local NumSequenceKeypoint = NumberSequenceKeypoint.new
  34.  
  35. local UDim2New = UDim2.new
  36. local UDimNew = UDim.new
  37. local UDim2FromOffset = UDim2.fromOffset
  38. local Vector2New = Vector2.new
  39. local Vector3New = Vector3.new
  40.  
  41. local MathClamp = math.clamp
  42. local MathFloor = math.floor
  43. local MathAbs = math.abs
  44. local MathSin = math.sin
  45.  
  46. local TableInsert = table.insert
  47. local TableFind = table.find
  48. local TableRemove = table.remove
  49. local TableConcat = table.concat
  50. local TableClone = table.clone
  51. local TableUnpack = table.unpack
  52.  
  53. local StringFormat = string.format
  54. local StringFind = string.find
  55. local StringGSub = string.gsub
  56. local StringLower = string.lower
  57. local StringLen = string.len
  58.  
  59. local InstanceNew = Instance.new
  60.  
  61. local RectNew = Rect.new
  62.  
  63. Library = {
  64. Theme = { },
  65.  
  66. MenuKeybind = tostring(Enum.KeyCode.RightControl),
  67.  
  68. Flags = { },
  69.  
  70. Tween = {
  71. Time = 0.2,
  72. Style = Enum.EasingStyle.Circular,
  73. Direction = Enum.EasingDirection.Out
  74. },
  75.  
  76. FadeSpeed = 0.2,
  77.  
  78. Folders = {
  79. Directory = "homxiide",
  80. Configs = "homxiide/Configs",
  81. Assets = "homxiide/Assets",
  82. },
  83.  
  84. -- Ignore below
  85. Pages = { },
  86. Sections = { },
  87.  
  88. Connections = { },
  89. Threads = { },
  90.  
  91. ThemeMap = { },
  92. ThemeItems = { },
  93.  
  94. OpenFrames = { },
  95.  
  96. SetFlags = { },
  97.  
  98. UnnamedConnections = 0,
  99. UnnamedFlags = 0,
  100.  
  101. Holder = nil,
  102. NotifHolder = nil,
  103. UnusedHolder = nil,
  104.  
  105. Font = nil
  106. }
  107.  
  108. Library.__index = Library
  109. Library.Sections.__index = Library.Sections
  110. Library.Pages.__index = Library.Pages
  111.  
  112. local Keys = {
  113. ["Unknown"] = "Unknown",
  114. ["Backspace"] = "Back",
  115. ["Tab"] = "Tab",
  116. ["Clear"] = "Clear",
  117. ["Return"] = "Return",
  118. ["Pause"] = "Pause",
  119. ["Escape"] = "Escape",
  120. ["Space"] = "Space",
  121. ["QuotedDouble"] = '"',
  122. ["Hash"] = "#",
  123. ["Dollar"] = "$",
  124. ["Percent"] = "%",
  125. ["Ampersand"] = "&",
  126. ["Quote"] = "'",
  127. ["LeftParenthesis"] = "(",
  128. ["RightParenthesis"] = " )",
  129. ["Asterisk"] = "*",
  130. ["Plus"] = "+",
  131. ["Comma"] = ",",
  132. ["Minus"] = "-",
  133. ["Period"] = ".",
  134. ["Slash"] = "`",
  135. ["Three"] = "3",
  136. ["Seven"] = "7",
  137. ["Eight"] = "8",
  138. ["Colon"] = ":",
  139. ["Semicolon"] = ";",
  140. ["LessThan"] = "<",
  141. ["GreaterThan"] = ">",
  142. ["Question"] = "?",
  143. ["Equals"] = "=",
  144. ["At"] = "@",
  145. ["LeftBracket"] = "LeftBracket",
  146. ["RightBracket"] = "RightBracked",
  147. ["BackSlash"] = "BackSlash",
  148. ["Caret"] = "^",
  149. ["Underscore"] = "_",
  150. ["Backquote"] = "`",
  151. ["LeftCurly"] = "{",
  152. ["Pipe"] = "|",
  153. ["RightCurly"] = "}",
  154. ["Tilde"] = "~",
  155. ["Delete"] = "Delete",
  156. ["End"] = "End",
  157. ["KeypadZero"] = "Keypad0",
  158. ["KeypadOne"] = "Keypad1",
  159. ["KeypadTwo"] = "Keypad2",
  160. ["KeypadThree"] = "Keypad3",
  161. ["KeypadFour"] = "Keypad4",
  162. ["KeypadFive"] = "Keypad5",
  163. ["KeypadSix"] = "Keypad6",
  164. ["KeypadSeven"] = "Keypad7",
  165. ["KeypadEight"] = "Keypad8",
  166. ["KeypadNine"] = "Keypad9",
  167. ["KeypadPeriod"] = "KeypadP",
  168. ["KeypadDivide"] = "KeypadD",
  169. ["KeypadMultiply"] = "KeypadM",
  170. ["KeypadMinus"] = "KeypadM",
  171. ["KeypadPlus"] = "KeypadP",
  172. ["KeypadEnter"] = "KeypadE",
  173. ["KeypadEquals"] = "KeypadE",
  174. ["Insert"] = "Insert",
  175. ["Home"] = "Home",
  176. ["PageUp"] = "PageUp",
  177. ["PageDown"] = "PageDown",
  178. ["RightShift"] = "RightShift",
  179. ["LeftShift"] = "LeftShift",
  180. ["RightControl"] = "RightControl",
  181. ["LeftControl"] = "LeftControl",
  182. ["LeftAlt"] = "LeftAlt",
  183. ["RightAlt"] = "RightAlt"
  184. }
  185.  
  186. local Themes = {
  187. ["Preset"] = {
  188. ["Background"] = FromRGB(10, 11, 12),
  189. ["Outline"] = FromRGB(22, 24, 23),
  190. ["Inline"] = FromRGB(18, 20, 22),
  191. ["Accent"] = FromRGB(155, 229, 222),
  192. ["Text"] = FromRGB(236, 245, 253),
  193. ["Element"] = FromRGB(25, 29, 31)
  194. }
  195. }
  196.  
  197. Library.Theme = TableClone(Themes["Preset"])
  198.  
  199. -- Folders
  200. for Index, Value in Library.Folders do
  201. if not isfolder(Value) then
  202. makefolder(Value)
  203. end
  204. end
  205.  
  206. -- Tweening
  207. local Tween = { } do
  208. Tween.__index = Tween
  209.  
  210. Tween.Create = function(self, Item, Info, Goal, IsRawItem)
  211. Item = IsRawItem and Item or Item.Instance
  212. Info = Info or TweenInfo.new(Library.Tween.Time, Library.Tween.Style, Library.Tween.Direction)
  213.  
  214. local NewTween = {
  215. Tween = TweenService:Create(Item, Info, Goal),
  216. Info = Info,
  217. Goal = Goal,
  218. Item = Item
  219. }
  220.  
  221. NewTween.Tween:Play()
  222.  
  223. setmetatable(NewTween, Tween)
  224.  
  225. return NewTween
  226. end
  227.  
  228. Tween.GetProperty = function(self, Item)
  229. Item = Item or self.Item
  230.  
  231. if Item:IsA("Frame") then
  232. return { "BackgroundTransparency" }
  233. elseif Item:IsA("TextLabel") or Item:IsA("TextButton") then
  234. return { "TextTransparency", "BackgroundTransparency" }
  235. elseif Item:IsA("ImageLabel") or Item:IsA("ImageButton") then
  236. return { "BackgroundTransparency", "ImageTransparency" }
  237. elseif Item:IsA("ScrollingFrame") then
  238. return { "BackgroundTransparency", "ScrollBarImageTransparency" }
  239. elseif Item:IsA("TextBox") then
  240. return { "TextTransparency", "BackgroundTransparency" }
  241. elseif Item:IsA("UIStroke") then
  242. return { "Transparency" }
  243. end
  244. end
  245.  
  246. Tween.FadeItem = function(self, Item, Property, Visibility, Speed)
  247. local Item = Item or self.Item
  248.  
  249. local OldTransparency = Item[Property]
  250. Item[Property] = Visibility and 1 or OldTransparency
  251.  
  252. local NewTween = Tween:Create(Item, TweenInfo.new(Speed or Library.Tween.Time, Library.Tween.Style, Library.Tween.Direction), {
  253. [Property] = Visibility and OldTransparency or 1
  254. }, true)
  255.  
  256. Library:Connect(NewTween.Tween.Completed, function()
  257. if not Visibility then
  258. task.wait()
  259. Item[Property] = OldTransparency
  260. end
  261. end)
  262.  
  263. return NewTween
  264. end
  265.  
  266. Tween.Get = function(self)
  267. if not self.Tween then
  268. return
  269. end
  270.  
  271. return self.Tween, self.Info, self.Goal
  272. end
  273.  
  274. Tween.Pause = function(self)
  275. if not self.Tween then
  276. return
  277. end
  278.  
  279. self.Tween:Pause()
  280. end
  281.  
  282. Tween.Play = function(self)
  283. if not self.Tween then
  284. return
  285. end
  286.  
  287. self.Tween:Play()
  288. end
  289.  
  290. Tween.Clean = function(self)
  291. if not self.Tween then
  292. return
  293. end
  294.  
  295. Tween:Pause()
  296. self = nil
  297. end
  298. end
  299.  
  300. -- Instances
  301. local Instances = { } do
  302. Instances.__index = Instances
  303.  
  304. Instances.Create = function(self, Class, Properties)
  305. local NewItem = {
  306. Instance = InstanceNew(Class),
  307. Properties = Properties,
  308. Class = Class
  309. }
  310.  
  311. setmetatable(NewItem, Instances)
  312.  
  313. for Property, Value in NewItem.Properties do
  314. NewItem.Instance[Property] = Value
  315. end
  316.  
  317. return NewItem
  318. end
  319.  
  320. Instances.AddToTheme = function(self, Properties)
  321. if not self.Instance then
  322. return
  323. end
  324.  
  325. Library:AddToTheme(self, Properties)
  326. return self
  327. end
  328.  
  329. Instances.ChangeItemTheme = function(self, Properties)
  330. if not self.Instance then
  331. return
  332. end
  333.  
  334. Library:ChangeItemTheme(self, Properties)
  335. end
  336.  
  337. Instances.Connect = function(self, Event, Callback, Name)
  338. if not self.Instance then
  339. return
  340. end
  341.  
  342. if not self.Instance[Event] then
  343. return
  344. end
  345.  
  346. return Library:Connect(self.Instance[Event], Callback, Name)
  347. end
  348.  
  349. Instances.Tween = function(self, Info, Goal)
  350. if not self.Instance then
  351. return
  352. end
  353.  
  354. return Tween:Create(self, Info, Goal)
  355. end
  356.  
  357. Instances.Disconnect = function(self, Name)
  358. if not self.Instance then
  359. return
  360. end
  361.  
  362. return Library:Disconnect(Name)
  363. end
  364.  
  365. Instances.Clean = function(self)
  366. if not self.Instance then
  367. return
  368. end
  369.  
  370. self.Instance:Destroy()
  371. self = nil
  372. end
  373.  
  374. Instances.MakeDraggable = function(self)
  375. if not self.Instance then
  376. return
  377. end
  378.  
  379. local Gui = self.Instance
  380. local Dragging = false
  381. local DragStart
  382. local StartPosition
  383.  
  384. local Set = function(Input)
  385. local DragDelta = Input.Position - DragStart
  386. local NewX = StartPosition.X.Offset + DragDelta.X
  387. local NewY = StartPosition.Y.Offset + DragDelta.Y
  388.  
  389. local ScreenSize = Gui.Parent.AbsoluteSize
  390. local GuiSize = Gui.AbsoluteSize
  391.  
  392. NewX = MathClamp(NewX, 0, ScreenSize.X - GuiSize.X)
  393. NewY = MathClamp(NewY, 0, ScreenSize.Y - GuiSize.Y)
  394.  
  395. self:Tween(TweenInfo.new(0.35, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(0, NewX, 0, NewY)})
  396. end
  397.  
  398. local InputChanged
  399.  
  400. self:Connect("InputBegan", function(Input)
  401. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  402. Dragging = true
  403. DragStart = Input.Position
  404. StartPosition = Gui.Position
  405.  
  406. if InputChanged then
  407. return
  408. end
  409.  
  410. InputChanged = Input.Changed:Connect(function()
  411. if Input.UserInputState == Enum.UserInputState.End then
  412. Dragging = false
  413. InputChanged:Disconnect()
  414. InputChanged = nil
  415. end
  416. end)
  417. end
  418. end)
  419.  
  420. Library:Connect(UserInputService.InputChanged, function(Input)
  421. if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
  422. if Dragging then
  423. Set(Input)
  424. end
  425. end
  426. end)
  427.  
  428. return Dragging
  429. end
  430.  
  431. Instances.MakeResizeable = function(self, Minimum, Maximum)
  432. if not self.Instance then
  433. return
  434. end
  435.  
  436. local Gui = self.Instance
  437.  
  438. local Resizing = false
  439. local CurrentSide = nil
  440.  
  441. local StartMouse = nil
  442. local StartPosition = nil
  443. local StartSize = nil
  444.  
  445. local EdgeThickness = 2
  446.  
  447. local MakeEdge = function(Name, Position, Size)
  448. local Button = Instances:Create("TextButton", {
  449. Name = "\0",
  450. Size = Size,
  451. Position = Position,
  452. BackgroundColor3 = FromRGB(166, 147, 243),
  453. BackgroundTransparency = 1,
  454. Text = "",
  455. BorderSizePixel = 0,
  456. AutoButtonColor = false,
  457. Parent = Gui,
  458. ZIndex = 99999,
  459. }) Button:AddToTheme({BackgroundColor3 = "Accent"})
  460.  
  461. return Button
  462. end
  463.  
  464. local Edges = {
  465. {Button = MakeEdge(
  466. "Left",
  467. UDim2New(0, 0, 0, 0),
  468. UDim2New(0, EdgeThickness, 1, 0)),
  469. Side = "L"
  470. },
  471.  
  472. {Button = MakeEdge(
  473. "Right",
  474. UDim2New(1, -EdgeThickness, 0, 0),
  475. UDim2New(0, EdgeThickness, 1, 0)),
  476. Side = "R"
  477. },
  478.  
  479. {Button = MakeEdge(
  480. "Top", UDim2New(0, 0, 0, 0),
  481. UDim2New(1, 0, 0, EdgeThickness)),
  482. Side = "T"
  483. },
  484.  
  485. {Button = MakeEdge(
  486. "Bottom",
  487. UDim2New(0, 0, 1, -EdgeThickness),
  488. UDim2New(1, 0, 0, EdgeThickness)),
  489. Side = "B"
  490. },
  491. }
  492.  
  493. local BeginResizing = function(Side)
  494. Resizing = true
  495. CurrentSide = Side
  496.  
  497. StartMouse = UserInputService:GetMouseLocation()
  498.  
  499. -- store offsets, not absolute screen pos
  500. StartPosition = Vector2New(Gui.Position.X.Offset, Gui.Position.Y.Offset)
  501. StartSize = Vector2New(Gui.Size.X.Offset, Gui.Size.Y.Offset)
  502.  
  503. for Index, Value in Edges do
  504. Value.Button.Instance.BackgroundTransparency = (Value.Side == Side) and 0 or 1
  505. end
  506. end
  507.  
  508. local EndResizing = function()
  509. Resizing = false
  510. CurrentSide = nil
  511.  
  512. for Index, Value in Edges do
  513. Value.Button.Instance.BackgroundTransparency = 1
  514. end
  515. end
  516.  
  517. for Index, Value in Edges do
  518. Value.Button:Connect("InputBegan", function(Input)
  519. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  520. BeginResizing(Value.Side)
  521. end
  522. end)
  523. end
  524.  
  525. Library:Connect(UserInputService.InputEnded, function(Input)
  526. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  527. if Resizing then
  528. EndResizing()
  529. end
  530. end
  531. end)
  532.  
  533. Library:Connect(RunService.RenderStepped, function()
  534. if not Resizing or not CurrentSide then
  535. return
  536. end
  537.  
  538. local MouseLocation = UserInputService:GetMouseLocation()
  539. local dx = MouseLocation.X - StartMouse.X
  540. local dy = MouseLocation.Y - StartMouse.Y
  541.  
  542. local x, y = StartPosition.X, StartPosition.Y
  543. local w, h = StartSize.X, StartSize.Y
  544.  
  545. if CurrentSide == "L" then
  546. x = StartPosition.X + dx
  547. w = StartSize.X - dx
  548. elseif CurrentSide == "R" then
  549. w = StartSize.X + dx
  550. elseif CurrentSide == "T" then
  551. y = StartPosition.Y + dy
  552. h = StartSize.Y - dy
  553. elseif CurrentSide == "B" then
  554. h = StartSize.Y + dy
  555. end
  556.  
  557. if w < Minimum.X then
  558. if CurrentSide == "L" then
  559. x = x - (Minimum.X - w)
  560. end
  561. w = Minimum.X
  562. end
  563. if h < Minimum.Y then
  564. if CurrentSide == "T" then
  565. y = y - (Minimum.Y - h)
  566. end
  567. h = Minimum.Y
  568. end
  569.  
  570. self:Tween(TweenInfo.new(0.35, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2FromOffset(x, y)})
  571. self:Tween(TweenInfo.new(0.35, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2FromOffset(w, h)})
  572. end)
  573. end
  574.  
  575. Instances.OnHover = function(self, Function)
  576. if not self.Instance then
  577. return
  578. end
  579.  
  580. return Library:Connect(self.Instance.MouseEnter, Function)
  581. end
  582.  
  583. Instances.OnHoverLeave = function(self, Function)
  584. if not self.Instance then
  585. return
  586. end
  587.  
  588. return Library:Connect(self.Instance.MouseLeave, Function)
  589. end
  590. end
  591.  
  592. -- Custom font
  593. local CustomFont = { } do
  594. function CustomFont:New(Name, Weight, Style, Data)
  595. if not isfile(Data.Id) then
  596. writefile(Data.Id, game:HttpGet(Data.Url))
  597. end
  598.  
  599. local Data = {
  600. name = Name,
  601. faces = {
  602. {
  603. name = Name,
  604. weight = Weight,
  605. style = Style,
  606. assetId = getcustomasset(Data.Id)
  607. }
  608. }
  609. }
  610.  
  611. writefile(`{Library.Folders.Assets}/{Name}.font`, HttpService:JSONEncode(Data))
  612. return Font.new(getcustomasset(`{Library.Folders.Assets}/{Name}.font`))
  613. end
  614.  
  615. Library.Font = CustomFont:New("OutfitMedium", 400, "Regular", {
  616. Id = "OutfitMedium",
  617. Url = "https://github.com/sametexe001/luas/raw/refs/heads/main/fonts/Outfit-Medium.ttf"
  618. })
  619. end
  620.  
  621. Library.Holder = Instances:Create("ScreenGui", {
  622. Parent = gethui(),
  623. Name = "\0",
  624. ZIndexBehavior = Enum.ZIndexBehavior.Global,
  625. DisplayOrder = 2,
  626. ResetOnSpawn = false
  627. })
  628.  
  629. Library.UnusedHolder = Instances:Create("ScreenGui", {
  630. Parent = gethui(),
  631. Name = "\0",
  632. ZIndexBehavior = Enum.ZIndexBehavior.Global,
  633. Enabled = false,
  634. ResetOnSpawn = false
  635. })
  636.  
  637. Library.Unload = function(self)
  638. for Index, Value in self.Connections do
  639. Value.Connection:Disconnect()
  640. end
  641.  
  642. for Index, Value in self.Threads do
  643. coroutine.close(Value)
  644. end
  645.  
  646. if self.Holder then
  647. self.Holder:Clean()
  648. end
  649.  
  650. Library = nil
  651. getgenv().Library = nil
  652. end
  653.  
  654. Library.Round = function(self, Number, Float)
  655. local Multiplier = 1 / (Float or 1)
  656. return MathFloor(Number * Multiplier) / Multiplier
  657. end
  658.  
  659. Library.Thread = function(self, Function)
  660. local NewThread = coroutine.create(Function)
  661.  
  662. coroutine.wrap(function()
  663. coroutine.resume(NewThread)
  664. end)()
  665.  
  666. TableInsert(self.Threads, NewThread)
  667. return NewThread
  668. end
  669.  
  670. Library.SafeCall = function(self, Function, ...)
  671. local Arguements = { ... }
  672. local Success, Result = pcall(Function, TableUnpack(Arguements))
  673.  
  674. if not Success then
  675. warn(Result)
  676. return false
  677. end
  678.  
  679. return Success
  680. end
  681.  
  682. Library.Connect = function(self, Event, Callback, Name)
  683. Name = Name or StringFormat("connection_number_%s_%s", self.UnnamedConnections + 1, HttpService:GenerateGUID(false))
  684.  
  685. local NewConnection = {
  686. Event = Event,
  687. Callback = Callback,
  688. Name = Name,
  689. Connection = nil
  690. }
  691.  
  692. Library:Thread(function()
  693. NewConnection.Connection = Event:Connect(Callback)
  694. end)
  695.  
  696. TableInsert(self.Connections, NewConnection)
  697. return NewConnection
  698. end
  699.  
  700. Library.Disconnect = function(self, Name)
  701. for _, Connection in self.Connections do
  702. if Connection.Name == Name then
  703. Connection.Connection:Disconnect()
  704. break
  705. end
  706. end
  707. end
  708.  
  709. Library.NextFlag = function(self)
  710. local FlagNumber = self.UnnamedFlags + 1
  711. return StringFormat("flag_number_%s_%s", FlagNumber, HttpService:GenerateGUID(false))
  712. end
  713.  
  714. Library.AddToTheme = function(self, Item, Properties)
  715. Item = Item.Instance or Item
  716.  
  717. local ThemeData = {
  718. Item = Item,
  719. Properties = Properties,
  720. }
  721.  
  722. for Property, Value in ThemeData.Properties do
  723. if type(Value) == "string" then
  724. if not self.Theme[Value] then
  725. Item[Property] = Value
  726. end
  727.  
  728. Item[Property] = self.Theme[Value]
  729. else
  730. Item[Property] = Value()
  731. end
  732. end
  733.  
  734. TableInsert(self.ThemeItems, ThemeData)
  735. self.ThemeMap[Item] = ThemeData
  736. end
  737.  
  738. Library.ToRich = function(self, Text, Color)
  739. return `<font color="rgb({MathFloor(Color.R * 255)}, {MathFloor(Color.G * 255)}, {MathFloor(Color.B * 255)})">{Text}</font>`
  740. end
  741.  
  742. Library.GetConfig = function(self)
  743. local Config = { }
  744.  
  745. local Success, Result = Library:SafeCall(function()
  746. for Index, Value in Library.Flags do
  747. if type(Value) == "table" and Value.Key then
  748. Config[Index] = {Key = tostring(Value.Key), Mode = Value.Mode}
  749. elseif type(Value) == "table" and Value.Color then
  750. Config[Index] = {Color = "#" .. Value.HexValue, Alpha = Value.Alpha}
  751. else
  752. Config[Index] = Value
  753. end
  754. end
  755. end)
  756.  
  757. return HttpService:JSONEncode(Config)
  758. end
  759.  
  760. Library.LoadConfig = function(self, Config)
  761. local Decoded = HttpService:JSONDecode(Config)
  762.  
  763. local Success, Result = Library:SafeCall(function()
  764. for Index, Value in Decoded do
  765. local SetFunction = Library.SetFlags[Index]
  766.  
  767. if not SetFunction then
  768. continue
  769. end
  770.  
  771. if type(Value) == "table" and Value.Key then
  772. SetFunction(Value)
  773. elseif type(Value) == "table" and Value.Color then
  774. SetFunction(Value.Color, Value.Alpha)
  775. else
  776. SetFunction(Value)
  777. end
  778. end
  779. end)
  780.  
  781. return Success, Result
  782. end
  783.  
  784. Library.DeleteConfig = function(self, Config)
  785. if isfile(Library.Folders.Configs .. "/" .. Config) then
  786. delfile(Library.Folders.Configs .. "/" .. Config)
  787. end
  788. end
  789.  
  790. Library.RefreshConfigsList = function(self, Element)
  791. local List = { }
  792. local ReturnList = { }
  793.  
  794. List = listfiles(Library.Folders.Configs)
  795.  
  796. for Index = 1, #List do
  797. local File = List[Index]
  798.  
  799. if File:sub(-5) == ".json" then
  800. local Position = File:find(".json", 1, true)
  801. local StartPosition = Position
  802.  
  803. local Character = File:sub(Position, Position)
  804. while Character ~= "/" and Character ~= "\\" and Character ~= "" do
  805. Position = Position - 1
  806. Character = File:sub(Position, Position)
  807. end
  808.  
  809. if Character == "/" or Character == "\\" then
  810. TableInsert(ReturnList, File:sub(Position + 1, StartPosition - 1))
  811. end
  812. end
  813. end
  814.  
  815. Element:Refresh(ReturnList)
  816. end
  817.  
  818. Library.ChangeItemTheme = function(self, Item, Properties)
  819. Item = Item.Instance or Item
  820.  
  821. if not self.ThemeMap[Item] then
  822. return
  823. end
  824.  
  825. self.ThemeMap[Item].Properties = Properties
  826. self.ThemeMap[Item] = self.ThemeMap[Item]
  827. end
  828.  
  829. Library.ChangeTheme = function(self, Theme, Color)
  830. self.Theme[Theme] = Color
  831.  
  832. for _, Item in self.ThemeItems do
  833. for Property, Value in Item.Properties do
  834. if type(Value) == "string" and Value == Theme then
  835. Item.Item[Property] = Color
  836. elseif type(Value) == "function" then
  837. Item.Item[Property] = Value()
  838. end
  839. end
  840. end
  841. end
  842.  
  843. Library.IsMouseOverFrame = function(self, Frame)
  844. Frame = Frame.Instance
  845.  
  846. local MousePosition = Vector2New(Mouse.X, Mouse.Y)
  847.  
  848. return MousePosition.X >= Frame.AbsolutePosition.X and MousePosition.X <= Frame.AbsolutePosition.X + Frame.AbsoluteSize.X
  849. and MousePosition.Y >= Frame.AbsolutePosition.Y and MousePosition.Y <= Frame.AbsolutePosition.Y + Frame.AbsoluteSize.Y
  850. end
  851.  
  852. Library.Lerp = function(self, Start, Finish, Time)
  853. return Start + (Finish - Start) * Time
  854. end
  855.  
  856. Library.CompareVectors = function(self, PointA, PointB)
  857. return (PointA.X < PointB.X) or (PointA.Y < PointB.Y)
  858. end
  859.  
  860. Library.IsClipped = function(self, Object, Column)
  861. local Parent = Column
  862.  
  863. local BoundryTop = Parent.AbsolutePosition
  864. local BoundryBottom = BoundryTop + Parent.AbsoluteSize
  865.  
  866. local Top = Object.AbsolutePosition
  867. local Bottom = Top + Object.AbsoluteSize
  868.  
  869. return Library:CompareVectors(Top, BoundryTop) or Library:CompareVectors(BoundryBottom, Bottom)
  870. end
  871.  
  872. Library.CreateColorpicker = function(self, Data)
  873. local Colorpicker = {
  874. Flag = Data.Flag,
  875.  
  876. Hue = 0,
  877. Saturation = 0,
  878. Value = 0,
  879.  
  880. Color = Color3.fromRGB(0, 0, 0),
  881. Hex = "#000000",
  882.  
  883. IsOpen = false
  884. }
  885.  
  886. local Items = { } do
  887. Items["ColorpickerButton"] = Instances:Create("TextButton", {
  888. Parent = Data.Parent.Instance,
  889. Name = "\0",
  890. FontFace = Library.Font,
  891. TextColor3 = FromRGB(0, 0, 0),
  892. BorderColor3 = FromRGB(0, 0, 0),
  893. Text = "",
  894. AutoButtonColor = false,
  895. Size = UDim2New(0, 20, 0, 16),
  896. BorderSizePixel = 0,
  897. TextSize = 14,
  898. BackgroundColor3 = FromRGB(148, 255, 237)
  899. })
  900.  
  901. Instances:Create("UICorner", {
  902. Parent = Items["ColorpickerButton"].Instance,
  903. Name = "\0",
  904. CornerRadius = UDimNew(0, 6)
  905. })
  906.  
  907. Instances:Create("UIStroke", {
  908. Parent = Items["ColorpickerButton"].Instance,
  909. Name = "\0",
  910. Color = Library.Theme["Outline"],
  911. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  912. }):AddToTheme({Color = 'Outline'})
  913.  
  914. Items["Glow"] = Instances:Create("ImageLabel", {
  915. Parent = Items["ColorpickerButton"].Instance,
  916. Name = "\0",
  917. ImageColor3 = FromRGB(148, 255, 237),
  918. ScaleType = Enum.ScaleType.Slice,
  919. ImageTransparency = 0.800000011920929,
  920. BorderColor3 = FromRGB(0, 0, 0),
  921. Size = UDim2New(1, 25, 1, 25),
  922. AnchorPoint = Vector2New(0.5, 0.5),
  923. Image = "http://www.roblox.com/asset/?id=18245826428",
  924. BackgroundTransparency = 1,
  925. Position = UDim2New(0.5, 0, 0.5, 0),
  926. ZIndex = 2,
  927. BorderSizePixel = 0,
  928. SliceCenter = RectNew(Vector2New(21, 21), Vector2New(79, 79))
  929. })
  930.  
  931. Items["ColorpickerWindow"] = Instances:Create("TextButton", {
  932. Parent = Library.UnusedHolder.Instance,
  933. Name = "\0",
  934. FontFace = Library.Font,
  935. TextColor3 = FromRGB(0, 0, 0),
  936. BorderColor3 = FromRGB(0, 0, 0),
  937. Text = "",
  938. AutoButtonColor = false,
  939. Position = UDim2New(0, 94, 0, 60),
  940. Size = UDim2New(0, 160, 0, 160),
  941. BorderSizePixel = 0,
  942. TextSize = 14,
  943. BackgroundColor3 = Library.Theme["Background"]
  944. }):AddToTheme({BackgroundColor3 = 'Background'})
  945.  
  946. Instances:Create("UICorner", {
  947. Parent = Items["ColorpickerWindow"].Instance,
  948. Name = "\0",
  949. CornerRadius = UDimNew(0, 6)
  950. })
  951.  
  952. Items["Palette"] = Instances:Create("TextButton", {
  953. Parent = Items["ColorpickerWindow"].Instance,
  954. Name = "\0",
  955. FontFace = Library.Font,
  956. TextColor3 = FromRGB(0, 0, 0),
  957. BorderColor3 = FromRGB(0, 0, 0),
  958. Text = "",
  959. AutoButtonColor = false,
  960. Position = UDim2New(0, 8, 0, 8),
  961. Size = UDim2New(1, -40, 1, -16),
  962. BorderSizePixel = 0,
  963. TextSize = 14,
  964. BackgroundColor3 = FromRGB(148, 255, 237)
  965. })
  966.  
  967. Instances:Create("UICorner", {
  968. Parent = Items["Palette"].Instance,
  969. Name = "\0",
  970. CornerRadius = UDimNew(0, 5)
  971. })
  972.  
  973. Items["Saturation"] = Instances:Create("Frame", {
  974. Parent = Items["Palette"].Instance,
  975. Name = "\0",
  976. BorderColor3 = FromRGB(0, 0, 0),
  977. Size = UDim2New(1, 1, 1, 0),
  978. BorderSizePixel = 0
  979. })
  980.  
  981. Instances:Create("UIGradient", {
  982. Parent = Items["Saturation"].Instance,
  983. Name = "\0",
  984. Transparency = NumSequence{NumSequenceKeypoint(0, 1), NumSequenceKeypoint(1, 0)}
  985. })
  986.  
  987. Instances:Create("UICorner", {
  988. Parent = Items["Saturation"].Instance,
  989. Name = "\0",
  990. CornerRadius = UDimNew(0, 5)
  991. })
  992.  
  993. Items["Value"] = Instances:Create("Frame", {
  994. Parent = Items["Palette"].Instance,
  995. Name = "\0",
  996. BorderColor3 = FromRGB(0, 0, 0),
  997. Size = UDim2New(1, 1, 1, 1),
  998. BorderSizePixel = 0,
  999. BackgroundColor3 = FromRGB(0, 0, 0)
  1000. })
  1001.  
  1002. Instances:Create("UIGradient", {
  1003. Parent = Items["Value"].Instance,
  1004. Name = "\0",
  1005. Rotation = 90,
  1006. Transparency = NumSequence{NumSequenceKeypoint(0, 1), NumSequenceKeypoint(1, 0)}
  1007. })
  1008.  
  1009. Instances:Create("UICorner", {
  1010. Parent = Items["Value"].Instance,
  1011. Name = "\0",
  1012. CornerRadius = UDimNew(0, 5)
  1013. })
  1014.  
  1015. Items["PaletteDragger"] = Instances:Create("Frame", {
  1016. Parent = Items["Palette"].Instance,
  1017. Name = "\0",
  1018. BorderColor3 = FromRGB(0, 0, 0),
  1019. Size = UDim2New(0, 5, 0, 5),
  1020. BorderSizePixel = 0
  1021. })
  1022.  
  1023. Instances:Create("UIStroke", {
  1024. Parent = Items["PaletteDragger"].Instance,
  1025. Name = "\0"
  1026. })
  1027.  
  1028. Instances:Create("UICorner", {
  1029. Parent = Items["PaletteDragger"].Instance,
  1030. Name = "\0",
  1031. CornerRadius = UDimNew(1, 0)
  1032. })
  1033.  
  1034. Items["Hue"] = Instances:Create("TextButton", {
  1035. Parent = Items["ColorpickerWindow"].Instance,
  1036. Name = "\0",
  1037. FontFace = Library.Font,
  1038. TextColor3 = FromRGB(0, 0, 0),
  1039. BorderColor3 = FromRGB(0, 0, 0),
  1040. Text = "",
  1041. AutoButtonColor = false,
  1042. AnchorPoint = Vector2New(1, 0),
  1043. Position = UDim2New(1, -8, 0, 8),
  1044. Size = UDim2New(0, 15, 1, -16),
  1045. BorderSizePixel = 0,
  1046. TextSize = 14
  1047. })
  1048.  
  1049. Instances:Create("UIGradient", {
  1050. Parent = Items["Hue"].Instance,
  1051. Name = "\0",
  1052. Rotation = 90,
  1053. 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))}
  1054. })
  1055.  
  1056. Instances:Create("UICorner", {
  1057. Parent = Items["Hue"].Instance,
  1058. Name = "\0",
  1059. CornerRadius = UDimNew(0, 6)
  1060. })
  1061.  
  1062. Items["HueDragger"] = Instances:Create("Frame", {
  1063. Parent = Items["Hue"].Instance,
  1064. Name = "\0",
  1065. BackgroundTransparency = 1,
  1066. BorderColor3 = FromRGB(0, 0, 0),
  1067. Size = UDim2New(0, 15, 0, 15),
  1068. BorderSizePixel = 0
  1069. })
  1070.  
  1071. Instances:Create("UICorner", {
  1072. Parent = Items["HueDragger"].Instance,
  1073. Name = "\0",
  1074. CornerRadius = UDimNew(1, 0)
  1075. })
  1076.  
  1077. Instances:Create("UIStroke", {
  1078. Parent = Items["HueDragger"].Instance,
  1079. Name = "\0"
  1080. })
  1081. end
  1082.  
  1083. function Colorpicker:Get()
  1084. return Colorpicker.Color
  1085. end
  1086.  
  1087. function Colorpicker:Update()
  1088. local Hue, Saturation, Value = Colorpicker.Hue, Colorpicker.Saturation, Colorpicker.Value
  1089. Colorpicker.Color = FromHSV(Hue, Saturation, Value)
  1090. Colorpicker.HexValue = Colorpicker.Color:ToHex()
  1091.  
  1092. Library.Flags[Colorpicker.Flag] = {
  1093. Color = Colorpicker.Color,
  1094. HexValue = Colorpicker.HexValue
  1095. }
  1096.  
  1097. Items["ColorpickerButton"]:Tween(nil, {BackgroundColor3 = Colorpicker.Color})
  1098. Items["Glow"]:Tween(nil, {ImageColor3 = Colorpicker.Color})
  1099. Items["Palette"]:Tween(nil, {BackgroundColor3 = FromHSV(Hue, 1, 1)})
  1100.  
  1101. if Data.Callback then
  1102. Library:SafeCall(Data.Callback, Colorpicker.Color)
  1103. end
  1104. end
  1105.  
  1106. local SlidingPalette = false
  1107. local PaletteChanged
  1108.  
  1109. function Colorpicker:SlidePalette(Input)
  1110. if not Input or not SlidingPalette then
  1111. return
  1112. end
  1113.  
  1114. local ValueX = MathClamp(1 - (Input.Position.X - Items["Palette"].Instance.AbsolutePosition.X) / Items["Palette"].Instance.AbsoluteSize.X, 0, 1)
  1115. local ValueY = MathClamp(1 - (Input.Position.Y - Items["Palette"].Instance.AbsolutePosition.Y) / Items["Palette"].Instance.AbsoluteSize.Y, 0, 1)
  1116.  
  1117. Colorpicker.Saturation = ValueX
  1118. Colorpicker.Value = ValueY
  1119.  
  1120. local SlideX = MathClamp((Input.Position.X - Items["Palette"].Instance.AbsolutePosition.X) / Items["Palette"].Instance.AbsoluteSize.X, 0, 0.955)
  1121. local SlideY = MathClamp((Input.Position.Y - Items["Palette"].Instance.AbsolutePosition.Y) / Items["Palette"].Instance.AbsoluteSize.Y, 0, 0.955)
  1122.  
  1123. Items["PaletteDragger"]:Tween(TweenInfo.new(Library.Tween.Time, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(SlideX, 0, SlideY, 0)})
  1124. Colorpicker:Update()
  1125. end
  1126.  
  1127. local SlidingHue = false
  1128. local HueChanged
  1129.  
  1130. function Colorpicker:SlideHue(Input)
  1131. if not Input or not SlidingHue then
  1132. return
  1133. end
  1134.  
  1135. local ValueY = MathClamp((Input.Position.Y - Items["Hue"].Instance.AbsolutePosition.Y) / Items["Hue"].Instance.AbsoluteSize.Y, 0, 1)
  1136.  
  1137. Colorpicker.Hue = ValueY
  1138.  
  1139. local SlideY = MathClamp((Input.Position.Y - Items["Hue"].Instance.AbsolutePosition.Y) / Items["Hue"].Instance.AbsoluteSize.Y, 0, 0.91)
  1140.  
  1141. Items["HueDragger"]:Tween(TweenInfo.new(Library.Tween.Time, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(0, 0, SlideY, 0)})
  1142. Colorpicker:Update()
  1143. end
  1144.  
  1145. local Debounce = false
  1146. local RenderStepped
  1147.  
  1148. function Colorpicker:SetOpen(Bool)
  1149. if Debounce then
  1150. return
  1151. end
  1152.  
  1153. Colorpicker.IsOpen = Bool
  1154.  
  1155. Debounce = true
  1156.  
  1157. if Colorpicker.IsOpen then
  1158. Items["ColorpickerWindow"].Instance.Visible = true
  1159. Items["ColorpickerWindow"].Instance.Parent = Library.Holder.Instance
  1160.  
  1161. RenderStepped = RunService.RenderStepped:Connect(function()
  1162. Items["ColorpickerWindow"].Instance.Position = UDim2New(
  1163. 0,
  1164. Items["ColorpickerButton"].Instance.AbsolutePosition.X,
  1165. 0,
  1166. Items["ColorpickerButton"].Instance.AbsolutePosition.Y + Items["ColorpickerButton"].Instance.AbsoluteSize.Y + 5
  1167. )
  1168. end)
  1169.  
  1170. for Index, Value in Library.OpenFrames do
  1171. if Value ~= Colorpicker then
  1172. Value:SetOpen(false)
  1173. end
  1174. end
  1175.  
  1176. Library.OpenFrames[Colorpicker] = Colorpicker
  1177. else
  1178. if Library.OpenFrames[Colorpicker] then
  1179. Library.OpenFrames[Colorpicker] = nil
  1180. end
  1181.  
  1182. if RenderStepped then
  1183. RenderStepped:Disconnect()
  1184. RenderStepped = nil
  1185. end
  1186. end
  1187.  
  1188. local Descendants = Items["ColorpickerWindow"].Instance:GetDescendants()
  1189. TableInsert(Descendants, Items["ColorpickerWindow"].Instance)
  1190.  
  1191. local NewTween
  1192.  
  1193. for Index, Value in Descendants do
  1194. local TransparencyProperty = Tween:GetProperty(Value)
  1195.  
  1196. if not TransparencyProperty then
  1197. continue
  1198. end
  1199.  
  1200. if not Value.ClassName:find("UI") then
  1201. Value.ZIndex = (Colorpicker.IsOpen and Data.Section.IsSettings and 9) or (Colorpicker.IsOpen and not Data.Section.IsSettings and 3) or 1
  1202. end
  1203.  
  1204. if type(TransparencyProperty) == "table" then
  1205. for _, Property in TransparencyProperty do
  1206. NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
  1207. end
  1208. else
  1209. NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
  1210. end
  1211. end
  1212.  
  1213. NewTween.Tween.Completed:Connect(function()
  1214. Debounce = false
  1215. Items["ColorpickerWindow"].Instance.Visible = Colorpicker.IsOpen
  1216. task.wait(0.2)
  1217. Items["ColorpickerWindow"].Instance.Parent = not Colorpicker.IsOpen and Library.UnusedHolder.Instance or Library.Holder.Instance
  1218. end)
  1219. end
  1220.  
  1221. function Colorpicker:Set(Color)
  1222. if type(Color) == "table" then
  1223. Color = FromRGB(Color[1], Color[2], Color[3])
  1224. elseif type(Color) == "string" then
  1225. Color = FromHex(Color)
  1226. end
  1227.  
  1228. Colorpicker.Hue, Colorpicker.Saturation, Colorpicker.Value = Color:ToHSV()
  1229.  
  1230. local PaletteValueX = MathClamp(1 - Colorpicker.Saturation, 0, 0.955)
  1231. local PaletteValueY = MathClamp(1 - Colorpicker.Value, 0, 0.955)
  1232.  
  1233. local HuePositionY = MathClamp(Colorpicker.Hue, 0, 0.955)
  1234.  
  1235. Items["PaletteDragger"]:Tween(TweenInfo.new(Library.Tween.Time, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(PaletteValueX, 0, PaletteValueY, 0)})
  1236. Items["HueDragger"]:Tween(TweenInfo.new(Library.Tween.Time, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2New(0, 0, HuePositionY, 0)})
  1237. Colorpicker:Update()
  1238. end
  1239.  
  1240. Items["ColorpickerButton"]:Connect("MouseButton1Down", function()
  1241. Colorpicker:SetOpen(not Colorpicker.IsOpen)
  1242. end)
  1243.  
  1244. Items["Palette"]:Connect("InputBegan", function(Input)
  1245. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1246. SlidingPalette = true
  1247.  
  1248. Colorpicker:SlidePalette(Input)
  1249.  
  1250. if PaletteChanged then
  1251. return
  1252. end
  1253.  
  1254. PaletteChanged = Input.Changed:Connect(function()
  1255. if Input.UserInputState == Enum.UserInputState.End then
  1256. SlidingPalette = false
  1257.  
  1258. PaletteChanged:Disconnect()
  1259. PaletteChanged = nil
  1260. end
  1261. end)
  1262. end
  1263. end)
  1264.  
  1265. Items["Hue"]:Connect("InputBegan", function(Input)
  1266. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1267. SlidingHue = true
  1268.  
  1269. Colorpicker:SlideHue(Input)
  1270.  
  1271. if HueChanged then
  1272. return
  1273. end
  1274.  
  1275. HueChanged = Input.Changed:Connect(function()
  1276. if Input.UserInputState == Enum.UserInputState.End then
  1277. SlidingHue = false
  1278.  
  1279. HueChanged:Disconnect()
  1280. HueChanged = nil
  1281. end
  1282. end)
  1283. end
  1284. end)
  1285.  
  1286. Library:Connect(UserInputService.InputChanged, function(Input)
  1287. if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
  1288. if SlidingPalette then
  1289. Colorpicker:SlidePalette(Input)
  1290. end
  1291.  
  1292. if SlidingHue then
  1293. Colorpicker:SlideHue(Input)
  1294. end
  1295. end
  1296. end)
  1297.  
  1298. Library:Connect(UserInputService.InputBegan, function(Input)
  1299. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  1300. if not Colorpicker.IsOpen then
  1301. return
  1302. end
  1303.  
  1304. if Library:IsMouseOverFrame(Items["ColorpickerWindow"]) then
  1305. return
  1306. end
  1307.  
  1308. Colorpicker:SetOpen(false)
  1309. end
  1310. end)
  1311.  
  1312. if Data.Default then
  1313. Colorpicker:Set(Data.Default)
  1314. end
  1315.  
  1316. Library.SetFlags[Colorpicker.Flag] = function(Value)
  1317. Colorpicker:Set(Value)
  1318. end
  1319.  
  1320. return Colorpicker, Items
  1321. end
  1322.  
  1323. Library.CreateKeybind = function(self, Data)
  1324. local Keybind = {
  1325. Flag = Data.Flag,
  1326.  
  1327. Value = "",
  1328. Key = "",
  1329. Mode = "",
  1330.  
  1331. Toggled = false,
  1332. Picking = false,
  1333. IsOpen = false
  1334. }
  1335.  
  1336. local Items = { } do
  1337. Items["KeyButton"] = Instances:Create("TextButton", {
  1338. Parent = Data.Parent.Instance,
  1339. Name = "\0",
  1340. FontFace = Library.Font,
  1341. TextColor3 = Library.Theme["Text"],
  1342. TextTransparency = 0.5,
  1343. Text = "[C]",
  1344. AutoButtonColor = false,
  1345. Size = UDim2New(0, 0, 1, 0),
  1346. BackgroundTransparency = 1,
  1347. BorderSizePixel = 0,
  1348. BorderColor3 = FromRGB(0, 0, 0),
  1349. AutomaticSize = Enum.AutomaticSize.X,
  1350. TextSize = 16
  1351. }):AddToTheme({TextColor3 = 'Text'})
  1352.  
  1353. Items["KeybindWindow"] = Instances:Create("TextButton", {
  1354. Parent = Library.UnusedHolder.Instance,
  1355. Name = "\0",
  1356. Visible = false,
  1357. FontFace = Library.Font,
  1358. TextColor3 = FromRGB(0, 0, 0),
  1359. BorderColor3 = FromRGB(0, 0, 0),
  1360. Text = "",
  1361. AutoButtonColor = false,
  1362. Position = UDim2New(0, 10, 0, 10),
  1363. BorderSizePixel = 0,
  1364. AutomaticSize = Enum.AutomaticSize.XY,
  1365. TextSize = 14,
  1366. BackgroundColor3 = Library.Theme["Background"]
  1367. }):AddToTheme({BackgroundColor3 = 'Background'})
  1368.  
  1369. Instances:Create("UICorner", {
  1370. Parent = Items["KeybindWindow"].Instance,
  1371. Name = "\0",
  1372. CornerRadius = UDimNew(0, 6)
  1373. })
  1374.  
  1375. Items["Toggle"] = Instances:Create("TextButton", {
  1376. Parent = Items["KeybindWindow"].Instance,
  1377. Name = "\0",
  1378. FontFace = Library.Font,
  1379. TextColor3 = Library.Theme["Text"],
  1380. BorderColor3 = FromRGB(0, 0, 0),
  1381. Text = "Toggle",
  1382. AutoButtonColor = false,
  1383. BackgroundTransparency = 1,
  1384. Size = UDim2New(0, 0, 0, 15),
  1385. BorderSizePixel = 0,
  1386. AutomaticSize = Enum.AutomaticSize.X,
  1387. TextSize = 14
  1388. }):AddToTheme({TextColor3 = 'Text'})
  1389.  
  1390. Instances:Create("UIListLayout", {
  1391. Parent = Items["KeybindWindow"].Instance,
  1392. Name = "\0",
  1393. Padding = UDimNew(0, 6),
  1394. SortOrder = Enum.SortOrder.LayoutOrder
  1395. })
  1396.  
  1397. Instances:Create("UIPadding", {
  1398. Parent = Items["KeybindWindow"].Instance,
  1399. Name = "\0",
  1400. PaddingTop = UDimNew(0, 10),
  1401. PaddingBottom = UDimNew(0, 10),
  1402. PaddingRight = UDimNew(0, 10),
  1403. PaddingLeft = UDimNew(0, 10)
  1404. })
  1405.  
  1406. Items["Hold"] = Instances:Create("TextButton", {
  1407. Parent = Items["KeybindWindow"].Instance,
  1408. Name = "\0",
  1409. FontFace = Library.Font,
  1410. TextColor3 = Library.Theme["Text"],
  1411. TextTransparency = 0.5,
  1412. Text = "Hold",
  1413. AutoButtonColor = false,
  1414. Size = UDim2New(0, 0, 0, 15),
  1415. BackgroundTransparency = 1,
  1416. BorderSizePixel = 0,
  1417. BorderColor3 = FromRGB(0, 0, 0),
  1418. AutomaticSize = Enum.AutomaticSize.X,
  1419. TextSize = 14
  1420. }):AddToTheme({TextColor3 = 'Text'})
  1421.  
  1422. Items["Always"] = Instances:Create("TextButton", {
  1423. Parent = Items["KeybindWindow"].Instance,
  1424. Name = "\0",
  1425. FontFace = Library.Font,
  1426. TextColor3 = Library.Theme["Text"],
  1427. TextTransparency = 0.5,
  1428. Text = "Always",
  1429. AutoButtonColor = false,
  1430. Size = UDim2New(0, 0, 0, 15),
  1431. BackgroundTransparency = 1,
  1432. BorderSizePixel = 0,
  1433. BorderColor3 = FromRGB(0, 0, 0),
  1434. AutomaticSize = Enum.AutomaticSize.X,
  1435. TextSize = 14
  1436. }):AddToTheme({TextColor3 = 'Text'})
  1437. end
  1438.  
  1439. local Modes = {
  1440. Toggle = Items["Toggle"],
  1441. Hold = Items["Hold"],
  1442. Always = Items["Always"]
  1443. }
  1444.  
  1445. local Debounce = false
  1446. local RenderStepped
  1447.  
  1448. function Keybind:SetOpen(Bool)
  1449. if Debounce then
  1450. return
  1451. end
  1452.  
  1453. Keybind.IsOpen = Bool
  1454.  
  1455. Debounce = true
  1456.  
  1457. if Keybind.IsOpen then
  1458. Items["KeybindWindow"].Instance.Visible = true
  1459. Items["KeybindWindow"].Instance.Parent = Library.Holder.Instance
  1460.  
  1461. RenderStepped = RunService.RenderStepped:Connect(function()
  1462. Items["KeybindWindow"].Instance.Position = UDim2New(
  1463. 0,
  1464. Items["KeyButton"].Instance.AbsolutePosition.X,
  1465. 0,
  1466. Items["KeyButton"].Instance.AbsolutePosition.Y + Items["KeyButton"].Instance.AbsoluteSize.Y + 5
  1467. )
  1468. end)
  1469.  
  1470. for Index, Value in Library.OpenFrames do
  1471. if Value ~= Keybind then
  1472. Value:SetOpen(false)
  1473. end
  1474. end
  1475.  
  1476. Library.OpenFrames[Keybind] = Keybind
  1477. else
  1478. if Library.OpenFrames[Keybind] then
  1479. Library.OpenFrames[Keybind] = nil
  1480. end
  1481.  
  1482. if RenderStepped then
  1483. RenderStepped:Disconnect()
  1484. RenderStepped = nil
  1485. end
  1486. end
  1487.  
  1488. local Descendants = Items["KeybindWindow"].Instance:GetDescendants()
  1489. TableInsert(Descendants, Items["KeybindWindow"].Instance)
  1490.  
  1491. local NewTween
  1492.  
  1493. for Index, Value in Descendants do
  1494. local TransparencyProperty = Tween:GetProperty(Value)
  1495.  
  1496. if not TransparencyProperty then
  1497. continue
  1498. end
  1499.  
  1500. if not Value.ClassName:find("UI") then
  1501. Value.ZIndex = Keybind.IsOpen and 4 or 1
  1502. end
  1503.  
  1504. if type(TransparencyProperty) == "table" then
  1505. for _, Property in TransparencyProperty do
  1506. NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
  1507. end
  1508. else
  1509. NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
  1510. end
  1511. end
  1512.  
  1513. NewTween.Tween.Completed:Connect(function()
  1514. Debounce = false
  1515. Items["KeybindWindow"].Instance.Visible = Keybind.IsOpen
  1516. task.wait(0.2)
  1517. Items["KeybindWindow"].Instance.Parent = not Keybind.IsOpen and Library.UnusedHolder.Instance or Library.Holder.Instance
  1518. end)
  1519. end
  1520.  
  1521. function Keybind:SetMode(Mode)
  1522. for Index, Value in Modes do
  1523. if Index == Mode then
  1524. Value:Tween(nil, {TextTransparency = 0})
  1525. else
  1526. Value:Tween(nil, {TextTransparency = 0.5})
  1527. end
  1528. end
  1529.  
  1530. Library.Flags[Keybind.Flag] = {
  1531. Mode = Keybind.Mode,
  1532. Key = Keybind.Key,
  1533. Toggled = Keybind.Toggled
  1534. }
  1535.  
  1536. if Data.Callback then
  1537. Library:SafeCall(Data.Callback, Keybind.Toggled)
  1538. end
  1539. end
  1540.  
  1541. function Keybind:Press(Bool)
  1542. if Keybind.Mode == "Toggle" then
  1543. Keybind.Toggled = not Keybind.Toggled
  1544. elseif Keybind.Mode == "Hold" then
  1545. Keybind.Toggled = Bool
  1546. elseif Keybind.Mode == "Always" then
  1547. Keybind.Toggled = true
  1548. end
  1549.  
  1550. Library.Flags[Keybind.Flag] = {
  1551. Mode = Keybind.Mode,
  1552. Key = Keybind.Key,
  1553. Toggled = Keybind.Toggled
  1554. }
  1555.  
  1556. if Data.Callback then
  1557. Library:SafeCall(Data.Callback, Keybind.Toggled)
  1558. end
  1559. end
  1560.  
  1561. function Keybind:Get()
  1562. return Keybind.Key, Keybind.Mode, Keybind.Toggled
  1563. end
  1564.  
  1565. function Keybind:Set(Key)
  1566. if StringFind(tostring(Key), "Enum") then
  1567. Keybind.Key = tostring(Key)
  1568.  
  1569. Key = Key.Name == "Backspace" and "None" or Key.Name
  1570.  
  1571. local KeyString = Keys[Keybind.Key] or StringGSub(Key, "Enum.", "") or "None"
  1572. local TextToDisplay = StringGSub(StringGSub(KeyString, "KeyCode.", ""), "UserInputType.", "") or "None"
  1573.  
  1574. Keybind.Value = TextToDisplay
  1575. Items["KeyButton"].Instance.Text = "["..TextToDisplay.."]"
  1576.  
  1577. Library.Flags[Keybind.Flag] = {
  1578. Mode = Keybind.Mode,
  1579. Key = Keybind.Key,
  1580. Toggled = Keybind.Toggled
  1581. }
  1582.  
  1583. if Data.Callback then
  1584. Library:SafeCall(Data.Callback, Keybind.Toggled)
  1585. end
  1586. elseif type(Key) == "table" then
  1587. local RealKey = Key.Key == "Backspace" and "None" or Key.Key
  1588. Keybind.Key = tostring(Key.Key)
  1589.  
  1590. if Key.Mode then
  1591. Keybind.Mode = Key.Mode
  1592. Keybind:SetMode(Key.Mode)
  1593. else
  1594. Keybind.Mode = "Toggle"
  1595. Keybind:SetMode("Toggle")
  1596. end
  1597.  
  1598. local KeyString = Keys[Keybind.Key] or StringGSub(tostring(RealKey), "Enum.", "") or RealKey
  1599. local TextToDisplay = KeyString and StringGSub(StringGSub(KeyString, "KeyCode.", ""), "UserInputType.", "") or "None"
  1600.  
  1601. TextToDisplay = StringGSub(StringGSub(KeyString, "KeyCode.", ""), "UserInputType.", "")
  1602.  
  1603. Keybind.Value = TextToDisplay
  1604. Items["KeyButton"].Instance.Text = "["..TextToDisplay.."]"
  1605.  
  1606. if Data.Callback then
  1607. Library:SafeCall(Data.Callback, Keybind.Toggled)
  1608. end
  1609. elseif TableFind({"Toggle", "Hold", "Always"}, Key) then
  1610. Keybind.Mode = Key
  1611. Keybind:SetMode(Key)
  1612.  
  1613. if Data.Callback then
  1614. Library:SafeCall(Data.Callback, Keybind.Toggled)
  1615. end
  1616. end
  1617.  
  1618. Keybind.Picking = false
  1619. end
  1620.  
  1621. Items["KeyButton"]:Connect("MouseButton1Click", function()
  1622. Keybind.Picking = true
  1623.  
  1624. Items["KeyButton"].Instance.Text = "..."
  1625.  
  1626. local InputBegan
  1627. InputBegan = UserInputService.InputBegan:Connect(function(Input)
  1628. if Input.UserInputType == Enum.UserInputType.Keyboard then
  1629. Keybind:Set(Input.KeyCode)
  1630. else
  1631. Keybind:Set(Input.UserInputType)
  1632. end
  1633.  
  1634. InputBegan:Disconnect()
  1635. InputBegan = nil
  1636. end)
  1637. end)
  1638.  
  1639. Library:Connect(UserInputService.InputBegan, function(Input)
  1640. if Keybind.Value == "None" then
  1641. return
  1642. end
  1643.  
  1644. if tostring(Input.KeyCode) == Keybind.Key then
  1645. if Keybind.Mode == "Toggle" then
  1646. Keybind:Press()
  1647. elseif Keybind.Mode == "Hold" then
  1648. Keybind:Press(true)
  1649. elseif Keybind.Mode == "Always" then
  1650. Keybind:Press(true)
  1651. end
  1652. elseif tostring(Input.UserInputType) == Keybind.Key then
  1653. if Keybind.Mode == "Toggle" then
  1654. Keybind:Press()
  1655. elseif Keybind.Mode == "Hold" then
  1656. Keybind:Press(true)
  1657. elseif Keybind.Mode == "Always" then
  1658. Keybind:Press(true)
  1659. end
  1660. end
  1661.  
  1662. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  1663. if not Keybind.IsOpen then
  1664. return
  1665. end
  1666.  
  1667. if Library:IsMouseOverFrame(Items["KeybindWindow"]) then
  1668. return
  1669. end
  1670.  
  1671. Keybind:SetOpen(false)
  1672. end
  1673. end)
  1674.  
  1675. Library:Connect(UserInputService.InputEnded, function(Input)
  1676. if Keybind.Value == "None" then
  1677. return
  1678. end
  1679.  
  1680. if tostring(Input.KeyCode) == Keybind.Key then
  1681. if Keybind.Mode == "Hold" then
  1682. Keybind:Press(false)
  1683. elseif Keybind.Mode == "Always" then
  1684. Keybind:Press(true)
  1685. end
  1686. elseif tostring(Input.UserInputType) == Keybind.Key then
  1687. if Keybind.Mode == "Hold" then
  1688. Keybind:Press(false)
  1689. elseif Keybind.Mode == "Always" then
  1690. Keybind:Press(true)
  1691. end
  1692. end
  1693. end)
  1694.  
  1695. Items["KeyButton"]:Connect("MouseButton2Down", function()
  1696. Keybind:SetOpen(not Keybind.IsOpen)
  1697. end)
  1698.  
  1699. Items["Toggle"]:Connect("MouseButton1Down", function()
  1700. Keybind.Mode = "Toggle"
  1701. Keybind:SetMode("Toggle")
  1702. end)
  1703.  
  1704. Items["Hold"]:Connect("MouseButton1Down", function()
  1705. Keybind.Mode = "Hold"
  1706. Keybind:SetMode("Hold")
  1707. end)
  1708.  
  1709. Items["Always"]:Connect("MouseButton1Down", function()
  1710. Keybind.Mode = "Always"
  1711. Keybind:SetMode("Always")
  1712. end)
  1713.  
  1714. if Data.Default then
  1715. Keybind:Set({
  1716. Mode = Data.Mode or "Toggle",
  1717. Key = Data.Default,
  1718. })
  1719. end
  1720.  
  1721. Library.SetFlags[Keybind.Flag] = function(Value)
  1722. Keybind:Set(Value)
  1723. end
  1724.  
  1725. return Keybind, Items
  1726. end
  1727.  
  1728. do
  1729. Library.Watermark = function(self, Name, Logo)
  1730. local Watermark = { }
  1731.  
  1732. local Items = { } do
  1733. Items["Watermark"] = Instances:Create("Frame", {
  1734. Parent = Library.Holder.Instance,
  1735. Name = "\0",
  1736. BorderColor3 = FromRGB(0, 0, 0),
  1737. AnchorPoint = Vector2New(0.5, 0),
  1738. Position = UDim2New(0.5, 0, 0, 20),
  1739. Size = UDim2New(0, 0, 0, 35),
  1740. BorderSizePixel = 0,
  1741. AutomaticSize = Enum.AutomaticSize.X,
  1742. BackgroundColor3 = Library.Theme["Background"]
  1743. }):AddToTheme({BackgroundColor3 = 'Background'})
  1744.  
  1745. Items["Watermark"]:MakeDraggable()
  1746.  
  1747. Instances:Create("UICorner", {
  1748. Parent = Items["Watermark"].Instance,
  1749. Name = "\0",
  1750. CornerRadius = UDimNew(0, 6)
  1751. })
  1752.  
  1753. Instances:Create("UIPadding", {
  1754. Parent = Items["Watermark"].Instance,
  1755. Name = "\0",
  1756. PaddingRight = UDimNew(0, 8),
  1757. PaddingLeft = UDimNew(0, 8)
  1758. })
  1759.  
  1760. Items["Logo"] = Instances:Create("ImageLabel", {
  1761. Parent = Items["Watermark"].Instance,
  1762. Name = "\0",
  1763. ScaleType = Enum.ScaleType.Fit,
  1764. BorderColor3 = FromRGB(0, 0, 0),
  1765. AnchorPoint = Vector2New(0, 0.5),
  1766. Image = Logo,
  1767. BackgroundTransparency = 1,
  1768. Position = UDim2New(0, 0, 0.5, 0),
  1769. Size = UDim2New(0, 25, 0, 25),
  1770. BorderSizePixel = 0
  1771. })
  1772.  
  1773. Items["Text"] = Instances:Create("TextLabel", {
  1774. Parent = Items["Watermark"].Instance,
  1775. Name = "\0",
  1776. FontFace = Library.Font,
  1777. TextColor3 = Library.Theme["Text"],
  1778. BorderColor3 = FromRGB(0, 0, 0),
  1779. Text = "Perccss in my sodaa",
  1780. AnchorPoint = Vector2New(0, 0.5),
  1781. Size = UDim2New(0, 0, 0, 15),
  1782. BackgroundTransparency = 1,
  1783. Position = UDim2New(0, 34, 0.5, -1),
  1784. BorderSizePixel = 0,
  1785. AutomaticSize = Enum.AutomaticSize.X,
  1786. TextSize = 18
  1787. }):AddToTheme({TextColor3 = 'Text'})
  1788. end
  1789.  
  1790. function Watermark:SetText(Text)
  1791. Items["Text"].Instance.Text = tostring(Text)
  1792. end
  1793.  
  1794. function Watermark:SetVisibility(Bool)
  1795. Items["Watermark"].Instance.Visible = Bool
  1796. end
  1797.  
  1798. function Watermark:SetCenter()
  1799. local CenterPosition = Items["Watermark"].Instance.AbsolutePosition
  1800. task.wait()
  1801. Items["Watermark"].Instance.AnchorPoint = Vector2New(0, 0)
  1802.  
  1803. Items["Watermark"].Instance.Position = UDim2New(0, CenterPosition.X, 0, CenterPosition.Y)
  1804. end
  1805.  
  1806. Watermark:SetText(Name)
  1807. Watermark:SetCenter()
  1808.  
  1809. return Watermark
  1810. end
  1811.  
  1812. Library.Window = function(self, Data)
  1813. Data = Data or { }
  1814.  
  1815. local Window = {
  1816. Name = Data.Name or Data.name or "Window",
  1817. SubName = Data.SubName or Data.subname or "",
  1818. Logo = Data.Logo or Data.logo or "rbxassetid://81441172534384",
  1819.  
  1820. Pages = { },
  1821. Items = { },
  1822. IsOpen = false
  1823. }
  1824.  
  1825. local Items = { } do
  1826. local DesignW, DesignH = 673, 511
  1827. local ScreenSize = Camera.ViewportSize
  1828. local IsMobileDevice = UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled
  1829.  
  1830. local ScaleFactor = 1
  1831. if IsMobileDevice then
  1832. local ScaleX = (ScreenSize.X * 0.96) / DesignW
  1833. local ScaleY = (ScreenSize.Y * 0.88) / DesignH
  1834. ScaleFactor = math.min(ScaleX, ScaleY)
  1835. end
  1836.  
  1837. local FrameW = math.floor(DesignW * ScaleFactor)
  1838. local FrameH = math.floor(DesignH * ScaleFactor)
  1839.  
  1840. Items["MainFrame"] = Instances:Create("Frame", {
  1841. Parent = Library.Holder.Instance,
  1842. Name = "\0",
  1843. AnchorPoint = Vector2New(0.5, 0.5),
  1844. Position = UDim2New(0.5, 0, 0.5, 0),
  1845. BorderColor3 = FromRGB(0, 0, 0),
  1846. Size = UDim2New(0, FrameW, 0, FrameH),
  1847. BorderSizePixel = 0,
  1848. BackgroundColor3 = Library.Theme["Background"]
  1849. }):AddToTheme({BackgroundColor3 = 'Background'})
  1850.  
  1851. if IsMobileDevice then
  1852. Instances:Create("UIScale", {
  1853. Parent = Items["MainFrame"].Instance,
  1854. Name = "\0",
  1855. Scale = ScaleFactor
  1856. })
  1857.  
  1858. Items["MainFrame"].Instance.Size = UDim2New(0, DesignW, 0, DesignH)
  1859. Items["MainFrame"].Instance.Size = UDim2New(0, FrameW, 0, FrameH)
  1860. end
  1861.  
  1862. if not IsMobileDevice then
  1863. Items["MainFrame"]:MakeDraggable()
  1864. Items["MainFrame"]:MakeResizeable(Vector2New(673, 511), Vector2New(9999, 9999))
  1865. else
  1866. Items["MainFrame"]:MakeDraggable()
  1867. end
  1868.  
  1869. Instances:Create("UICorner", {
  1870. Parent = Items["MainFrame"].Instance,
  1871. Name = "\0",
  1872. CornerRadius = UDimNew(0, 6)
  1873. })
  1874.  
  1875. Items["Sidebar"] = Instances:Create("Frame", {
  1876. Parent = Items["MainFrame"].Instance,
  1877. Name = "\0",
  1878. BackgroundTransparency = 1,
  1879. BorderColor3 = FromRGB(0, 0, 0),
  1880. Size = UDim2New(0, 200, 1, 0),
  1881. BorderSizePixel = 0
  1882. })
  1883.  
  1884.  
  1885. --// Sidebar bottom separator (ends tab list)
  1886. local BottomSeparator = Instance.new("Frame")
  1887. BottomSeparator.Parent = Items["Sidebar"].Instance
  1888. BottomSeparator.AnchorPoint = Vector2.new(0, 1)
  1889. BottomSeparator.Position = UDim2.new(0, 0, 1, -85)
  1890. BottomSeparator.Size = UDim2.new(1, 0, 0, 1)
  1891. BottomSeparator.BackgroundColor3 = Library.Theme.Outline
  1892. BottomSeparator.BorderSizePixel = 0
  1893.  
  1894. --// Bottom Player Info (tab-style)
  1895. local Players = game:GetService("Players")
  1896. local RunService = game:GetService("RunService")
  1897. local LocalPlayer = Players.LocalPlayer
  1898.  
  1899. local BottomTab = Instance.new("Frame")
  1900. BottomTab.Parent = Items["Sidebar"].Instance
  1901. BottomTab.AnchorPoint = Vector2.new(0, 1)
  1902. BottomTab.Position = UDim2.new(0, 0, 1, 20)
  1903.  
  1904. BottomTab.Size = UDim2.new(1, 0, 0, 105)
  1905. BottomTab.BackgroundTransparency = 1
  1906.  
  1907. -- Avatar (BIGGER)
  1908. local Avatar = Instance.new("ImageLabel")
  1909. Avatar.Parent = BottomTab
  1910. Avatar.BackgroundTransparency = 1
  1911. Avatar.Size = UDim2.new(0, 52, 0, 52)
  1912. Avatar.Position = UDim2.new(0, 12, 0, 12)
  1913. Avatar.Image = Players:GetUserThumbnailAsync(
  1914. LocalPlayer.UserId,
  1915. Enum.ThumbnailType.HeadShot,
  1916. Enum.ThumbnailSize.Size420x420
  1917. )
  1918.  
  1919. local AvatarCorner = Instance.new("UICorner")
  1920. AvatarCorner.CornerRadius = UDim.new(1, 0)
  1921. AvatarCorner.Parent = Avatar
  1922.  
  1923. -- Username
  1924. local Username = Instance.new("TextLabel")
  1925. Username.Parent = BottomTab
  1926. Username.BackgroundTransparency = 1
  1927. Username.Position = UDim2.new(0, 74, 0, 16)
  1928. Username.Size = UDim2.new(1, -84, 0, 18)
  1929. Username.TextXAlignment = Enum.TextXAlignment.Left
  1930. Username.Text = LocalPlayer.Name
  1931. Username.FontFace = Library.Font
  1932. Username.TextSize = 16
  1933. Username.TextColor3 = Library.Theme.Text
  1934.  
  1935. -- Expires label
  1936. local ExpiresLabel = Instance.new("TextLabel")
  1937. ExpiresLabel.Parent = BottomTab
  1938. ExpiresLabel.BackgroundTransparency = 1
  1939. ExpiresLabel.Position = UDim2.new(0, 74, 0, 38)
  1940. ExpiresLabel.Size = UDim2.new(0, 52, 0, 16)
  1941. ExpiresLabel.TextXAlignment = Enum.TextXAlignment.Left
  1942. ExpiresLabel.Text = "Expires:"
  1943. ExpiresLabel.FontFace = Library.Font
  1944. ExpiresLabel.TextSize = 13
  1945. ExpiresLabel.TextTransparency = 0.4
  1946. ExpiresLabel.TextColor3 = Library.Theme.Text
  1947.  
  1948. -- Countdown text
  1949. local Countdown = Instance.new("TextLabel")
  1950. Countdown.Parent = BottomTab
  1951. Countdown.BackgroundTransparency = 1
  1952. Countdown.Position = UDim2.new(0, 130, 0, 38)
  1953. Countdown.Size = UDim2.new(1, -140, 0, 16)
  1954. Countdown.TextXAlignment = Enum.TextXAlignment.Left
  1955. Countdown.FontFace = Library.Font
  1956. Countdown.TextSize = 13
  1957. Countdown.TextColor3 = Library.Theme.Accent
  1958.  
  1959. --// COUNTDOWN LOGIC
  1960. local expiresDuration = tonumber(Data.ExpiresSeconds) or (24 * 60 * 60)
  1961. local endTime = os.time() + math.max(0, math.floor(expiresDuration))
  1962.  
  1963. RunService.Heartbeat:Connect(function()
  1964. local remaining = math.max(0, endTime - os.time())
  1965.  
  1966. local hours = math.floor(remaining / 3600)
  1967. local minutes = math.floor((remaining % 3600) / 60)
  1968. local seconds = remaining % 60
  1969.  
  1970. Countdown.Text = string.format("%02dh %02dm %02ds", hours, minutes, seconds)
  1971. end)
  1972.  
  1973. Instances:Create("Frame", {
  1974. Parent = Items["Sidebar"].Instance,
  1975. Name = "\0",
  1976. AnchorPoint = Vector2New(1, 0),
  1977. Position = UDim2New(1, 0, 0, 0),
  1978. BorderColor3 = FromRGB(0, 0, 0),
  1979. Size = UDim2New(0, 1, 1, 0),
  1980. BorderSizePixel = 0,
  1981. BackgroundColor3 = Library.Theme["Outline"]
  1982. }):AddToTheme({BackgroundColor3 = 'Outline'})
  1983.  
  1984. Items["Top"] = Instances:Create("Frame", {
  1985. Parent = Items["Sidebar"].Instance,
  1986. Name = "\0",
  1987. BackgroundTransparency = 1,
  1988. BorderColor3 = FromRGB(0, 0, 0),
  1989. Size = UDim2New(1, 0, 0, 70),
  1990. BorderSizePixel = 0
  1991. })
  1992.  
  1993. Items["Logo"] = Instances:Create("ImageLabel", {
  1994. Parent = Items["Top"].Instance,
  1995. Name = "\0",
  1996. ScaleType = Enum.ScaleType.Fit,
  1997. BorderColor3 = FromRGB(0, 0, 0),
  1998. Image = Window.Logo,
  1999. BackgroundTransparency = 1,
  2000. Position = UDim2New(0, 20, 0, 20),
  2001. Size = UDim2New(0, 30, 0, 30),
  2002. BorderSizePixel = 0
  2003. })
  2004.  
  2005. Items["Title"] = Instances:Create("TextLabel", {
  2006. Parent = Items["Top"].Instance,
  2007. Name = "\0",
  2008. FontFace = Library.Font,
  2009. TextColor3 = Library.Theme["Text"],
  2010. BorderColor3 = FromRGB(0, 0, 0),
  2011. Text = Window.Name,
  2012. Size = UDim2New(0, 0, 0, 14),
  2013. BorderSizePixel = 0,
  2014. BackgroundTransparency = 1,
  2015. Position = UDim2New(0, 60, 0, 15),
  2016. TextWrapped = true,
  2017. AutomaticSize = Enum.AutomaticSize.X,
  2018. TextSize = 18
  2019. }):AddToTheme({TextColor3 = 'Text'})
  2020.  
  2021. Items["Subtitle"] = Instances:Create("TextLabel", {
  2022. Parent = Items["Top"].Instance,
  2023. Name = "\0",
  2024. FontFace = Library.Font,
  2025. TextColor3 = Library.Theme["Text"],
  2026. TextTransparency = 0.4000000059604645,
  2027. Text = Window.SubName,
  2028. Size = UDim2New(0, 0, 0, 14),
  2029. BorderColor3 = FromRGB(0, 0, 0),
  2030. BorderSizePixel = 0,
  2031. BackgroundTransparency = 1,
  2032. Position = UDim2New(0, 60, 0, 36),
  2033. TextWrapped = true,
  2034. AutomaticSize = Enum.AutomaticSize.X,
  2035. TextSize = 16
  2036. }):AddToTheme({TextColor3 = 'Text'})
  2037.  
  2038. Instances:Create("Frame", {
  2039. Parent = Items["Top"].Instance,
  2040. Name = "\0",
  2041. AnchorPoint = Vector2New(0, 1),
  2042. Position = UDim2New(0, 0, 1, 0),
  2043. BorderColor3 = FromRGB(0, 0, 0),
  2044. Size = UDim2New(1, 0, 0, 1),
  2045. BorderSizePixel = 0,
  2046. BackgroundColor3 = Library.Theme["Outline"]
  2047. }):AddToTheme({BackgroundColor3 = 'Outline'})
  2048.  
  2049. Items["Pages"] = Instances:Create("ScrollingFrame", {
  2050. Parent = Items["Sidebar"].Instance,
  2051. Name = "\0",
  2052. Active = true,
  2053. AutomaticCanvasSize = Enum.AutomaticSize.Y,
  2054. BorderSizePixel = 0,
  2055. CanvasSize = UDim2New(0, 0, 0, 0),
  2056. ScrollBarImageColor3 = Library.Theme["Accent"],
  2057. MidImage = "rbxassetid://128693616966482",
  2058. BorderColor3 = FromRGB(0, 0, 0),
  2059. ScrollBarThickness = 3,
  2060. Size = UDim2New(1, -16, 1, -185),
  2061. BackgroundTransparency = 1,
  2062. Position = UDim2New(0, 8, 0, 78),
  2063. BottomImage = "rbxassetid://128693616966482",
  2064. TopImage = "rbxassetid://128693616966482"
  2065. }):AddToTheme({ScrollBarImageColor3 = 'Accent'})
  2066.  
  2067. Instances:Create("UIListLayout", {
  2068. Parent = Items["Pages"].Instance,
  2069. Name = "\0",
  2070. Padding = UDimNew(0, 8),
  2071. SortOrder = Enum.SortOrder.LayoutOrder
  2072. })
  2073.  
  2074. Instances:Create("UIPadding", {
  2075. Parent = Items["Pages"].Instance,
  2076. Name = "\0",
  2077. PaddingTop = UDimNew(0, 8),
  2078. PaddingBottom = UDimNew(0, 8),
  2079. PaddingRight = UDimNew(0, 8),
  2080. PaddingLeft = UDimNew(0, 8)
  2081. })
  2082.  
  2083. Items["Content"] = Instances:Create("Frame", {
  2084. Parent = Items["MainFrame"].Instance,
  2085. Name = "\0",
  2086. BackgroundTransparency = 1,
  2087. Position = UDim2New(0, 200, 0, 0),
  2088. BorderColor3 = FromRGB(0, 0, 0),
  2089. Size = UDim2New(1, -200, 1, 0),
  2090. BorderSizePixel = 0
  2091. })
  2092.  
  2093. Window.Items = Items
  2094. end
  2095.  
  2096. local Debounce = false
  2097.  
  2098. function Window:SetCenter()
  2099. Items["MainFrame"].Instance.AnchorPoint = Vector2New(0.5, 0.5)
  2100. Items["MainFrame"].Instance.Position = UDim2New(0.5, 0, 0.5, 0)
  2101. end
  2102.  
  2103. function Window:SetOpen(Bool)
  2104. if Debounce then
  2105. return
  2106. end
  2107.  
  2108. Window.IsOpen = Bool
  2109.  
  2110. Debounce = true
  2111.  
  2112. if Window.IsOpen then
  2113. Items["MainFrame"].Instance.Visible = true
  2114. end
  2115.  
  2116. local Descendants = Items["MainFrame"].Instance:GetDescendants()
  2117. TableInsert(Descendants, Items["MainFrame"].Instance)
  2118.  
  2119. local NewTween
  2120.  
  2121. for Index, Value in Descendants do
  2122. local TransparencyProperty = Tween:GetProperty(Value)
  2123.  
  2124. if not TransparencyProperty then
  2125. continue
  2126. end
  2127.  
  2128. if type(TransparencyProperty) == "table" then
  2129. for _, Property in TransparencyProperty do
  2130. NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
  2131. end
  2132. else
  2133. NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
  2134. end
  2135. end
  2136.  
  2137. NewTween.Tween.Completed:Connect(function()
  2138. Debounce = false
  2139. Items["MainFrame"].Instance.Visible = Window.IsOpen
  2140. end)
  2141. end
  2142.  
  2143. Library:Connect(UserInputService.InputBegan, function(Input)
  2144. if tostring(Input.KeyCode) == Library.MenuKeybind or tostring(Input.UserInputType) == Library.MenuKeybind then
  2145. Window:SetOpen(not Window.IsOpen)
  2146. end
  2147. end)
  2148.  
  2149. Window:SetCenter()
  2150. task.wait()
  2151. Window:SetOpen(true)
  2152.  
  2153. do
  2154. local IsMobile = UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled
  2155.  
  2156. if IsMobile then
  2157. local MobileBtn = Instances:Create("TextButton", {
  2158. Parent = Library.Holder.Instance,
  2159. Name = "\0",
  2160. Text = "☰",
  2161. FontFace = Library.Font,
  2162. TextSize = 20,
  2163. TextColor3 = Library.Theme["Text"],
  2164. BackgroundColor3 = Library.Theme["Element"],
  2165. BorderSizePixel = 0,
  2166. Size = UDim2New(0, 44, 0, 44),
  2167. Position = UDim2New(0, 12, 1, -56),
  2168. AutoButtonColor = false,
  2169. ZIndex = 999
  2170. }):AddToTheme({BackgroundColor3 = "Element", TextColor3 = "Text"})
  2171.  
  2172. Instances:Create("UICorner", {
  2173. Parent = MobileBtn.Instance,
  2174. Name = "\0",
  2175. CornerRadius = UDimNew(0, 12)
  2176. })
  2177.  
  2178. Instances:Create("UIStroke", {
  2179. Parent = MobileBtn.Instance,
  2180. Name = "\0",
  2181. Color = Library.Theme["Outline"],
  2182. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  2183. }):AddToTheme({Color = "Outline"})
  2184.  
  2185. local MobileDragging = false
  2186. local MobileDragStart
  2187. local MobileBtnStart
  2188.  
  2189. MobileBtn:Connect("InputBegan", function(Input)
  2190. if Input.UserInputType == Enum.UserInputType.Touch then
  2191. MobileDragging = true
  2192. MobileDragStart = Input.Position
  2193. MobileBtnStart = MobileBtn.Instance.Position
  2194.  
  2195. Input.Changed:Connect(function()
  2196. if Input.UserInputState == Enum.UserInputState.End then
  2197. MobileDragging = false
  2198. end
  2199. end)
  2200. end
  2201. end)
  2202.  
  2203. Library:Connect(UserInputService.InputChanged, function(Input)
  2204. if Input.UserInputType == Enum.UserInputType.Touch and MobileDragging then
  2205. local Delta = Input.Position - MobileDragStart
  2206. local NewX = MathClamp(MobileBtnStart.X.Offset + Delta.X, 0, Camera.ViewportSize.X - 44)
  2207. local NewY = MathClamp(MobileBtnStart.Y.Offset + Delta.Y, 0, Camera.ViewportSize.Y - 44)
  2208. MobileBtn.Instance.Position = UDim2New(0, NewX, 0, NewY)
  2209. end
  2210. end)
  2211.  
  2212. MobileBtn:Connect("MouseButton1Down", function()
  2213. Window:SetOpen(not Window.IsOpen)
  2214. end)
  2215.  
  2216. Window.MobileButton = MobileBtn
  2217. end
  2218. end
  2219.  
  2220. return setmetatable(Window, Library)
  2221. end
  2222.  
  2223. Library.Page = function(self, Data)
  2224. Data = Data or { }
  2225.  
  2226. local Page = {
  2227. Window = self,
  2228.  
  2229. Name = Data.Name or Data.name or "Page",
  2230. Icon = Data.Icon or Data.icon or "rbxassetid://72196061405823",
  2231.  
  2232. Items = { },
  2233. Active = false
  2234. }
  2235.  
  2236. local Items = { } do
  2237. Items["Inactive"] = Instances:Create("TextButton", {
  2238. Parent = Page.Window.Items["Pages"].Instance,
  2239. Name = "\0",
  2240. FontFace = Library.Font,
  2241. TextColor3 = FromRGB(0, 0, 0),
  2242. BorderColor3 = FromRGB(0, 0, 0),
  2243. Text = "",
  2244. AutoButtonColor = false,
  2245. BackgroundTransparency = 1,
  2246. Size = UDim2New(1, 0, 0, 35),
  2247. BorderSizePixel = 0,
  2248. AutomaticSize = Enum.AutomaticSize.Y,
  2249. TextSize = 14,
  2250. BackgroundColor3 = Library.Theme["Accent"]
  2251. }):AddToTheme({BackgroundColor3 = 'Accent'})
  2252.  
  2253. Items["Background"] = Instances:Create("Frame", {
  2254. Parent = Items["Inactive"].Instance,
  2255. Name = "\0",
  2256. BackgroundTransparency = 1,
  2257. BorderColor3 = FromRGB(0, 0, 0),
  2258. Size = UDim2New(0, 0, 0, 35),
  2259. BorderSizePixel = 0,
  2260. BackgroundColor3 = Library.Theme["Accent"]
  2261. }):AddToTheme({BackgroundColor3 = 'Accent'})
  2262.  
  2263. Items["Icon"] = Instances:Create("ImageLabel", {
  2264. Parent = Items["Inactive"].Instance,
  2265. Name = "\0",
  2266. ScaleType = Enum.ScaleType.Fit,
  2267. ImageTransparency = 0.4000000059604645,
  2268. BorderColor3 = FromRGB(0, 0, 0),
  2269. AnchorPoint = Vector2New(0, 0.5),
  2270. Image = Page.Icon,
  2271. BackgroundTransparency = 1,
  2272. Position = UDim2New(0, 8, 0.5, 0),
  2273. Size = UDim2New(0, 18, 0, 18),
  2274. BorderSizePixel = 0
  2275. }):AddToTheme({ImageColor3 = 'Text'})
  2276.  
  2277. Items["Text"] = Instances:Create("TextLabel", {
  2278. Parent = Items["Inactive"].Instance,
  2279. Name = "\0",
  2280. FontFace = Library.Font,
  2281. TextColor3 = Library.Theme["Text"],
  2282. TextTransparency = 0.4000000059604645,
  2283. Text = Page.Name,
  2284. Size = UDim2New(0, 0, 0, 15),
  2285. AnchorPoint = Vector2New(0, 0.5),
  2286. BorderSizePixel = 0,
  2287. BackgroundTransparency = 1,
  2288. Position = UDim2New(0, 38, 0.5, 0),
  2289. BorderColor3 = FromRGB(0, 0, 0),
  2290. AutomaticSize = Enum.AutomaticSize.X,
  2291. TextSize = 16
  2292. }):AddToTheme({TextColor3 = 'Text'})
  2293.  
  2294. Instances:Create("UICorner", {
  2295. Parent = Items["Background"].Instance,
  2296. Name = "\0",
  2297. CornerRadius = UDimNew(0, 6)
  2298. })
  2299.  
  2300. Items["Page"] = Instances:Create("Frame", {
  2301. Parent = Library.UnusedHolder.Instance,
  2302. Name = "\0",
  2303. Visible = false,
  2304. BackgroundTransparency = 1,
  2305. BorderColor3 = FromRGB(0, 0, 0),
  2306. Size = UDim2New(1, 0, 1, 0),
  2307. BorderSizePixel = 0
  2308. })
  2309.  
  2310. Instances:Create("UIListLayout", {
  2311. Parent = Items["Page"].Instance,
  2312. Name = "\0",
  2313. FillDirection = Enum.FillDirection.Horizontal,
  2314. HorizontalFlex = Enum.UIFlexAlignment.Fill,
  2315. Padding = UDimNew(0, 10),
  2316. SortOrder = Enum.SortOrder.LayoutOrder
  2317. })
  2318.  
  2319. Items["Column"] = Instances:Create("ScrollingFrame", {
  2320. Parent = Items["Page"].Instance,
  2321. Name = "\0",
  2322. ScrollBarImageColor3 = FromRGB(0, 0, 0),
  2323. Active = true,
  2324. AutomaticCanvasSize = Enum.AutomaticSize.Y,
  2325. ScrollBarThickness = 0,
  2326. BackgroundTransparency = 1,
  2327. Size = UDim2New(1, 0, 1, 0),
  2328. BorderColor3 = FromRGB(0, 0, 0),
  2329. BorderSizePixel = 0,
  2330. CanvasSize = UDim2New(0, 0, 0, 0)
  2331. })
  2332.  
  2333. Instances:Create("UIPadding", {
  2334. Parent = Items["Column"].Instance,
  2335. Name = "\0",
  2336. PaddingTop = UDimNew(0, 10),
  2337. PaddingBottom = UDimNew(0, 10),
  2338. PaddingRight = UDimNew(0, 10),
  2339. PaddingLeft = UDimNew(0, 10)
  2340. })
  2341.  
  2342. Instances:Create("UIListLayout", {
  2343. Parent = Items["Column"].Instance,
  2344. Name = "\0",
  2345. Padding = UDimNew(0, 10),
  2346. SortOrder = Enum.SortOrder.LayoutOrder
  2347. })
  2348.  
  2349. Page.Items = Items
  2350. end
  2351.  
  2352. local Debounce = false
  2353.  
  2354. function Page:Turn(Bool)
  2355. if Debounce then
  2356. return
  2357. end
  2358.  
  2359. Page.Active = Bool
  2360.  
  2361. Debounce = true
  2362. Items["Page"].Instance.Visible = Bool
  2363. Items["Page"].Instance.Parent = Bool and Page.Window.Items["Content"].Instance or Library.UnusedHolder.Instance
  2364.  
  2365. if Page.Active then
  2366. Items["Background"]:Tween(nil, {BackgroundTransparency = 0, Size = UDim2New(1, 0, 0, 35)})
  2367.  
  2368. Items["Text"]:ChangeItemTheme({TextColor3 = function() return FromRGB(0, 0, 0) end})
  2369. Items["Icon"]:ChangeItemTheme({ImageColor3 = function() return FromRGB(0, 0, 0) end})
  2370.  
  2371. Items["Text"]:Tween(nil, {TextColor3 = FromRGB(0, 0, 0), TextTransparency = 0})
  2372. Items["Icon"]:Tween(nil, {ImageColor3 = FromRGB(0, 0, 0), ImageTransparency = 0})
  2373. else
  2374. Items["Background"]:Tween(nil, {BackgroundTransparency = 1, Size = UDim2New(0, 0, 0, 35)})
  2375.  
  2376. Items["Text"]:ChangeItemTheme({TextColor3 = "Text"})
  2377. Items["Icon"]:ChangeItemTheme({ImageColor3 = "Text"})
  2378.  
  2379. Items["Text"]:Tween(nil, {TextColor3 = Library.Theme.Text, TextTransparency = 0.4})
  2380. Items["Icon"]:Tween(nil, {ImageColor3 = Library.Theme.Text, ImageTransparency = 0.4})
  2381. end
  2382.  
  2383. local AllInstances = Items["Page"].Instance:GetDescendants()
  2384. TableInsert(AllInstances, Items["Page"].Instance)
  2385.  
  2386. local NewTween
  2387.  
  2388. for Index, Value in AllInstances do
  2389. local TransparencyProperty = Tween:GetProperty(Value)
  2390.  
  2391. if not TransparencyProperty then
  2392. continue
  2393. end
  2394.  
  2395. if type(TransparencyProperty) == "table" then
  2396. for _, Property in TransparencyProperty do
  2397. NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
  2398. end
  2399. else
  2400. NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
  2401. end
  2402. end
  2403.  
  2404. Library:Connect(NewTween.Tween.Completed, function()
  2405. Debounce = false
  2406. end)
  2407. end
  2408.  
  2409. Items["Inactive"]:Connect("MouseButton1Down", function()
  2410. for Index, Value in Page.Window.Pages do
  2411. if Value == Page and Page.Active then
  2412. return
  2413. end
  2414.  
  2415. Value:Turn(Value == Page)
  2416. end
  2417. end)
  2418.  
  2419. if #Page.Window.Pages == 0 then
  2420. Page:Turn(true)
  2421. end
  2422.  
  2423. TableInsert(Page.Window.Pages, Page)
  2424. return setmetatable(Page, Library.Pages)
  2425. end
  2426.  
  2427. Library.Pages.Section = function(self, Data)
  2428. Data = Data or { }
  2429.  
  2430. local Section = {
  2431. Window = self.Window,
  2432. Page = self,
  2433.  
  2434. Name = Data.Name or Data.name or "Section",
  2435. Side = Data.Side or Data.side or 1,
  2436. Icon = Data.Icon or Data.icon or "rbxassetid://127136375066593",
  2437.  
  2438. Items = { }
  2439. }
  2440.  
  2441. local Items = { } do
  2442. Items["SectionOutline"] = Instances:Create("Frame", {
  2443. Parent = Section.Page.Items["Column"].Instance,
  2444. Name = "\0",
  2445. Size = UDim2New(1, 0, 0, 50),
  2446. BorderColor3 = FromRGB(0, 0, 0),
  2447. BorderSizePixel = 0,
  2448. AutomaticSize = Enum.AutomaticSize.Y,
  2449. BackgroundColor3 = Library.Theme["Outline"]
  2450. }):AddToTheme({BackgroundColor3 = 'Outline'})
  2451.  
  2452. Instances:Create("UICorner", {
  2453. Parent = Items["SectionOutline"].Instance,
  2454. Name = "\0"
  2455. })
  2456.  
  2457. Items["Section"] = Instances:Create("Frame", {
  2458. Parent = Items["SectionOutline"].Instance,
  2459. Name = "\0",
  2460. Position = UDim2New(0, 1, 0, 1),
  2461. BorderColor3 = FromRGB(0, 0, 0),
  2462. Size = UDim2New(1, -2, 1, -2),
  2463. BorderSizePixel = 0,
  2464. BackgroundColor3 = Library.Theme["Inline"]
  2465. }):AddToTheme({BackgroundColor3 = 'Inline'})
  2466.  
  2467. Instances:Create("UICorner", {
  2468. Parent = Items["Section"].Instance,
  2469. Name = "\0"
  2470. })
  2471.  
  2472. Items["Top"] = Instances:Create("Frame", {
  2473. Parent = Items["Section"].Instance,
  2474. Name = "\0",
  2475. BackgroundTransparency = 1,
  2476. BorderColor3 = FromRGB(0, 0, 0),
  2477. Size = UDim2New(1, 0, 0, 40),
  2478. BorderSizePixel = 0
  2479. })
  2480.  
  2481. Items["Text"] = Instances:Create("TextLabel", {
  2482. Parent = Items["Top"].Instance,
  2483. Name = "\0",
  2484. FontFace = Library.Font,
  2485. TextWrapped = true,
  2486. TextColor3 = Library.Theme["Text"],
  2487. BorderColor3 = FromRGB(0, 0, 0),
  2488. Text = Section.Name,
  2489. Size = UDim2New(0, 0, 0, 14),
  2490. AnchorPoint = Vector2New(0, 0.5),
  2491. BorderSizePixel = 0,
  2492. BackgroundTransparency = 1,
  2493. Position = UDim2New(0, 40, 0.5, -2),
  2494. AutomaticSize = Enum.AutomaticSize.X,
  2495. TextSize = 16
  2496. }):AddToTheme({TextColor3 = 'Text'})
  2497.  
  2498. Instances:Create("Frame", {
  2499. Parent = Items["Top"].Instance,
  2500. Name = "\0",
  2501. AnchorPoint = Vector2New(0, 1),
  2502. Position = UDim2New(0, 0, 1, 0),
  2503. BorderColor3 = FromRGB(0, 0, 0),
  2504. Size = UDim2New(1, 0, 0, 1),
  2505. BorderSizePixel = 0,
  2506. BackgroundColor3 = Library.Theme["Outline"]
  2507. }):AddToTheme({BackgroundColor3 = 'Outline'})
  2508.  
  2509. Items["Icon"] = Instances:Create("ImageLabel", {
  2510. Parent = Items["Top"].Instance,
  2511. Name = "\0",
  2512. ImageColor3 = Library.Theme["Text"],
  2513. BorderColor3 = FromRGB(0, 0, 0),
  2514. AnchorPoint = Vector2New(0, 0.5),
  2515. Image = Section.Icon,
  2516. BackgroundTransparency = 1,
  2517. Position = UDim2New(0, 10, 0.5, 0),
  2518. Size = UDim2New(0, 18, 0, 18),
  2519. BorderSizePixel = 0
  2520. }):AddToTheme({ImageColor3 = 'Text'})
  2521.  
  2522. Items["Content"] = Instances:Create("Frame", {
  2523. Parent = Items["Section"].Instance,
  2524. Name = "\0",
  2525. BorderColor3 = FromRGB(0, 0, 0),
  2526. BackgroundTransparency = 1,
  2527. Position = UDim2New(0, 0, 0, 40),
  2528. Size = UDim2New(1, 0, 0, 0),
  2529. BorderSizePixel = 0,
  2530. AutomaticSize = Enum.AutomaticSize.Y
  2531. })
  2532.  
  2533. Instances:Create("UIPadding", {
  2534. Parent = Items["Content"].Instance,
  2535. Name = "\0",
  2536. PaddingTop = UDimNew(0, 6),
  2537. PaddingBottom = UDimNew(0, 10),
  2538. PaddingRight = UDimNew(0, 10),
  2539. PaddingLeft = UDimNew(0, 10)
  2540. })
  2541.  
  2542. Instances:Create("UIListLayout", {
  2543. Parent = Items["Content"].Instance,
  2544. Name = "\0",
  2545. Padding = UDimNew(0, 6),
  2546. SortOrder = Enum.SortOrder.LayoutOrder
  2547. })
  2548.  
  2549. Section.Items = Items
  2550. end
  2551.  
  2552. return setmetatable(Section, Library.Sections)
  2553. end
  2554.  
  2555. Library.Sections.Toggle = function(self, Data)
  2556. Data = Data or { }
  2557.  
  2558. local Toggle = {
  2559. Window = self.Window,
  2560. Page = self.Page,
  2561. Section = self,
  2562.  
  2563. Name = Data.Name or Data.name or "Toggle",
  2564. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  2565. Default = Data.Default or Data.default or false,
  2566. Callback = Data.Callback or Data.callback or function() end,
  2567.  
  2568. Value = false
  2569. }
  2570.  
  2571. local Items = { } do
  2572. Items["Toggle"] = Instances:Create("TextButton", {
  2573. Parent = Toggle.Section.Items["Content"].Instance,
  2574. Name = "\0",
  2575. FontFace = Library.Font,
  2576. TextColor3 = FromRGB(0, 0, 0),
  2577. BorderColor3 = FromRGB(0, 0, 0),
  2578. Text = "",
  2579. AutoButtonColor = false,
  2580. AnchorPoint = Vector2New(1, 0),
  2581. BackgroundTransparency = 1,
  2582. Size = UDim2New(1, 0, 0, 20),
  2583. BorderSizePixel = 0,
  2584. TextSize = 14
  2585. })
  2586.  
  2587. Items["Text"] = Instances:Create("TextLabel", {
  2588. Parent = Items["Toggle"].Instance,
  2589. Name = "\0",
  2590. FontFace = Library.Font,
  2591. TextColor3 = Library.Theme["Text"],
  2592. TextTransparency = 0.5,
  2593. Text = Toggle.Name,
  2594. Size = UDim2New(0, 0, 0, 15),
  2595. AnchorPoint = Vector2New(0, 0.5),
  2596. BorderSizePixel = 0,
  2597. BackgroundTransparency = 1,
  2598. Position = UDim2New(0, 0, 0.5, 0),
  2599. BorderColor3 = FromRGB(0, 0, 0),
  2600. AutomaticSize = Enum.AutomaticSize.X,
  2601. TextSize = 16
  2602. }):AddToTheme({TextColor3 = 'Text'})
  2603.  
  2604. Items["Indicator"] = Instances:Create("Frame", {
  2605. Parent = Items["Toggle"].Instance,
  2606. Name = "\0",
  2607. AnchorPoint = Vector2New(1, 0.5),
  2608. Position = UDim2New(1, 0, 0.5, 0),
  2609. BorderColor3 = FromRGB(0, 0, 0),
  2610. Size = UDim2New(0, 35, 0, 18),
  2611. BorderSizePixel = 0,
  2612. BackgroundColor3 = Library.Theme["Element"]
  2613. }):AddToTheme({BackgroundColor3 = 'Element'})
  2614.  
  2615. Instances:Create("UICorner", {
  2616. Parent = Items["Indicator"].Instance,
  2617. Name = "\0"
  2618. })
  2619.  
  2620. Instances:Create("UIStroke", {
  2621. Parent = Items["Indicator"].Instance,
  2622. Name = "\0",
  2623. Color = Library.Theme["Outline"],
  2624. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  2625. }):AddToTheme({Color = 'Outline'})
  2626.  
  2627. Items["Circle"] = Instances:Create("Frame", {
  2628. Parent = Items["Indicator"].Instance,
  2629. Name = "\0",
  2630. BorderColor3 = FromRGB(0, 0, 0),
  2631. AnchorPoint = Vector2New(0, 0.5),
  2632. BackgroundTransparency = 0.5,
  2633. Position = UDim2New(0, 4, 0.5, 0),
  2634. Size = UDim2New(0, 10, 0, 10),
  2635. BorderSizePixel = 0
  2636. }):AddToTheme({BackgroundColor3 = function() return FromRGB(255, 255, 255) end})
  2637.  
  2638. Instances:Create("UICorner", {
  2639. Parent = Items["Circle"].Instance,
  2640. Name = "\0",
  2641. CornerRadius = UDimNew(1, 0)
  2642. })
  2643.  
  2644. Items["Glow"] = Instances:Create("ImageLabel", {
  2645. Parent = Items["Circle"].Instance,
  2646. Name = "\0",
  2647. ImageColor3 = Library.Theme["Accent"],
  2648. ScaleType = Enum.ScaleType.Slice,
  2649. ImageTransparency = 1,
  2650. BorderColor3 = FromRGB(0, 0, 0),
  2651. Size = UDim2New(1, 25, 1, 25),
  2652. AnchorPoint = Vector2New(0.5, 0.5),
  2653. Image = "http://www.roblox.com/asset/?id=18245826428",
  2654. BackgroundTransparency = 1,
  2655. Position = UDim2New(0.5, 0, 0.5, 0),
  2656. BorderSizePixel = 0,
  2657. SliceCenter = RectNew(Vector2New(21, 21), Vector2New(79, 79))
  2658. }):AddToTheme({ImageColor3 = 'Accent'})
  2659. end
  2660.  
  2661. function Toggle:Get()
  2662. return Toggle.Value
  2663. end
  2664.  
  2665. function Toggle:Set(Value)
  2666. Toggle.Value = Value
  2667. Library.Flags[Toggle.Flag] = Value
  2668.  
  2669. if Toggle.Value then
  2670. Items["Glow"]:Tween(nil, {ImageTransparency = 0.7})
  2671.  
  2672. Items["Circle"]:ChangeItemTheme({BackgroundColor3 = "Accent"})
  2673. Items["Circle"]:Tween(nil, {
  2674. AnchorPoint = Vector2New(1, 0.5),
  2675. Position = UDim2New(1, -3, 0.5, 0),
  2676. BackgroundTransparency = 0,
  2677. BackgroundColor3 = Library.Theme.Accent
  2678. })
  2679.  
  2680. Items["Text"]:Tween(nil, {TextTransparency = 0})
  2681. else
  2682. Items["Glow"]:Tween(nil, {ImageTransparency = 1})
  2683.  
  2684. Items["Circle"]:ChangeItemTheme({BackgroundColor3 = function() return FromRGB(255, 255, 255) end})
  2685. Items["Circle"]:Tween(nil, {
  2686. AnchorPoint = Vector2New(0, 0.5),
  2687. Position = UDim2New(0, 3, 0.5, 0),
  2688. BackgroundTransparency = 0.6,
  2689. BackgroundColor3 = FromRGB(255, 255, 255)
  2690. })
  2691.  
  2692. Items["Text"]:Tween(nil, {TextTransparency = 0.5})
  2693. end
  2694.  
  2695. if Toggle.Callback then
  2696. Library:SafeCall(Toggle.Callback, Toggle.Value)
  2697. end
  2698. end
  2699.  
  2700. function Toggle:SetTitle(Text)
  2701. Toggle.Name = tostring(Text)
  2702. Items["Text"].Instance.Text = tostring(Text)
  2703. end
  2704.  
  2705. function Toggle:SetVisibility(Bool)
  2706. Items["Toggle"].Instance.Visible = Bool
  2707. end
  2708.  
  2709. function Toggle:Colorpicker(Data)
  2710. Data = Data or { }
  2711.  
  2712. local Colorpicker = {
  2713. Window = Toggle.Window,
  2714. Page = Toggle.Page,
  2715. Section = Toggle.Section,
  2716.  
  2717. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  2718. Default = Data.Default or Data.default or Color3.fromRGB(255, 255, 255),
  2719. Callback = Data.Callback or Data.callback or function() end,
  2720. Alpha = Data.Alpha or Data.alpha or false
  2721. }
  2722.  
  2723. local NewColorpicker, ColorpickerItems = Library:CreateColorpicker({
  2724. Parent = Items["SubElements"],
  2725. Page = Colorpicker.Page,
  2726. Section = Colorpicker.Section,
  2727. Flag = Colorpicker.Flag,
  2728. Default = Colorpicker.Default,
  2729. Callback = Colorpicker.Callback,
  2730. Alpha = Colorpicker.Alpha
  2731. })
  2732.  
  2733. return NewColorpicker
  2734. end
  2735.  
  2736. function Toggle:Keybind(Data)
  2737. Data = Data or { }
  2738.  
  2739. local Keybind = {
  2740. Window = Toggle.Window,
  2741. Page = Toggle.Page,
  2742. Section = Toggle.Section,
  2743.  
  2744. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  2745. Default = Data.Default or Data.default or Enum.KeyCode.E,
  2746. Callback = Data.Callback or Data.callback or function() end,
  2747. Mode = Data.Mode or Data.mode or "Toggle"
  2748. }
  2749.  
  2750. local NewKeybind, KeybindItems = Library:CreateKeybind({
  2751. Parent = Items["SubElements"],
  2752. Page = Keybind.Page,
  2753. Section = Keybind.Section,
  2754. Flag = Keybind.Flag,
  2755. Default = Keybind.Default,
  2756. Mode = Keybind.Mode,
  2757. Callback = Keybind.Callback
  2758. })
  2759.  
  2760. return NewKeybind
  2761. end
  2762.  
  2763. Items["Toggle"]:Connect("MouseButton1Down", function()
  2764. Toggle:Set(not Toggle.Value)
  2765. end)
  2766.  
  2767. Toggle:Set(Toggle.Default)
  2768.  
  2769. Library.SetFlags[Toggle.Flag] = function(Value)
  2770. Toggle:Set(Value)
  2771. end
  2772.  
  2773. return Toggle
  2774. end
  2775.  
  2776. Library.Sections.Button = function(self, Data)
  2777. Data = Data or { }
  2778.  
  2779. local Button = {
  2780. Window = self.Window,
  2781. Page = self.Page,
  2782. Section = self,
  2783.  
  2784. Name = Data.Name or Data.name or "Button",
  2785. Callback = Data.Callback or Data.callback or function() end
  2786. }
  2787.  
  2788. local Items = { } do
  2789. Items["Button"] = Instances:Create("TextButton", {
  2790. Parent = Button.Section.Items["Content"].Instance,
  2791. Name = "\0",
  2792. TextColor3 = Library.Theme["Text"],
  2793. BorderColor3 = FromRGB(0, 0, 0),
  2794. Text = "",
  2795. AutoButtonColor = false,
  2796. Size = UDim2New(1, 0, 0, 30),
  2797. Selectable = false,
  2798. Active = false,
  2799. BorderSizePixel = 0,
  2800. BackgroundColor3 = Library.Theme["Element"]
  2801. }):AddToTheme({BackgroundColor3 = 'Element'})
  2802.  
  2803. Items["Text"] = Instances:Create("TextLabel", {
  2804. Parent = Items["Button"].Instance,
  2805. Name = "\0",
  2806. FontFace = Library.Font,
  2807. TextColor3 = Library.Theme["Text"],
  2808. BorderColor3 = FromRGB(0, 0, 0),
  2809. Text = Button.Name,
  2810. AnchorPoint = Vector2New(0.5, 0.5),
  2811. Size = UDim2New(0, 0, 0, 15),
  2812. BackgroundTransparency = 1,
  2813. Position = UDim2New(0.5, 0, 0.5, 0),
  2814. BorderSizePixel = 0,
  2815. AutomaticSize = Enum.AutomaticSize.X,
  2816. TextSize = 16
  2817. }):AddToTheme({TextColor3 = 'Text'})
  2818.  
  2819. Instances:Create("UICorner", {
  2820. Parent = Items["Button"].Instance,
  2821. Name = "\0",
  2822. CornerRadius = UDimNew(0, 6)
  2823. })
  2824.  
  2825. Items["Stroke"] = Instances:Create("UIStroke", {
  2826. Parent = Items["Button"].Instance,
  2827. Name = "\0",
  2828. Color = Library.Theme["Outline"],
  2829. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  2830. }):AddToTheme({Color = 'Outline'})
  2831.  
  2832. Items["Icon"] = Instances:Create("ImageLabel", {
  2833. Parent = Items["Button"].Instance,
  2834. Name = "\0",
  2835. ImageColor3 = Library.Theme["Text"],
  2836. BorderColor3 = FromRGB(0, 0, 0),
  2837. Size = UDim2New(0, 16, 0, 16),
  2838. AnchorPoint = Vector2New(1, 0.5),
  2839. Image = "rbxassetid://117716971575946",
  2840. BackgroundTransparency = 1,
  2841. Position = UDim2New(1, -6, 0.5, 0),
  2842. ZIndex = 2,
  2843. BorderSizePixel = 0
  2844. }):AddToTheme({ImageColor3 = 'Text'})
  2845. end
  2846.  
  2847. function Button:SetTitle(Text)
  2848. Button.Name = tostring(Text)
  2849. Items["Text"].Instance.Text = tostring(Text)
  2850. end
  2851.  
  2852. function Button:SetVisibility(Bool)
  2853. Items["Button"].Instance.Visible = Bool
  2854. end
  2855.  
  2856. function Button:Press()
  2857. Items["Stroke"]:ChangeItemTheme({Color = "Accent"})
  2858. Items["Stroke"]:Tween(nil, {Color = Library.Theme.Accent})
  2859. task.wait(0.1)
  2860. Library:SafeCall(Button.Callback)
  2861. Items["Stroke"]:ChangeItemTheme({Color = "Outline"})
  2862. Items["Stroke"]:Tween(nil, {Color = Library.Theme.Outline})
  2863. end
  2864.  
  2865. Items["Button"]:Connect("MouseButton1Down", function()
  2866. Button:Press()
  2867. end)
  2868.  
  2869. return Button
  2870. end
  2871.  
  2872. Library.Sections.Slider = function(self, Data)
  2873. Data = Data or { }
  2874.  
  2875. local Slider = {
  2876. Window = self.Window,
  2877. Page = self.Page,
  2878. Section = self,
  2879.  
  2880. Name = Data.Name or Data.name or "Slider",
  2881. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  2882. Min = Data.Min or Data.min or 0,
  2883. Default = Data.Default or Data.default or 0,
  2884. Max = Data.Max or Data.max or 100,
  2885. Suffix = Data.Suffix or Data.suffix or "",
  2886. Decimals = Data.Decimals or Data.decimals or 1,
  2887. Callback = Data.Callback or Data.callback or function() end,
  2888.  
  2889. Value = 0,
  2890. Sliding = false
  2891. }
  2892.  
  2893. local Items = { } do
  2894. Items["Slider"] = Instances:Create("Frame", {
  2895. Parent = Slider.Section.Items["Content"].Instance,
  2896. Name = "\0",
  2897. BackgroundTransparency = 1,
  2898. BorderColor3 = FromRGB(0, 0, 0),
  2899. Size = UDim2New(1, 0, 0, 20),
  2900. BorderSizePixel = 0
  2901. })
  2902.  
  2903. Items["Text"] = Instances:Create("TextLabel", {
  2904. Parent = Items["Slider"].Instance,
  2905. Name = "\0",
  2906. FontFace = Library.Font,
  2907. TextColor3 = Library.Theme["Text"],
  2908. BorderColor3 = FromRGB(0, 0, 0),
  2909. Text = Slider.Name,
  2910. AnchorPoint = Vector2New(0, 0.5),
  2911. Size = UDim2New(0, 0, 0, 15),
  2912. BackgroundTransparency = 1,
  2913. Position = UDim2New(0, 0, 0.5, 0),
  2914. BorderSizePixel = 0,
  2915. AutomaticSize = Enum.AutomaticSize.X,
  2916. TextSize = 16
  2917. }):AddToTheme({TextColor3 = 'Text'})
  2918.  
  2919. Items["RealSlider"] = Instances:Create("TextButton", {
  2920. Parent = Items["Slider"].Instance,
  2921. Name = "\0",
  2922. Active = false,
  2923. BorderColor3 = FromRGB(0, 0, 0),
  2924. Text = "",
  2925. AutoButtonColor = false,
  2926. AnchorPoint = Vector2New(1, 0.5),
  2927. Position = UDim2New(1, -40, 0.5, 0),
  2928. Size = UDim2New(0, 200, 0, 9),
  2929. Selectable = false,
  2930. BorderSizePixel = 0,
  2931. BackgroundColor3 = Library.Theme["Element"]
  2932. }):AddToTheme({BackgroundColor3 = 'Element'})
  2933.  
  2934. Instances:Create("UICorner", {
  2935. Parent = Items["RealSlider"].Instance,
  2936. Name = "\0",
  2937. CornerRadius = UDimNew(0, 6)
  2938. })
  2939.  
  2940. Instances:Create("UIStroke", {
  2941. Parent = Items["RealSlider"].Instance,
  2942. Name = "\0",
  2943. Color = Library.Theme["Outline"],
  2944. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  2945. }):AddToTheme({Color = 'Outline'})
  2946.  
  2947. Items["Accent"] = Instances:Create("Frame", {
  2948. Parent = Items["RealSlider"].Instance,
  2949. Name = "\0",
  2950. BorderColor3 = FromRGB(0, 0, 0),
  2951. Size = UDim2New(0.6000000238418579, 0, 1, 0),
  2952. BorderSizePixel = 0,
  2953. BackgroundColor3 = Library.Theme["Accent"]
  2954. }):AddToTheme({BackgroundColor3 = 'Accent'})
  2955.  
  2956. Instances:Create("UICorner", {
  2957. Parent = Items["Accent"].Instance,
  2958. Name = "\0",
  2959. CornerRadius = UDimNew(0, 6)
  2960. })
  2961.  
  2962. Items["Glow"] = Instances:Create("ImageLabel", {
  2963. Parent = Items["Accent"].Instance,
  2964. Name = "\0",
  2965. ImageColor3 = Library.Theme["Accent"],
  2966. ScaleType = Enum.ScaleType.Slice,
  2967. ImageTransparency = 0.800000011920929,
  2968. BorderColor3 = FromRGB(0, 0, 0),
  2969. Size = UDim2New(1, 25, 1, 25),
  2970. AnchorPoint = Vector2New(0.5, 0.5),
  2971. Image = "http://www.roblox.com/asset/?id=18245826428",
  2972. BackgroundTransparency = 1,
  2973. Position = UDim2New(0.5, 0, 0.5, 0),
  2974. ZIndex = 2,
  2975. BorderSizePixel = 0,
  2976. SliceCenter = RectNew(Vector2New(21, 21), Vector2New(79, 79))
  2977. }):AddToTheme({ImageColor3 = 'Accent'})
  2978.  
  2979. Items["Dragger"] = Instances:Create("Frame", {
  2980. Parent = Items["Accent"].Instance,
  2981. Name = "\0",
  2982. AnchorPoint = Vector2New(0, 0.5),
  2983. Position = UDim2New(1, -4, 0.5, 0),
  2984. BorderColor3 = FromRGB(0, 0, 0),
  2985. Size = UDim2New(0, 13, 0, 13),
  2986. BorderSizePixel = 0
  2987. })
  2988.  
  2989. Instances:Create("UICorner", {
  2990. Parent = Items["Dragger"].Instance,
  2991. Name = "\0",
  2992. CornerRadius = UDimNew(0, 6)
  2993. })
  2994.  
  2995. Items["Glow2"] = Instances:Create("ImageLabel", {
  2996. Parent = Items["Dragger"].Instance,
  2997. Name = "\0",
  2998. ImageColor3 = Library.Theme["Accent"],
  2999. ScaleType = Enum.ScaleType.Slice,
  3000. ImageTransparency = 0.800000011920929,
  3001. BorderColor3 = FromRGB(0, 0, 0),
  3002. Size = UDim2New(1, 25, 1, 25),
  3003. AnchorPoint = Vector2New(0.5, 0.5),
  3004. Image = "http://www.roblox.com/asset/?id=18245826428",
  3005. BackgroundTransparency = 1,
  3006. Position = UDim2New(0.5, 0, 0.5, 0),
  3007. ZIndex = 2,
  3008. BorderSizePixel = 0,
  3009. SliceCenter = RectNew(Vector2New(21, 21), Vector2New(79, 79))
  3010. }):AddToTheme({ImageColor3 = 'Accent'})
  3011.  
  3012. Items["Value"] = Instances:Create("TextLabel", {
  3013. Parent = Items["Slider"].Instance,
  3014. Name = "\0",
  3015. FontFace = Library.Font,
  3016. TextColor3 = Library.Theme["Text"],
  3017. TextTransparency = 0.5,
  3018. Text = "50%",
  3019. Size = UDim2New(0, 0, 0, 15),
  3020. AnchorPoint = Vector2New(1, 0.5),
  3021. BorderSizePixel = 0,
  3022. BackgroundTransparency = 1,
  3023. Position = UDim2New(1, 0, 0.5, 0),
  3024. BorderColor3 = FromRGB(0, 0, 0),
  3025. AutomaticSize = Enum.AutomaticSize.X,
  3026. TextSize = 16
  3027. }):AddToTheme({TextColor3 = 'Text'})
  3028. end
  3029.  
  3030. function Slider:SetTitle(Text)
  3031. Slider.Name = tostring(Text)
  3032. Items["Text"].Instance.Text = tostring(Text)
  3033. end
  3034.  
  3035. function Slider:Get()
  3036. return Slider.Value
  3037. end
  3038.  
  3039. function Slider:SetVisibility(Bool)
  3040. Items["Slider"].Instance.Visible = Bool
  3041. end
  3042.  
  3043. function Slider:Set(Value)
  3044. Slider.Value = Library:Round(MathClamp(Value, Slider.Min, Slider.Max), Slider.Decimals)
  3045. Library.Flags[Slider.Flag] = Slider.Value
  3046.  
  3047. Items["Accent"]:Tween(TweenInfo.new(Library.Tween.Time, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2New((Slider.Value - Slider.Min) / (Slider.Max - Slider.Min), 0, 1, 0)})
  3048. Items["Value"].Instance.Text = StringFormat("%s%s", Slider.Value, Slider.Suffix)
  3049.  
  3050. if Slider.Callback then
  3051. Library:SafeCall(Slider.Callback, Slider.Value)
  3052. end
  3053. end
  3054.  
  3055. local InputChanged
  3056.  
  3057. Items["RealSlider"]:Connect("InputBegan", function(Input)
  3058. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  3059. Slider.Sliding = true
  3060.  
  3061. local SizeX = (Input.Position.X - Items["RealSlider"].Instance.AbsolutePosition.X) / Items["RealSlider"].Instance.AbsoluteSize.X
  3062. local Value = ((Slider.Max - Slider.Min) * SizeX) + Slider.Min
  3063.  
  3064. Slider:Set(Value)
  3065.  
  3066. if InputChanged then
  3067. return
  3068. end
  3069.  
  3070. InputChanged = Input.Changed:Connect(function()
  3071. if Input.UserInputState == Enum.UserInputState.End then
  3072. Slider.Sliding = false
  3073.  
  3074. InputChanged:Disconnect()
  3075. InputChanged = nil
  3076. end
  3077. end)
  3078. end
  3079. end)
  3080.  
  3081. Library:Connect(UserInputService.InputChanged, function(Input)
  3082. if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then
  3083. if Slider.Sliding then
  3084. local SizeX = (Input.Position.X - Items["RealSlider"].Instance.AbsolutePosition.X) / Items["RealSlider"].Instance.AbsoluteSize.X
  3085. local Value = ((Slider.Max - Slider.Min) * SizeX) + Slider.Min
  3086.  
  3087. Slider:Set(Value)
  3088. end
  3089. end
  3090. end)
  3091.  
  3092. if Slider.Default then
  3093. Slider:Set(Slider.Default)
  3094. end
  3095.  
  3096. Library.SetFlags[Slider.Flag] = function(Value)
  3097. Slider:Set(Value)
  3098. end
  3099.  
  3100. return Slider
  3101. end
  3102.  
  3103. Library.Sections.Dropdown = function(self, Data)
  3104. Data = Data or { }
  3105.  
  3106. local Dropdown = {
  3107. Window = self.Window,
  3108. Page = self.Page,
  3109. Section = self,
  3110.  
  3111. Name = Data.Name or Data.name or "Dropdown",
  3112. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  3113. Items = Data.Items or Data.items or { "One", "Two", "Three" },
  3114. Default = Data.Default or Data.default or nil,
  3115. Callback = Data.Callback or Data.callback or function() end,
  3116. Multi = Data.Multi or Data.multi or false,
  3117.  
  3118. Value = { },
  3119. Options = { },
  3120. IsOpen = false
  3121. }
  3122.  
  3123. local Items = { } do
  3124. Items["Dropdown"] = Instances:Create("Frame", {
  3125. Parent = Dropdown.Section.Items["Content"].Instance,
  3126. Name = "\0",
  3127. BackgroundTransparency = 1,
  3128. BorderColor3 = FromRGB(0, 0, 0),
  3129. Size = UDim2New(1, 0, 0, 30),
  3130. BorderSizePixel = 0
  3131. })
  3132.  
  3133. Items["Text"] = Instances:Create("TextLabel", {
  3134. Parent = Items["Dropdown"].Instance,
  3135. Name = "\0",
  3136. FontFace = Library.Font,
  3137. TextColor3 = Library.Theme["Text"],
  3138. BorderColor3 = FromRGB(0, 0, 0),
  3139. Text = Dropdown.Name,
  3140. AnchorPoint = Vector2New(0, 0.5),
  3141. Size = UDim2New(0, 0, 0, 15),
  3142. BackgroundTransparency = 1,
  3143. Position = UDim2New(0, 0, 0.5, 0),
  3144. BorderSizePixel = 0,
  3145. AutomaticSize = Enum.AutomaticSize.X,
  3146. TextSize = 16
  3147. }):AddToTheme({TextColor3 = 'Text'})
  3148.  
  3149. Items["RealDropdown"] = Instances:Create("TextButton", {
  3150. Parent = Items["Dropdown"].Instance,
  3151. Name = "\0",
  3152. FontFace = Library.Font,
  3153. TextColor3 = FromRGB(0, 0, 0),
  3154. BorderColor3 = FromRGB(0, 0, 0),
  3155. Text = "",
  3156. AutoButtonColor = false,
  3157. AnchorPoint = Vector2New(1, 1),
  3158. Position = UDim2New(1, 0, 1, 0),
  3159. Size = UDim2New(0, 200, 0, 30),
  3160. BorderSizePixel = 0,
  3161. TextSize = 14,
  3162. BackgroundColor3 = Library.Theme["Element"]
  3163. }):AddToTheme({BackgroundColor3 = 'Element'})
  3164.  
  3165. Instances:Create("UICorner", {
  3166. Parent = Items["RealDropdown"].Instance,
  3167. Name = "\0",
  3168. CornerRadius = UDimNew(0, 6)
  3169. })
  3170.  
  3171. Instances:Create("UIStroke", {
  3172. Parent = Items["RealDropdown"].Instance,
  3173. Name = "\0",
  3174. Color = Library.Theme["Outline"],
  3175. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  3176. }):AddToTheme({Color = 'Outline'})
  3177.  
  3178. Items["Value"] = Instances:Create("TextLabel", {
  3179. Parent = Items["RealDropdown"].Instance,
  3180. Name = "\0",
  3181. FontFace = Library.Font,
  3182. TextColor3 = Library.Theme["Text"],
  3183. TextTransparency = 0.5,
  3184. Text = "--",
  3185. Size = UDim2New(0, 0, 0, 15),
  3186. AnchorPoint = Vector2New(0, 0.5),
  3187. BorderSizePixel = 0,
  3188. BackgroundTransparency = 1,
  3189. Position = UDim2New(0, 8, 0.5, 0),
  3190. BorderColor3 = FromRGB(0, 0, 0),
  3191. AutomaticSize = Enum.AutomaticSize.X,
  3192. TextSize = 16
  3193. }):AddToTheme({TextColor3 = 'Text'})
  3194.  
  3195. Items["Icon"] = Instances:Create("ImageLabel", {
  3196. Parent = Items["RealDropdown"].Instance,
  3197. Name = "\0",
  3198. ImageColor3 = Library.Theme["Text"],
  3199. BorderColor3 = FromRGB(0, 0, 0),
  3200. AnchorPoint = Vector2New(1, 0.5),
  3201. Image = "rbxassetid://72690112230014",
  3202. BackgroundTransparency = 1,
  3203. Position = UDim2New(1, -8, 0.5, 0),
  3204. Size = UDim2New(0, 16, 0, 16),
  3205. BorderSizePixel = 0
  3206. }):AddToTheme({ImageColor3 = 'Text'})
  3207.  
  3208. Instances:Create("Frame", {
  3209. Parent = Items["RealDropdown"].Instance,
  3210. Name = "\0",
  3211. AnchorPoint = Vector2New(1, 0),
  3212. Position = UDim2New(1, -32, 0, 0),
  3213. BorderColor3 = FromRGB(0, 0, 0),
  3214. Size = UDim2New(0, 1, 1, 0),
  3215. BorderSizePixel = 0,
  3216. BackgroundColor3 = Library.Theme["Outline"]
  3217. }):AddToTheme({BackgroundColor3 = 'Outline'})
  3218.  
  3219. Items["OptionHolder"] = Instances:Create("TextButton", {
  3220. Parent = Library.UnusedHolder.Instance,
  3221. Name = "\0",
  3222. Visible = false,
  3223. FontFace = Library.Font,
  3224. TextColor3 = FromRGB(0, 0, 0),
  3225. BorderColor3 = FromRGB(0, 0, 0),
  3226. Text = "",
  3227. AutoButtonColor = false,
  3228. Size = UDim2New(0, 200, 0, 0),
  3229. Position = UDim2New(0, 54, 0, 236),
  3230. BorderSizePixel = 0,
  3231. AutomaticSize = Enum.AutomaticSize.Y,
  3232. TextSize = 14,
  3233. BackgroundColor3 = Library.Theme["Inline"]
  3234. }):AddToTheme({BackgroundColor3 = 'Inline'})
  3235.  
  3236. Instances:Create("UICorner", {
  3237. Parent = Items["OptionHolder"].Instance,
  3238. Name = "\0"
  3239. })
  3240.  
  3241. Instances:Create("UIListLayout", {
  3242. Parent = Items["OptionHolder"].Instance,
  3243. Name = "\0",
  3244. Padding = UDimNew(0, 6),
  3245. SortOrder = Enum.SortOrder.LayoutOrder
  3246. })
  3247.  
  3248. Instances:Create("UIPadding", {
  3249. Parent = Items["OptionHolder"].Instance,
  3250. Name = "\0",
  3251. PaddingTop = UDimNew(0, 10),
  3252. PaddingBottom = UDimNew(0, 10),
  3253. PaddingRight = UDimNew(0, 10),
  3254. PaddingLeft = UDimNew(0, 10)
  3255. })
  3256. end
  3257.  
  3258. function Dropdown:SetTitle(Text)
  3259. Dropdown.Name = tostring(Text)
  3260. Items["Text"].Instance.Text = tostring(Text)
  3261. end
  3262.  
  3263. function Dropdown:Get()
  3264. return Dropdown.Value
  3265. end
  3266.  
  3267. function Dropdown:SetVisibility(Bool)
  3268. Items["Dropdown"].Instance.Visible = Bool
  3269. end
  3270.  
  3271. local Debounce = false
  3272. local RenderStepped
  3273.  
  3274. function Dropdown:SetOpen(Bool)
  3275. if Debounce then
  3276. return
  3277. end
  3278.  
  3279. Dropdown.IsOpen = Bool
  3280.  
  3281. Debounce = true
  3282.  
  3283. if Dropdown.IsOpen then
  3284. Items["OptionHolder"].Instance.Visible = true
  3285. Items["OptionHolder"].Instance.Parent = Library.Holder.Instance
  3286.  
  3287. RenderStepped = RunService.RenderStepped:Connect(function()
  3288. Items["OptionHolder"].Instance.Position = UDim2New(0, Items["RealDropdown"].Instance.AbsolutePosition.X, 0, Items["RealDropdown"].Instance.AbsolutePosition.Y - 25)
  3289. Items["OptionHolder"].Instance.Size = UDim2New(0, Items["RealDropdown"].Instance.AbsoluteSize.X, 0, 0)
  3290. end)
  3291.  
  3292. for Index, Value in Library.OpenFrames do
  3293. if Value ~= Dropdown and not Dropdown.Section.IsSettings then
  3294. Value:SetOpen(false)
  3295. end
  3296. end
  3297.  
  3298. Library.OpenFrames[Dropdown] = Dropdown
  3299. else
  3300. if Library.OpenFrames[Dropdown] then
  3301. Library.OpenFrames[Dropdown] = nil
  3302. end
  3303.  
  3304. if RenderStepped then
  3305. RenderStepped:Disconnect()
  3306. RenderStepped = nil
  3307. end
  3308. end
  3309.  
  3310. local Descendants = Items["OptionHolder"].Instance:GetDescendants()
  3311. TableInsert(Descendants, Items["OptionHolder"].Instance)
  3312.  
  3313. local NewTween
  3314.  
  3315. for Index, Value in Descendants do
  3316. local TransparencyProperty = Tween:GetProperty(Value)
  3317.  
  3318. if not TransparencyProperty then
  3319. continue
  3320. end
  3321.  
  3322. if not Value.ClassName:find("UI") then
  3323. Value.ZIndex = Dropdown.IsOpen and 3 or 1
  3324. end
  3325.  
  3326. if type(TransparencyProperty) == "table" then
  3327. for _, Property in TransparencyProperty do
  3328. NewTween = Tween:FadeItem(Value, Property, Bool, Library.FadeSpeed)
  3329. end
  3330. else
  3331. NewTween = Tween:FadeItem(Value, TransparencyProperty, Bool, Library.FadeSpeed)
  3332. end
  3333. end
  3334.  
  3335. NewTween.Tween.Completed:Connect(function()
  3336. Debounce = false
  3337. Items["OptionHolder"].Instance.Visible = Dropdown.IsOpen
  3338. task.wait(0.2)
  3339. Items["OptionHolder"].Instance.Parent = not Dropdown.IsOpen and Library.UnusedHolder.Instance or Library.Holder.Instance
  3340. end)
  3341. end
  3342.  
  3343. function Dropdown:Set(Option)
  3344. if Dropdown.Multi then
  3345. if type(Option) ~= "table" then
  3346. return
  3347. end
  3348.  
  3349. Dropdown.Value = Option
  3350. Library.Flags[Dropdown.Flag] = Option
  3351.  
  3352. for Index, Value in Option do
  3353. local OptionData = Dropdown.Options[Value]
  3354.  
  3355. if not OptionData then
  3356. continue
  3357. end
  3358.  
  3359. OptionData.Selected = true
  3360. OptionData:Toggle("Active")
  3361. end
  3362.  
  3363. Items["Value"].Instance.Text = TableConcat(Option, ", ")
  3364. else
  3365. if not Dropdown.Options[Option] then
  3366. return
  3367. end
  3368.  
  3369. local OptionData = Dropdown.Options[Option]
  3370.  
  3371. Dropdown.Value = Option
  3372. Library.Flags[Dropdown.Flag] = Option
  3373.  
  3374. for Index, Value in Dropdown.Options do
  3375. if Value ~= OptionData then
  3376. Value.Selected = false
  3377. Value:Toggle("Inactive")
  3378. else
  3379. Value.Selected = true
  3380. Value:Toggle("Active")
  3381. end
  3382. end
  3383.  
  3384. Items["Value"].Instance.Text = Option
  3385. end
  3386.  
  3387. if Dropdown.Callback then
  3388. Library:SafeCall(Dropdown.Callback, Dropdown.Value)
  3389. end
  3390. end
  3391.  
  3392. function Dropdown:Add(Option)
  3393. local OptionButton = Instances:Create("TextButton", {
  3394. Parent = Items["OptionHolder"].Instance,
  3395. Name = "\0",
  3396. FontFace = Library.Font,
  3397. TextColor3 = FromRGB(0, 0, 0),
  3398. BorderColor3 = FromRGB(0, 0, 0),
  3399. Text = "",
  3400. AutoButtonColor = false,
  3401. BackgroundTransparency = 1,
  3402. Size = UDim2New(1, 0, 0, 20),
  3403. BorderSizePixel = 0,
  3404. TextSize = 14
  3405. })
  3406.  
  3407. local OptionLiner = Instances:Create("Frame", {
  3408. Parent = OptionButton.Instance,
  3409. Name = "\0",
  3410. BackgroundTransparency = 1,
  3411. Size = UDim2New(0, 3, 0, 0),
  3412. BorderColor3 = FromRGB(0, 0, 0),
  3413. ZIndex = 2,
  3414. BorderSizePixel = 0,
  3415. BackgroundColor3 = Library.Theme["Accent"]
  3416. }):AddToTheme({BackgroundColor3 = 'Accent'})
  3417.  
  3418. local OptionGlow = Instances:Create("ImageLabel", {
  3419. Parent = OptionLiner.Instance,
  3420. Name = "\0",
  3421. ImageColor3 = Library.Theme["Accent"],
  3422. ScaleType = Enum.ScaleType.Slice,
  3423. ImageTransparency = 1,
  3424. BorderColor3 = FromRGB(0, 0, 0),
  3425. Size = UDim2New(1, 25, 1, 25),
  3426. AnchorPoint = Vector2New(0.5, 0.5),
  3427. Image = "http://www.roblox.com/asset/?id=18245826428",
  3428. BackgroundTransparency = 1,
  3429. Position = UDim2New(0.5, 0, 0.5, 0),
  3430. BorderSizePixel = 0,
  3431. SliceCenter = RectNew(Vector2New(21, 21), Vector2New(79, 79))
  3432. }):AddToTheme({ImageColor3 = 'Accent'})
  3433.  
  3434. Instances:Create("UICorner", {
  3435. Parent = OptionLiner.Instance,
  3436. Name = "\0",
  3437. CornerRadius = UDimNew(1, 0)
  3438. })
  3439.  
  3440. local OptionText = Instances:Create("TextLabel", {
  3441. Parent = OptionButton.Instance,
  3442. Name = "\0",
  3443. FontFace = Library.Font,
  3444. TextColor3 = Library.Theme["Text"],
  3445. TextTransparency = 0.5,
  3446. Text = Option,
  3447. Size = UDim2New(0, 0, 0, 15),
  3448. AnchorPoint = Vector2New(0, 0.5),
  3449. BorderSizePixel = 0,
  3450. BackgroundTransparency = 1,
  3451. Position = UDim2New(0, 0, 0.5, 0),
  3452. BorderColor3 = FromRGB(0, 0, 0),
  3453. AutomaticSize = Enum.AutomaticSize.X,
  3454. TextSize = 16
  3455. }):AddToTheme({TextColor3 = 'Text'})
  3456.  
  3457. local OptionData = {
  3458. Button = OptionButton,
  3459. Name = Option,
  3460. Liner = OptionLiner,
  3461. Glow = OptionGlow,
  3462. Text = OptionText,
  3463. Selected = false
  3464. }
  3465.  
  3466. function OptionData:Toggle(Value)
  3467. if Value == "Active" then
  3468. OptionData.Liner:Tween(nil, {BackgroundTransparency = 0, Size = UDim2New(0, 3, 1, 0)})
  3469. OptionData.Glow:Tween(nil, {ImageTransparency = 0.7})
  3470. OptionData.Text:Tween(nil, {Position = UDim2New(0, 12, 0.5 ,0), TextTransparency = 0})
  3471. else
  3472. OptionData.Liner:Tween(nil, {BackgroundTransparency = 1, Size = UDim2New(0, 3, 0, 0)})
  3473. OptionData.Glow:Tween(nil, {ImageTransparency = 1})
  3474. OptionData.Text:Tween(nil, {Position = UDim2New(0, 0, 0.5 ,0), TextTransparency = 0.5})
  3475. end
  3476. end
  3477.  
  3478. function OptionData:Set()
  3479. OptionData.Selected = not OptionData.Selected
  3480.  
  3481. if Dropdown.Multi then
  3482. local Index = TableFind(Dropdown.Value, OptionData.Name)
  3483.  
  3484. if Index then
  3485. TableRemove(Dropdown.Value, Index)
  3486. else
  3487. TableInsert(Dropdown.Value, OptionData.Name)
  3488. end
  3489.  
  3490. OptionData:Toggle(Index and "Inactive" or "Active")
  3491.  
  3492. Library.Flags[Dropdown.Flag] = Dropdown.Value
  3493.  
  3494. local TextFormat = #Dropdown.Value > 0 and TableConcat(Dropdown.Value, ", ") or "..."
  3495. Items["Value"].Instance.Text = TextFormat
  3496. else
  3497. if OptionData.Selected then
  3498. Dropdown.Value = OptionData.Name
  3499. Library.Flags[Dropdown.Flag] = OptionData.Name
  3500.  
  3501. OptionData.Selected = true
  3502. OptionData:Toggle("Active")
  3503.  
  3504. for Index, Value in Dropdown.Options do
  3505. if Value ~= OptionData then
  3506. Value.Selected = false
  3507. Value:Toggle("Inactive")
  3508. end
  3509. end
  3510.  
  3511. Items["Value"].Instance.Text = OptionData.Name
  3512. else
  3513. Dropdown.Value = nil
  3514. Library.Flags[Dropdown.Flag] = nil
  3515.  
  3516. OptionData.Selected = false
  3517. OptionData:Toggle("Inactive")
  3518.  
  3519. Items["Value"].Instance.Text = "..."
  3520. end
  3521. end
  3522.  
  3523. if Dropdown.Callback then
  3524. Library:SafeCall(Dropdown.Callback, Dropdown.Value)
  3525. end
  3526. end
  3527.  
  3528. OptionData.Button:Connect("MouseButton1Down", function()
  3529. OptionData:Set()
  3530. end)
  3531.  
  3532. Dropdown.Options[OptionData.Name] = OptionData
  3533. return OptionData
  3534. end
  3535.  
  3536. function Dropdown:Remove(Option)
  3537. if Dropdown.Options[Option] then
  3538. Dropdown.Options[Option].Button:Clean()
  3539. Dropdown.Options[Option] = nil
  3540. end
  3541. end
  3542.  
  3543. function Dropdown:Refresh(List)
  3544. for Index, Value in Dropdown.Options do
  3545. Dropdown:Remove(Value.Name)
  3546. end
  3547.  
  3548. Dropdown.Value = Dropdown.Multi and {} or nil
  3549. Library.Flags[Dropdown.Flag] = Dropdown.Value
  3550. Items["Value"].Instance.Text = "--"
  3551.  
  3552. for Index, Value in List do
  3553. Dropdown:Add(Value)
  3554. end
  3555. end
  3556.  
  3557. Items["RealDropdown"]:Connect("MouseButton1Down", function()
  3558. Dropdown:SetOpen(not Dropdown.IsOpen)
  3559. end)
  3560.  
  3561. Library:Connect(UserInputService.InputBegan, function(Input)
  3562. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  3563. if Dropdown.IsOpen then
  3564. if Library:IsMouseOverFrame(Items["OptionHolder"]) then
  3565. return
  3566. end
  3567.  
  3568. Dropdown:SetOpen(false)
  3569. end
  3570. end
  3571. end)
  3572.  
  3573. Items["RealDropdown"]:Connect("Changed", function(Property)
  3574. if Property == "AbsolutePosition" and Dropdown.IsOpen then
  3575. Dropdown.IsOpen = not Library:IsClipped(Items["OptionHolder"].Instance, Dropdown.Section.Items["Section"].Instance.Parent)
  3576. Items["OptionHolder"].Instance.Visible = Dropdown.IsOpen
  3577. end
  3578. end)
  3579.  
  3580. for Index, Value in Dropdown.Items do
  3581. Dropdown:Add(Value)
  3582. end
  3583.  
  3584. if Dropdown.Default then
  3585. Dropdown:Set(Dropdown.Default)
  3586. end
  3587.  
  3588. Library.SetFlags[Dropdown.Flag] = function(Value)
  3589. Dropdown:Set(Value)
  3590. end
  3591.  
  3592. return Dropdown
  3593. end
  3594.  
  3595. Library.Sections.Label = function(self, Name)
  3596. local Label = {
  3597. Window = self.Window,
  3598. Page = self.Page,
  3599. Section = self,
  3600.  
  3601. Name = Name or "Label"
  3602. }
  3603.  
  3604. local Items = { } do
  3605. Items["Label"] = Instances:Create("Frame", {
  3606. Parent = Label.Section.Items["Content"].Instance,
  3607. Name = "\0",
  3608. BackgroundTransparency = 1,
  3609. BorderColor3 = FromRGB(0, 0, 0),
  3610. Size = UDim2New(1, 0, 0, 20),
  3611. BorderSizePixel = 0
  3612. })
  3613.  
  3614. Items["Text"] = Instances:Create("TextLabel", {
  3615. Parent = Items["Label"].Instance,
  3616. Name = "\0",
  3617. FontFace = Library.Font,
  3618. TextColor3 = Library.Theme["Text"],
  3619. BorderColor3 = FromRGB(0, 0, 0),
  3620. Text = Label.Name,
  3621. AnchorPoint = Vector2New(0, 0.5),
  3622. Size = UDim2New(0, 0, 0, 15),
  3623. BackgroundTransparency = 1,
  3624. Position = UDim2New(0, 0, 0.5, 0),
  3625. BorderSizePixel = 0,
  3626. AutomaticSize = Enum.AutomaticSize.X,
  3627. TextSize = 16
  3628. }):AddToTheme({TextColor3 = 'Text'})
  3629.  
  3630. Items["SubElements"] = Instances:Create("Frame", {
  3631. Parent = Items["Label"].Instance,
  3632. Name = "\0",
  3633. BorderColor3 = FromRGB(0, 0, 0),
  3634. AnchorPoint = Vector2New(1, 0),
  3635. BackgroundTransparency = 1,
  3636. Position = UDim2New(1, 0, 0, 0),
  3637. Size = UDim2New(0, 0, 1, 0),
  3638. BorderSizePixel = 0,
  3639. AutomaticSize = Enum.AutomaticSize.X
  3640. })
  3641.  
  3642. Instances:Create("UIListLayout", {
  3643. Parent = Items["SubElements"].Instance,
  3644. Name = "\0",
  3645. VerticalAlignment = Enum.VerticalAlignment.Center,
  3646. FillDirection = Enum.FillDirection.Horizontal,
  3647. HorizontalAlignment = Enum.HorizontalAlignment.Right,
  3648. Padding = UDimNew(0, 6),
  3649. SortOrder = Enum.SortOrder.LayoutOrder
  3650. })
  3651. end
  3652.  
  3653. function Label:SetTitle(Text)
  3654. Text = tostring(Text)
  3655. Label.Name = Text
  3656. Items["Text"].Instance.Text = Text
  3657. end
  3658.  
  3659. function Label:SetText(Text)
  3660. Text = tostring(Text)
  3661. Items["Text"].Instance.Text = Text
  3662. end
  3663.  
  3664. function Label:SetVisibility(Bool)
  3665. Items["Label"].Instance.Visible = Bool
  3666. end
  3667.  
  3668. function Label:Colorpicker(Data)
  3669. Data = Data or { }
  3670.  
  3671. local Colorpicker = {
  3672. Window = Label.Window,
  3673. Page = Label.Page,
  3674. Section = Label.Section,
  3675.  
  3676. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  3677. Default = Data.Default or Data.default or Color3.fromRGB(255, 255, 255),
  3678. Callback = Data.Callback or Data.callback or function() end,
  3679. Alpha = Data.Alpha or Data.alpha or false
  3680. }
  3681.  
  3682. local NewColorpicker, ColorpickerItems = Library:CreateColorpicker({
  3683. Parent = Items["SubElements"],
  3684. Page = Colorpicker.Page,
  3685. Section = Colorpicker.Section,
  3686. Flag = Colorpicker.Flag,
  3687. Default = Colorpicker.Default,
  3688. Callback = Colorpicker.Callback,
  3689. Alpha = Colorpicker.Alpha
  3690. })
  3691.  
  3692. return NewColorpicker
  3693. end
  3694.  
  3695. function Label:Keybind(Data)
  3696. Data = Data or { }
  3697.  
  3698. local Keybind = {
  3699. Window = Label.Window,
  3700. Page = Label.Page,
  3701. Section = Label.Section,
  3702.  
  3703. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  3704. Default = Data.Default or Data.default or Enum.KeyCode.E,
  3705. Callback = Data.Callback or Data.callback or function() end,
  3706. Mode = Data.Mode or Data.mode or "Toggle"
  3707. }
  3708.  
  3709. local NewKeybind, KeybindItems = Library:CreateKeybind({
  3710. Parent = Items["SubElements"],
  3711. Page = Keybind.Page,
  3712. Section = Keybind.Section,
  3713. Flag = Keybind.Flag,
  3714. Default = Keybind.Default,
  3715. Mode = Keybind.Mode,
  3716. Callback = Keybind.Callback
  3717. })
  3718.  
  3719. return NewKeybind
  3720. end
  3721.  
  3722. return Label
  3723. end
  3724.  
  3725. Library.Sections.Textbox = function(self, Data)
  3726. Data = Data or { }
  3727.  
  3728. local Textbox = {
  3729. Window = self.Window,
  3730. Page = self.Page,
  3731. Section = self,
  3732.  
  3733. Name = Data.Name or Data.name or "Textbox",
  3734. Flag = Data.Flag or Data.flag or Library:NextFlag(),
  3735. Default = Data.Default or Data.default or "",
  3736. Callback = Data.Callback or Data.callback or function() end,
  3737. Placeholder = Data.Placeholder or Data.placeholder or "Placeholder",
  3738. Numeric = Data.Numeric or Data.numeric or false,
  3739. Finished = Data.Finished or Data.finished or false,
  3740.  
  3741. Value = ""
  3742. }
  3743.  
  3744. local Items = { } do
  3745. Items["Textbox"] = Instances:Create("Frame", {
  3746. Parent = Textbox.Section.Items["Content"].Instance,
  3747. Name = "\0",
  3748. BackgroundTransparency = 1,
  3749. BorderColor3 = FromRGB(0, 0, 0),
  3750. Size = UDim2New(1, 0, 0, 30),
  3751. BorderSizePixel = 0
  3752. })
  3753.  
  3754. Items["Text"] = Instances:Create("TextLabel", {
  3755. Parent = Items["Textbox"].Instance,
  3756. Name = "\0",
  3757. FontFace = Library.Font,
  3758. TextColor3 = Library.Theme["Text"],
  3759. BorderColor3 = FromRGB(0, 0, 0),
  3760. Text = Textbox.Name,
  3761. AnchorPoint = Vector2New(0, 0.5),
  3762. Size = UDim2New(0, 0, 0, 15),
  3763. BackgroundTransparency = 1,
  3764. Position = UDim2New(0, 0, 0.5, 0),
  3765. BorderSizePixel = 0,
  3766. AutomaticSize = Enum.AutomaticSize.X,
  3767. TextSize = 16
  3768. }):AddToTheme({TextColor3 = 'Text'})
  3769.  
  3770. Items["Background"] = Instances:Create("Frame", {
  3771. Parent = Items["Textbox"].Instance,
  3772. Name = "\0",
  3773. Active = true,
  3774. BorderColor3 = FromRGB(0, 0, 0),
  3775. AnchorPoint = Vector2New(1, 1),
  3776. Size = UDim2New(0, 0, 0, 30),
  3777. Position = UDim2New(1, 0, 1, 0),
  3778. Selectable = true,
  3779. BorderSizePixel = 0,
  3780. AutomaticSize = Enum.AutomaticSize.X,
  3781. BackgroundColor3 = Library.Theme["Element"]
  3782. }):AddToTheme({BackgroundColor3 = 'Element'})
  3783.  
  3784. Instances:Create("UICorner", {
  3785. Parent = Items["Background"].Instance,
  3786. Name = "\0",
  3787. CornerRadius = UDimNew(0, 6)
  3788. })
  3789.  
  3790. Instances:Create("UIStroke", {
  3791. Parent = Items["Background"].Instance,
  3792. Name = "\0",
  3793. Color = Library.Theme["Outline"],
  3794. ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  3795. }):AddToTheme({Color = 'Outline'})
  3796.  
  3797. Instances:Create("UIPadding", {
  3798. Parent = Items["Background"].Instance,
  3799. Name = "\0",
  3800. PaddingRight = UDimNew(0, 8),
  3801. PaddingLeft = UDimNew(0, 8)
  3802. })
  3803.  
  3804. Items["Input"] = Instances:Create("TextBox", {
  3805. Parent = Items["Background"].Instance,
  3806. Name = "\0",
  3807. FontFace = Library.Font,
  3808. Active = false,
  3809. TextTransparency = 0,
  3810. AnchorPoint = Vector2New(0, 0.5),
  3811. PlaceholderColor3 = FromRGB(133, 139, 143),
  3812. PlaceholderText = Textbox.Placeholder,
  3813. TextSize = 16,
  3814. Size = UDim2New(0, 0, 0, 15),
  3815. TextColor3 = Library.Theme["Text"],
  3816. BorderColor3 = FromRGB(0, 0, 0),
  3817. Text = "",
  3818. Selectable = false,
  3819. BackgroundTransparency = 1,
  3820. Position = UDim2New(0, 0, 0.5, 0),
  3821. CursorPosition = -1,
  3822. BorderSizePixel = 0,
  3823. AutomaticSize = Enum.AutomaticSize.X
  3824. }):AddToTheme({TextColor3 = 'Text'})
  3825. end
  3826.  
  3827. function Textbox:SetTitle(Text)
  3828. Textbox.Name = tostring(Text)
  3829. Items["Text"].Instance.Text = tostring(Text)
  3830. end
  3831.  
  3832. function Textbox:Get()
  3833. return Textbox.Value
  3834. end
  3835.  
  3836. function Textbox:SetVisibility(Bool)
  3837. Items["Textbox"].Instance.Visible = Bool
  3838. end
  3839.  
  3840. function Textbox:Set(Value)
  3841. if Textbox.Numeric then
  3842. if (not tonumber(Value)) and StringLen(tostring(Value)) > 0 then
  3843. Value = Textbox.Value
  3844. end
  3845. end
  3846.  
  3847. Textbox.Value = Value
  3848. Items["Input"].Instance.Text = Value
  3849. Library.Flags[Textbox.Flag] = Value
  3850.  
  3851. if Textbox.Callback then
  3852. Library:SafeCall(Textbox.Callback, Value)
  3853. end
  3854. end
  3855.  
  3856. if Textbox.Finished then
  3857. Items["Input"]:Connect("FocusLost", function(PressedEnterQuestionMark)
  3858. if PressedEnterQuestionMark then
  3859. Textbox:Set(Items["Input"].Instance.Text)
  3860. end
  3861. end)
  3862. else
  3863. Library:Connect(Items["Input"].Instance:GetPropertyChangedSignal("Text"), function()
  3864. Textbox:Set(Items["Input"].Instance.Text)
  3865. end)
  3866. end
  3867.  
  3868. if Textbox.Default then
  3869. Textbox:Set(Textbox.Default)
  3870. end
  3871.  
  3872. Library.SetFlags[Textbox.Flag] = function(Value)
  3873. Textbox:Set(Value)
  3874. end
  3875.  
  3876. return Textbox
  3877. end
  3878. end
  3879.  
  3880. Library.CreateSettingsPage = function(self, Window, Watermark)
  3881. local SettingsPage = Window:Page({Name = "Settings", Icon = "rbxassetid://128742673777519"})
  3882.  
  3883. do
  3884. local ThemingSection = SettingsPage:Section({Name = "Theming", Icon = "rbxassetid://73803440257131"})
  3885.  
  3886. do
  3887. for Index, Value in Library.Theme do
  3888. ThemingSection:Label(Index):Colorpicker({
  3889. Flag = Index.."_ThemingThing",
  3890. Default = Value,
  3891. Alpha = 0,
  3892. Callback = function(Value)
  3893. Library.Theme[Index] = Value
  3894. Library:ChangeTheme(Index, Value)
  3895. end
  3896. })
  3897. end
  3898. end
  3899.  
  3900. local ConfigsSection = SettingsPage:Section({Name = "Configs", Icon = "rbxassetid://74885853379841"}) do
  3901. local ConfigName
  3902. local ConfigSelected
  3903.  
  3904. local ConfigsDropdown = ConfigsSection:Dropdown({
  3905. Name = "Configs",
  3906. Flag = "Configs",
  3907. Items = { },
  3908. Multi = false,
  3909. MaxSize = 120,
  3910. Callback = function(Value)
  3911. ConfigSelected = Value
  3912. end
  3913. })
  3914.  
  3915. ConfigsSection:Textbox({
  3916. Name = "Config name",
  3917. Placeholder = "Config name",
  3918. Flag = "ConfigName",
  3919. Callback = function(Value)
  3920. ConfigName = Value
  3921. end
  3922. })
  3923.  
  3924. ConfigsSection:Button({
  3925. Name = "Create",
  3926. Callback = function()
  3927. if ConfigName and ConfigName ~= "" then
  3928. if not isfile(Library.Folders.Configs .. "/" .. ConfigName .. ".json") then
  3929. writefile(Library.Folders.Configs .. "/" .. ConfigName .. ".json", Library:GetConfig())
  3930. Library:RefreshConfigsList(ConfigsDropdown)
  3931. end
  3932. end
  3933. end
  3934. })
  3935.  
  3936. ConfigsSection:Button({
  3937. Name = "Load",
  3938. Callback = function()
  3939. if ConfigSelected and ConfigSelected ~= "" then
  3940. Library:LoadConfig(readfile(Library.Folders.Configs .. "/" .. ConfigSelected..".json"))
  3941. end
  3942. end
  3943. })
  3944.  
  3945. ConfigsSection:Button({
  3946. Name = "Save",
  3947. Callback = function()
  3948. if ConfigSelected and ConfigSelected ~= "" then
  3949. writefile(Library.Folders.Configs .. "/" .. ConfigSelected..".json", Library:GetConfig())
  3950. end
  3951. end
  3952. })
  3953.  
  3954. ConfigsSection:Button({
  3955. Name = "Delete",
  3956. Callback = function()
  3957. if ConfigSelected and ConfigSelected ~= "" then
  3958. delfile(Library.Folders.Configs .. "/" .. ConfigSelected..".json")
  3959. Library:RefreshConfigsList(ConfigsDropdown)
  3960. end
  3961. end
  3962. })
  3963.  
  3964. ConfigsSection:Button({
  3965. Name = "Refresh",
  3966. Callback = function()
  3967. Library:RefreshConfigsList(ConfigsDropdown)
  3968. end
  3969. })
  3970.  
  3971. Library:RefreshConfigsList(ConfigsDropdown)
  3972. end
  3973. end
  3974.  
  3975. return SettingsPage
  3976. end
  3977. end
  3978.  
  3979.  
  3980.  
  3981. -- loadstring-friendly wrappers / aliases
  3982. Library.LucideIconsUrl = "https://raw.githubusercontent.com/Footagesus/Icons/refs/heads/main/lucide/dist/Icons.lua"
  3983. Library.IconPacks = Library.IconPacks or {}
  3984. Library.ActiveIconPack = "lucide"
  3985.  
  3986. function Library:LoadIconPack(Url, PackName)
  3987. PackName = PackName or "lucide"
  3988.  
  3989. if self.IconPacks[PackName] then
  3990. return self.IconPacks[PackName]
  3991. end
  3992.  
  3993. local Success, Result = pcall(function()
  3994. local Source = game:HttpGet(Url)
  3995. local Chunk = loadstring(Source)
  3996. if not Chunk then
  3997. return {}
  3998. end
  3999.  
  4000. local Icons = Chunk()
  4001. if type(Icons) ~= "table" then
  4002. return {}
  4003. end
  4004.  
  4005. return Icons
  4006. end)
  4007.  
  4008. self.IconPacks[PackName] = Success and Result or {}
  4009. return self.IconPacks[PackName]
  4010. end
  4011.  
  4012. function Library:SetIconPack(PackName)
  4013. self.ActiveIconPack = PackName or "lucide"
  4014. end
  4015.  
  4016. function Library:GetIconPack(PackName)
  4017. PackName = PackName or self.ActiveIconPack or "lucide"
  4018.  
  4019. if not self.IconPacks[PackName] then
  4020. if PackName == "lucide" then
  4021. self:LoadIconPack(self.LucideIconsUrl, "lucide")
  4022. else
  4023. self.IconPacks[PackName] = {}
  4024. end
  4025. end
  4026.  
  4027. return self.IconPacks[PackName] or {}
  4028. end
  4029.  
  4030. function Library:ResolveIcon(Icon, PackName)
  4031. if not Icon or Icon == "" then
  4032. return Icon
  4033. end
  4034.  
  4035. if typeof(Icon) ~= "string" then
  4036. return Icon
  4037. end
  4038.  
  4039. if Icon:match("^rbxassetid://") or Icon:match("^https?://") then
  4040. return Icon
  4041. end
  4042.  
  4043. local Icons = self:GetIconPack(PackName)
  4044. return Icons[string.lower(Icon)] or Icon
  4045. end
  4046.  
  4047. local OriginalWindowFunction = Library.Window
  4048. Library.Window = function(self, Data)
  4049. Data = Data or {}
  4050.  
  4051. Data.Logo = self:ResolveIcon(Data.Logo)
  4052. Data.logo = self:ResolveIcon(Data.logo)
  4053.  
  4054. if Data.WatermarkLogo then
  4055. Data.WatermarkLogo = self:ResolveIcon(Data.WatermarkLogo)
  4056. end
  4057.  
  4058. return OriginalWindowFunction(self, Data)
  4059. end
  4060.  
  4061. local OriginalSectionFunction = Library.Pages.Section
  4062. Library.Pages.Section = function(self, Data)
  4063. Data = Data or {}
  4064. Data.Icon = Library:ResolveIcon(Data.Icon or Data.icon)
  4065. Data.icon = Data.Icon
  4066. return OriginalSectionFunction(self, Data)
  4067. end
  4068.  
  4069. Library.CreateWindow = function(self, Data)
  4070. Data = Data or {}
  4071.  
  4072. local Window = self:Window(Data)
  4073. local Watermark
  4074.  
  4075. if Data.WatermarkEnabled then
  4076. Watermark = self:Watermark(
  4077. Data.WatermarkText or Data.Name or "Window",
  4078. self:ResolveIcon(Data.WatermarkLogo or Data.Logo)
  4079. )
  4080. Window.Watermark = Watermark
  4081. end
  4082.  
  4083. Window._AutoSettingsEnabled = Data.SettingsTabEnabled and true or false
  4084. Window._AutoSettingsWatermark = Watermark
  4085.  
  4086. local OriginalPage = Window.Page
  4087. local CreatingSettings = false
  4088.  
  4089. local function ReorderTabs()
  4090. local Order = 1
  4091.  
  4092. for _, Value in Window.Pages do
  4093. if Value ~= Window.SettingsPage and Value.Items and Value.Items["Inactive"] then
  4094. Value.Items["Inactive"].Instance.LayoutOrder = Order
  4095. Order += 1
  4096. end
  4097. end
  4098.  
  4099. if Window.SettingsPage and Window.SettingsPage.Items and Window.SettingsPage.Items["Inactive"] then
  4100. Window.SettingsPage.Items["Inactive"].Instance.LayoutOrder = 999999
  4101. end
  4102. end
  4103.  
  4104. local function EnsureSettings()
  4105. if not Window._AutoSettingsEnabled or Window.SettingsPage or CreatingSettings then
  4106. ReorderTabs()
  4107. return
  4108. end
  4109.  
  4110. CreatingSettings = true
  4111. Window.SettingsPage = Library:CreateSettingsPage(Window, Window._AutoSettingsWatermark)
  4112. CreatingSettings = false
  4113.  
  4114. ReorderTabs()
  4115. end
  4116.  
  4117. local function WrappedPage(_, TabData)
  4118. TabData = TabData or {}
  4119. TabData.Icon = Library:ResolveIcon(TabData.Icon or TabData.icon)
  4120. TabData.icon = TabData.Icon
  4121.  
  4122. local Page = OriginalPage(Window, TabData)
  4123.  
  4124. EnsureSettings()
  4125. ReorderTabs()
  4126.  
  4127. return Page
  4128. end
  4129.  
  4130. Window.Page = WrappedPage
  4131. Window.CreateTab = WrappedPage
  4132. Window.CreatePage = WrappedPage
  4133.  
  4134. return Window
  4135. end
  4136.  
  4137. Library.CreateTab = Library.Page
  4138. Library.Pages.CreateSection = Library.Pages.Section
  4139.  
  4140. Library.Sections.CreateButton = Library.Sections.Button
  4141. Library.Sections.CreateToggle = Library.Sections.Toggle
  4142. Library.Sections.CreateSlider = Library.Sections.Slider
  4143. Library.Sections.CreateDropdown = Library.Sections.Dropdown
  4144. Library.Sections.CreateTextbox = Library.Sections.Textbox
  4145. Library.Sections.CreateLabel = Library.Sections.Label
  4146.  
  4147. local function NormalizeNamedData(NameOrData, Icon)
  4148. if type(NameOrData) == "table" then
  4149. local Data = TableClone(NameOrData)
  4150.  
  4151. if Data.Title and not (Data.Name or Data.name) then
  4152. Data.Name = Data.Title
  4153. end
  4154.  
  4155. if Data.title and not (Data.Name or Data.name) then
  4156. Data.Name = Data.title
  4157. end
  4158.  
  4159. if Icon and not (Data.Icon or Data.icon) then
  4160. Data.Icon = Icon
  4161. end
  4162.  
  4163. return Data
  4164. end
  4165.  
  4166. local Data = {
  4167. Name = NameOrData
  4168. }
  4169.  
  4170. if Icon ~= nil then
  4171. Data.Icon = Icon
  4172. end
  4173.  
  4174. return Data
  4175. end
  4176.  
  4177. function Library:AddTab(NameOrData, Icon)
  4178. local Data = NormalizeNamedData(NameOrData, Icon)
  4179. Data.Icon = self:ResolveIcon(Data.Icon or Data.icon)
  4180. Data.icon = Data.Icon
  4181.  
  4182. if self.CreateTab then
  4183. return self:CreateTab(Data)
  4184. end
  4185.  
  4186. return self:Page(Data)
  4187. end
  4188.  
  4189. function Library.Pages:AddSection(NameOrData, Icon)
  4190. local Data = NormalizeNamedData(NameOrData, Icon)
  4191. Data.Icon = Library:ResolveIcon(Data.Icon or Data.icon)
  4192. Data.icon = Data.Icon
  4193.  
  4194. if self.CreateSection then
  4195. return self:CreateSection(Data)
  4196. end
  4197.  
  4198. return self:Section(Data)
  4199. end
  4200.  
  4201. function Library.Sections:AddButton(NameOrData, Callback)
  4202. if type(NameOrData) == "table" then
  4203. local Data = NormalizeNamedData(NameOrData)
  4204. return self:CreateButton(Data)
  4205. end
  4206.  
  4207. return self:CreateButton({
  4208. Name = NameOrData,
  4209. Callback = Callback
  4210. })
  4211. end
  4212.  
  4213. function Library.Sections:AddToggle(NameOrData, FlagOrCallback, Default, Callback)
  4214. if type(NameOrData) == "table" then
  4215. local Data = NormalizeNamedData(NameOrData)
  4216. return self:CreateToggle(Data)
  4217. end
  4218.  
  4219. local RealCallback = type(FlagOrCallback) == "function" and FlagOrCallback or Callback
  4220.  
  4221. return self:CreateToggle({
  4222. Name = NameOrData,
  4223. Flag = type(FlagOrCallback) == "string" and FlagOrCallback or nil,
  4224. Default = Default,
  4225. Callback = RealCallback
  4226. })
  4227. end
  4228.  
  4229. function Library.Sections:AddSlider(NameOrData, Min, Max, Default, Callback)
  4230. if type(NameOrData) == "table" then
  4231. local Data = NormalizeNamedData(NameOrData)
  4232. return self:CreateSlider(Data)
  4233. end
  4234.  
  4235. return self:CreateSlider({
  4236. Name = NameOrData,
  4237. Min = Min,
  4238. Max = Max,
  4239. Default = Default,
  4240. Callback = Callback
  4241. })
  4242. end
  4243.  
  4244. function Library.Sections:AddDropdown(NameOrData, Items, Default, Callback)
  4245. if type(NameOrData) == "table" then
  4246. local Data = NormalizeNamedData(NameOrData)
  4247. return self:CreateDropdown(Data)
  4248. end
  4249.  
  4250. return self:CreateDropdown({
  4251. Name = NameOrData,
  4252. Items = Items,
  4253. Default = Default,
  4254. Callback = Callback
  4255. })
  4256. end
  4257.  
  4258. function Library.Sections:AddTextbox(NameOrData, Placeholder, Callback)
  4259. if type(NameOrData) == "table" then
  4260. local Data = NormalizeNamedData(NameOrData)
  4261. return self:CreateTextbox(Data)
  4262. end
  4263.  
  4264. return self:CreateTextbox({
  4265. Name = NameOrData,
  4266. Placeholder = Placeholder,
  4267. Callback = Callback
  4268. })
  4269. end
  4270.  
  4271. function Library.Sections:AddLabel(TextOrData)
  4272. if type(TextOrData) == "table" then
  4273. local Data = NormalizeNamedData(TextOrData)
  4274. return self:CreateLabel(Data.Name or Data.Text or Data.text or "Label")
  4275. end
  4276.  
  4277. return self:CreateLabel(TextOrData)
  4278. end
  4279.  
  4280. getgenv().Library = Library
  4281. return Library
Advertisement
Add Comment
Please, Sign In to add comment