gxentry

ecstasty

Apr 4th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 120.42 KB | None | 0 0
  1. -- start of ui library
  2. if getgenv().loaded then
  3. getgenv().library:unload_menu()
  4. end
  5. getgenv().loaded = true
  6.  
  7. -- variables
  8. local uis = cloneref(game:GetService("UserInputService"))
  9. local players = cloneref(game:GetService("Players"))
  10. local ws = cloneref(game:GetService("Workspace"))
  11. local rs = cloneref(game:GetService("ReplicatedStorage"))
  12. local http_service = cloneref(game:GetService("HttpService"))
  13. local gui_service = cloneref(game:GetService("GuiService"))
  14. local lighting = cloneref(game:GetService("Lighting"))
  15. local run = cloneref(game:GetService("RunService"))
  16. local stats = cloneref(game:GetService("Stats"))
  17. local coregui = cloneref(game:GetService("CoreGui"))
  18. local debris = cloneref(game:GetService("Debris"))
  19. local tween_service = cloneref(game:GetService("TweenService"))
  20. local sound_service = cloneref(game:GetService("SoundService"))
  21.  
  22. local vec2 = Vector2.new
  23. local vec3 = Vector3.new
  24. local dim2 = UDim2.new
  25. local dim = UDim.new
  26. local rect = Rect.new
  27. local cfr = CFrame.new
  28. local empty_cfr = cfr()
  29. local point_object_space = empty_cfr.PointToObjectSpace
  30. local angle = CFrame.Angles
  31. local dim_offset = UDim2.fromOffset
  32.  
  33. local color = Color3.new
  34. local rgb = Color3.fromRGB
  35. local hex = Color3.fromHex
  36. local hsv = Color3.fromHSV
  37. local rgbseq = ColorSequence.new
  38. local rgbkey = ColorSequenceKeypoint.new
  39. local numseq = NumberSequence.new
  40. local numkey = NumberSequenceKeypoint.new
  41.  
  42. local camera = ws.CurrentCamera
  43. local lp = players.LocalPlayer
  44. local mouse = lp:GetMouse()
  45. local gui_offset = gui_service:GetGuiInset().Y
  46.  
  47. local max = math.max
  48. local floor = math.floor
  49. local min = math.min
  50. local abs = math.abs
  51. local noise = math.noise
  52. local rad = math.rad
  53. local random = math.random
  54. local pow = math.pow
  55. local sin = math.sin
  56. local pi = math.pi
  57. local tan = math.tan
  58. local atan2 = math.atan2
  59. local clamp = math.clamp
  60.  
  61. local insert = table.insert
  62. local find = table.find
  63. local remove = table.remove
  64. local concat = table.concat
  65. --
  66.  
  67. -- Library init
  68. getgenv().library = {
  69. directory = "ecstasy",
  70. folders = {
  71. "/fonts",
  72. "/configs",
  73. },
  74. flags = {},
  75. config_flags = {},
  76. connections = {},
  77. notifications = {notifs = {}, offset = 0},
  78. playerlist_data = {
  79. players = {},
  80. player = {},
  81. },
  82. colorpicker_open = false;
  83. gui;
  84. }
  85.  
  86. local themes = {
  87. preset = {
  88. accent = rgb(255, 0, 0),
  89. text = rgb(255, 255, 255),
  90. text_outline = rgb(0, 0, 0),
  91. },
  92.  
  93. utility = {
  94. accent = {
  95. BackgroundColor3 = {},
  96. TextColor3 = {},
  97. ImageColor3 = {},
  98. ScrollBarImageColor3 = {}
  99. },
  100. text = {
  101. TextColor3 = {}
  102. },
  103. text_outline = {
  104. Color = {}
  105. }
  106. }
  107. }
  108.  
  109. local keys = {
  110. [Enum.KeyCode.LeftShift] = "LS",
  111. [Enum.KeyCode.RightShift] = "RS",
  112. [Enum.KeyCode.LeftControl] = "LC",
  113. [Enum.KeyCode.RightControl] = "RC",
  114. [Enum.KeyCode.Insert] = "INS",
  115. [Enum.KeyCode.Backspace] = "BS",
  116. [Enum.KeyCode.Return] = "Ent",
  117. [Enum.KeyCode.LeftAlt] = "LA",
  118. [Enum.KeyCode.RightAlt] = "RA",
  119. [Enum.KeyCode.CapsLock] = "CAPS",
  120. [Enum.KeyCode.One] = "1",
  121. [Enum.KeyCode.Two] = "2",
  122. [Enum.KeyCode.Three] = "3",
  123. [Enum.KeyCode.Four] = "4",
  124. [Enum.KeyCode.Five] = "5",
  125. [Enum.KeyCode.Six] = "6",
  126. [Enum.KeyCode.Seven] = "7",
  127. [Enum.KeyCode.Eight] = "8",
  128. [Enum.KeyCode.Nine] = "9",
  129. [Enum.KeyCode.Zero] = "0",
  130. [Enum.KeyCode.KeypadOne] = "Num1",
  131. [Enum.KeyCode.KeypadTwo] = "Num2",
  132. [Enum.KeyCode.KeypadThree] = "Num3",
  133. [Enum.KeyCode.KeypadFour] = "Num4",
  134. [Enum.KeyCode.KeypadFive] = "Num5",
  135. [Enum.KeyCode.KeypadSix] = "Num6",
  136. [Enum.KeyCode.KeypadSeven] = "Num7",
  137. [Enum.KeyCode.KeypadEight] = "Num8",
  138. [Enum.KeyCode.KeypadNine] = "Num9",
  139. [Enum.KeyCode.KeypadZero] = "Num0",
  140. [Enum.KeyCode.Minus] = "-",
  141. [Enum.KeyCode.Equals] = "=",
  142. [Enum.KeyCode.Tilde] = "~",
  143. [Enum.KeyCode.LeftBracket] = "[",
  144. [Enum.KeyCode.RightBracket] = "]",
  145. [Enum.KeyCode.RightParenthesis] = ")",
  146. [Enum.KeyCode.LeftParenthesis] = "(",
  147. [Enum.KeyCode.Semicolon] = ",",
  148. [Enum.KeyCode.Quote] = "'",
  149. [Enum.KeyCode.BackSlash] = "\\",
  150. [Enum.KeyCode.Comma] = ",",
  151. [Enum.KeyCode.Period] = ".",
  152. [Enum.KeyCode.Slash] = "/",
  153. [Enum.KeyCode.Asterisk] = "*",
  154. [Enum.KeyCode.Plus] = "+",
  155. [Enum.KeyCode.Period] = ".",
  156. [Enum.KeyCode.Backquote] = "`",
  157. [Enum.UserInputType.MouseButton1] = "MB1",
  158. [Enum.UserInputType.MouseButton2] = "MB2",
  159. [Enum.UserInputType.MouseButton3] = "MB3",
  160. [Enum.KeyCode.Escape] = "ESC",
  161. [Enum.KeyCode.Space] = "SPC",
  162. }
  163.  
  164. library.__index = library
  165.  
  166. for _, path in next, library.folders do
  167. makefolder(library.directory .. path)
  168. end
  169.  
  170. local flags = library.flags
  171. local config_flags = library.config_flags
  172.  
  173. local fonts = {}; do
  174. function Register_Font(Name, Weight, Style, Asset)
  175. if not isfile(Asset.Id) then
  176. writefile(Asset.Id, Asset.Font)
  177. end
  178.  
  179. if isfile(Name .. ".font") then
  180. delfile(Name .. ".font")
  181. end
  182.  
  183. local Data = {
  184. name = Name,
  185. faces = {
  186. {
  187. name = "Normal",
  188. weight = Weight,
  189. style = Style,
  190. assetId = getcustomasset(Asset.Id),
  191. },
  192. },
  193. }
  194.  
  195. writefile(Name .. ".font", http_service:JSONEncode(Data))
  196.  
  197. return getcustomasset(Name .. ".font");
  198. end
  199.  
  200. local ProggyTiny = Register_Font("adwdawdwadadwadawdawdawdawd!", 100, "Normal", {
  201. Id = "ProggyTinyyyy.ttf",
  202. Font = game:HttpGet("https://github.com/i77lhm/storage/raw/refs/heads/main/fonts/ProggyTiny.ttf"),
  203. })
  204.  
  205. fonts = {
  206. main = Font.new(ProggyTiny, Enum.FontWeight.Regular, Enum.FontStyle.Normal);
  207. }
  208. end
  209. --
  210.  
  211. -- Library functions
  212. -- Misc functions
  213. function library:tween(obj, properties)
  214. local tween = tween_service:Create(obj, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false, 0), properties):Play()
  215.  
  216. return tween
  217. end
  218.  
  219. function library:next_flag()
  220. local idx = #self.flags + 1
  221. return string.format("flag_%s", idx);
  222. end
  223.  
  224. function library:resizify(frame)
  225. local Frame = Instance.new("TextButton")
  226. Frame.Position = dim2(1, -10, 1, -10)
  227. Frame.BorderColor3 = rgb(0, 0, 0)
  228. Frame.Size = dim2(0, 10, 0, 10)
  229. Frame.BorderSizePixel = 0
  230. Frame.BackgroundColor3 = rgb(255, 255, 255)
  231. Frame.Parent = frame
  232. Frame.BackgroundTransparency = 1
  233. Frame.Text = ""
  234.  
  235. local resizing = false
  236. local start_size
  237. local start
  238. local og_size = frame.Size
  239.  
  240. Frame.InputBegan:Connect(function(input)
  241. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  242. resizing = true
  243. start = input.Position
  244. start_size = frame.Size
  245. end
  246. end)
  247.  
  248. Frame.InputEnded:Connect(function(input)
  249. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  250. resizing = false
  251. end
  252. end)
  253.  
  254. library:connection(uis.InputChanged, function(input, game_event)
  255. if resizing and input.UserInputType == Enum.UserInputType.MouseMovement then
  256. local viewport_x = camera.ViewportSize.X
  257. local viewport_y = camera.ViewportSize.Y
  258.  
  259. local current_size = dim2(
  260. start_size.X.Scale,
  261. math.clamp(
  262. start_size.X.Offset + (input.Position.X - start.X),
  263. og_size.X.Offset,
  264. viewport_x
  265. ),
  266. start_size.Y.Scale,
  267. math.clamp(
  268. start_size.Y.Offset + (input.Position.Y - start.Y),
  269. og_size.Y.Offset,
  270. viewport_y
  271. )
  272. )
  273. frame.Size = current_size
  274. end
  275. end)
  276. end
  277.  
  278. function library:mouse_in_frame(uiobject)
  279. local y_cond = uiobject.AbsolutePosition.Y <= mouse.Y and mouse.Y <= uiobject.AbsolutePosition.Y + uiobject.AbsoluteSize.Y
  280. local x_cond = uiobject.AbsolutePosition.X <= mouse.X and mouse.X <= uiobject.AbsolutePosition.X + uiobject.AbsoluteSize.X
  281.  
  282. return (y_cond and x_cond)
  283. end
  284.  
  285. function library:draggify(frame)
  286. local dragging = false
  287. local start_size = frame.Position
  288. local start
  289.  
  290. frame.InputBegan:Connect(function(input)
  291. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  292. dragging = true
  293. start = input.Position
  294. start_size = frame.Position
  295. end
  296. end)
  297.  
  298. frame.InputEnded:Connect(function(input)
  299. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  300. dragging = false
  301. end
  302. end)
  303.  
  304. library:connection(uis.InputChanged, function(input, game_event)
  305. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  306. local viewport_x = camera.ViewportSize.X
  307. local viewport_y = camera.ViewportSize.Y
  308.  
  309. local current_position = dim2(
  310. 0,
  311. clamp(
  312. start_size.X.Offset + (input.Position.X - start.X),
  313. 0,
  314. viewport_x - frame.Size.X.Offset
  315. ),
  316. 0,
  317. math.clamp(
  318. start_size.Y.Offset + (input.Position.Y - start.Y),
  319. 0,
  320. viewport_y - frame.Size.Y.Offset
  321. )
  322. )
  323.  
  324. frame.Position = current_position
  325. end
  326. end)
  327. end
  328.  
  329. function library:convert(str)
  330. local values = {}
  331.  
  332. for value in string.gmatch(str, "[^,]+") do
  333. insert(values, tonumber(value))
  334. end
  335.  
  336. if #values == 4 then
  337. return unpack(values)
  338. else
  339. return
  340. end
  341. end
  342.  
  343. function library:convert_enum(enum)
  344. local enum_parts = {}
  345.  
  346. for part in string.gmatch(enum, "[%w_]+") do
  347. insert(enum_parts, part)
  348. end
  349.  
  350. local enum_table = Enum
  351. for i = 2, #enum_parts do
  352. local enum_item = enum_table[enum_parts[i]]
  353.  
  354. enum_table = enum_item
  355. end
  356.  
  357. return enum_table
  358. end
  359.  
  360. local config_holder;
  361. local cfg_name;
  362. function library:update_config_list()
  363. if not config_holder then
  364. return
  365. end
  366.  
  367. local list = {}
  368.  
  369. for idx, file in next, listfiles(library.directory .. "/configs") do
  370. local name = file:gsub(library.directory .. "/configs\\", ""):gsub(".cfg", ""):gsub(library.directory .. "\\configs\\", "")
  371. list[#list + 1] = name
  372. end
  373.  
  374. config_holder.refresh_options(list)
  375. end
  376.  
  377. function library:get_config()
  378. local Config = {}
  379.  
  380. for _, v in next, flags do
  381. if type(v) == "table" and v.key then
  382. Config[_] = {active = v.active, mode = v.mode, key = tostring(v.key)}
  383. elseif type(v) == "table" and v["Transparency"] and v["Color"] then
  384. Config[_] = {Transparency = v["Transparency"], Color = v["Color"]:ToHex()}
  385. else
  386. Config[_] = v
  387. end
  388. end
  389.  
  390. return http_service:JSONEncode(Config)
  391. end
  392.  
  393. function library:load_config(config_json)
  394. local config = http_service:JSONDecode(config_json)
  395.  
  396. for _, v in next, config do
  397. local function_set = library.config_flags[_]
  398.  
  399. if _ == "config_name_list" then
  400. continue
  401. end
  402.  
  403. if function_set then
  404. if type(v) == "table" and v["Transparency"] and v["Color"] then
  405. function_set(hex(v["Color"]), v["Transparency"])
  406. elseif type(v) == "table" and v["active"] then
  407. function_set(v)
  408. else
  409. function_set(v)
  410. end
  411. end
  412. end
  413. end
  414.  
  415. function library:round(number, float)
  416. local multiplier = 1 / (float or 1)
  417.  
  418. return floor(number * multiplier + 0.5) / multiplier
  419. end
  420.  
  421. function library:apply_theme(instance, theme, property)
  422. insert(themes.utility[theme][property], instance)
  423. end
  424.  
  425. function library:update_theme(theme, color)
  426. for _, property in themes.utility[theme] do
  427.  
  428. for m, object in property do
  429. if object[_] == themes.preset[theme] then
  430. object[_] = color
  431. end
  432. end
  433. end
  434.  
  435. themes.preset[theme] = color
  436. end
  437.  
  438. function library:connection(signal, callback)
  439. local connection = signal:Connect(callback)
  440.  
  441. insert(library.connections, connection)
  442.  
  443. return connection
  444. end
  445.  
  446. function library:apply_stroke(parent)
  447. local STROKE = library:create("UIStroke", {
  448. Parent = parent,
  449. Color = themes.preset.text_outline,
  450. LineJoinMode = Enum.LineJoinMode.Miter
  451. })
  452.  
  453. library:apply_theme(STROKE, "text_outline", "Color")
  454. end
  455.  
  456. function library:create(instance, options)
  457. local ins = Instance.new(instance)
  458.  
  459. for prop, value in options do
  460. ins[prop] = value
  461. end
  462.  
  463. if instance == "TextLabel" or instance == "TextButton" or instance == "TextBox" then
  464. library:apply_theme(ins, "text", "TextColor3")
  465. end
  466.  
  467. return ins
  468. end
  469.  
  470. function library:unload_menu()
  471. if library[ "items" ] then
  472. library[ "items" ]:Destroy()
  473. end
  474.  
  475. if library[ "other" ] then
  476. library[ "other" ]:Destroy()
  477. end
  478.  
  479. for index, connection in library.connections do
  480. connection:Disconnect()
  481. connection = nil
  482. end
  483.  
  484. library = nil
  485. end
  486.  
  487. function library:change_fontsize(int)
  488. for _, property in themes.utility.text do
  489. for m, object in property do
  490. object.TextSize = int -- triangle code
  491. end
  492. end
  493. end
  494. --
  495.  
  496. -- Library element functions
  497. function library:window(properties)
  498. local cfg = {
  499. name = properties.name or properties.Name or '<font color = "#FFFFFF">chud</font>vision<font color = "#FFFFFF">.net</font>';
  500. size = properties.size or properties.Size or dim2(0, 752, 0, 502);
  501. selected_tab;
  502. items = {};
  503. }
  504.  
  505. library[ "items" ] = library:create( "ScreenGui" , {
  506. Parent = coregui;
  507. Name = "\0";
  508. Enabled = true;
  509. ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
  510. IgnoreGuiInset = true;
  511. });
  512.  
  513. library[ "other" ] = library:create( "ScreenGui" , {
  514. Parent = coregui;
  515. Name = "\0";
  516. Enabled = true;
  517. ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
  518. IgnoreGuiInset = true;
  519. });
  520.  
  521. local items = cfg.items; do
  522. items[ "main" ] = library:create( "Frame" , {
  523. Parent = library[ "items" ];
  524. Name = "\0";
  525. Position = dim2(0.5, -cfg.size.X.Offset / 2, 0.5, -cfg.size.Y.Offset / 2);
  526. BorderColor3 = rgb(0, 0, 0);
  527. Size = cfg.size;
  528. BorderSizePixel = 0;
  529. BackgroundColor3 = rgb(7, 7, 9)
  530. }); items[ "main" ].Position = dim2(0, items[ "main" ].AbsolutePosition.X, 0, items[ "main" ].AbsolutePosition.Y)
  531.  
  532. items[ "tab_element_holder" ] = library:create( "Frame" , {
  533. Name = "\0";
  534. Parent = items[ "main" ];
  535. BorderColor3 = rgb(0, 0, 0);
  536. Size = dim2(0, 82, 1, 0);
  537. BorderSizePixel = 0;
  538. BackgroundColor3 = rgb(18, 18, 20)
  539. });
  540.  
  541. items[ "tab_buttons" ] = library:create( "Frame" , {
  542. Parent = items[ "tab_element_holder" ];
  543. Name = "\0";
  544. Position = dim2(0, 1, 0, 1);
  545. BorderColor3 = rgb(0, 0, 0);
  546. Size = dim2(1, -2, 1, -2);
  547. BorderSizePixel = 0;
  548. BackgroundColor3 = rgb(7, 7, 9)
  549. });
  550.  
  551. items[ "tab_holder" ] = library:create( "Frame" , {
  552. Parent = items[ "tab_buttons" ];
  553. Name = "\0";
  554. BackgroundTransparency = 1;
  555. ClipsDescendants = true;
  556. BorderColor3 = rgb(0, 0, 0);
  557. Size = dim2(1, 0, 1, 0);
  558. Position = dim2(0, 0, 0, 0);
  559. BorderSizePixel = 0;
  560. BackgroundColor3 = rgb(255, 255, 255)
  561. });
  562.  
  563. library:create( "UIListLayout" , {
  564. Parent = items[ "tab_holder" ];
  565. Padding = dim(0, 15);
  566. SortOrder = Enum.SortOrder.LayoutOrder
  567. });
  568.  
  569. library:create( "UIPadding" , {
  570. Parent = items[ "tab_holder" ];
  571. PaddingTop = dim(0, 10)
  572. });
  573. end
  574.  
  575. do -- Other
  576. library:draggify(items[ "main" ])
  577. library:resizify(items[ "main" ])
  578. end
  579.  
  580. -- Keybind list
  581. cfg.keybind_list = library:create("Frame", {
  582. BorderColor3 = rgb(0, 0, 0);
  583. Parent = library[ "other" ];
  584. BackgroundTransparency = 1;
  585. Position = dim2(0, 100, 0, 600);
  586. Size = dim2(0, 202, 0, 66);
  587. BorderSizePixel = 0;
  588. AutomaticSize = Enum.AutomaticSize.XY;
  589. BackgroundColor3 = rgb(255, 255, 255)
  590. }); library:resizify(cfg.keybind_list); library:draggify(cfg.keybind_list);
  591.  
  592. library:create("UIStroke", {
  593. Parent = cfg.keybind_list;
  594. LineJoinMode = Enum.LineJoinMode.Miter;
  595. Transparency = 1;
  596. });
  597.  
  598. local inline1 = library:create("Frame", {
  599. BorderColor3 = rgb(0, 0, 0);
  600. Parent = cfg.keybind_list;
  601. BackgroundTransparency = 1;
  602. Position = dim2(0, 1, 0, 1);
  603. Size = dim2(1, -2, 1, -2);
  604. BorderSizePixel = 0;
  605. AutomaticSize = Enum.AutomaticSize.XY;
  606. BackgroundColor3 = rgb(56, 56, 56)
  607. });
  608.  
  609. library:create("UIStroke", {
  610. Color = rgb(56, 56, 56);
  611. LineJoinMode = Enum.LineJoinMode.Miter;
  612. Parent = inline1;
  613. Transparency = 1
  614. });
  615.  
  616. local inline2 = library:create("Frame", {
  617. BorderColor3 = rgb(0, 0, 0);
  618. Parent = inline1;
  619. BackgroundTransparency = 1;
  620. Position = dim2(0, 1, 0, 1);
  621. Size = dim2(1, -2, 1, -2);
  622. BorderSizePixel = 0;
  623. AutomaticSize = Enum.AutomaticSize.XY;
  624. BackgroundColor3 = rgb(46, 46, 46)
  625. });
  626.  
  627. library:create("UIStroke", {
  628. Color = rgb(46, 46, 46);
  629. LineJoinMode = Enum.LineJoinMode.Miter;
  630. Parent = inline2;
  631. Transparency = 1
  632. });
  633.  
  634. local inline3 = library:create("Frame", {
  635. BorderColor3 = rgb(0, 0, 0);
  636. Parent = inline2;
  637. BackgroundTransparency = 1;
  638. Position = dim2(0, 1, 0, 1);
  639. Size = dim2(1, -2, 1, -2);
  640. BorderSizePixel = 0;
  641. AutomaticSize = Enum.AutomaticSize.XY;
  642. BackgroundColor3 = rgb(46, 46, 46)
  643. });
  644.  
  645. library:create("UIStroke", {
  646. Color = rgb(46, 46, 46);
  647. LineJoinMode = Enum.LineJoinMode.Miter;
  648. Parent = inline3;
  649. Transparency = 1
  650. });
  651.  
  652. local inline4 = library:create("Frame", {
  653. BorderColor3 = rgb(0, 0, 0);
  654. Parent = inline3;
  655. BackgroundTransparency = 1;
  656. Position = dim2(0, 1, 0, 1);
  657. Size = dim2(1, -2, 1, -2);
  658. BorderSizePixel = 0;
  659. AutomaticSize = Enum.AutomaticSize.XY;
  660. BackgroundColor3 = rgb(46, 46, 46)
  661. });
  662.  
  663. library:create("UIStroke", {
  664. Color = rgb(56, 56, 56);
  665. LineJoinMode = Enum.LineJoinMode.Miter;
  666. Parent = inline4;
  667. Transparency = 1
  668. });
  669.  
  670. local inline5 = library:create("Frame", {
  671. Parent = inline4;
  672. BackgroundTransparency = 1;
  673. Size = dim2(1, 0, 1, 0);
  674. BorderColor3 = rgb(0, 0, 0);
  675. BorderSizePixel = 0;
  676. AutomaticSize = Enum.AutomaticSize.XY;
  677. BackgroundColor3 = rgb(0, 0, 0)
  678. });
  679.  
  680. local tab_holder = library:create("Frame", {
  681. Parent = inline5;
  682. BackgroundTransparency = 1;
  683. Position = dim2(0, 17, 0, 0);
  684. BorderColor3 = rgb(0, 0, 0);
  685. Size = dim2(1, 0, 0, 28);
  686. BorderSizePixel = 0;
  687. BackgroundColor3 = rgb(255, 255, 255)
  688. });
  689.  
  690. library:create("UIListLayout", {
  691. FillDirection = Enum.FillDirection.Horizontal;
  692. HorizontalFlex = Enum.UIFlexAlignment.Fill;
  693. Parent = tab_holder;
  694. Padding = dim(0, 4);
  695. SortOrder = Enum.SortOrder.LayoutOrder;
  696. VerticalFlex = Enum.UIFlexAlignment.Fill
  697. });
  698.  
  699. local button = library:create("TextButton", {
  700. FontFace = fonts.main;
  701. TextColor3 = rgb(255, 255, 255);
  702. BorderColor3 = rgb(0, 0, 0);
  703. Text = "keybinds";
  704. Parent = tab_holder;
  705. TextStrokeTransparency = 0;
  706. BackgroundTransparency = 1;
  707. Size = dim2(0, 200, 0, 50);
  708. BorderSizePixel = 0;
  709. TextSize = 9;
  710. BackgroundColor3 = rgb(255, 255, 255)
  711. });
  712.  
  713. local accent = library:create("Frame", {
  714. AnchorPoint = vec2(0, 1);
  715. Parent = button;
  716. Position = dim2(0, 0, 1, 0);
  717. BorderColor3 = rgb(0, 0, 0);
  718. Size = dim2(1, 0, 0, 4);
  719. BorderSizePixel = 0;
  720. BackgroundColor3 = themes.preset.accent
  721. }); library:apply_theme(accent, "accent", "BackgroundColor3")
  722.  
  723. local split = library:create("Frame", {
  724. AnchorPoint = vec2(0, 1);
  725. Parent = accent;
  726. Position = dim2(0, 0, 1, 0);
  727. BorderColor3 = rgb(0, 0, 0);
  728. Size = dim2(1, 0, 0, 2);
  729. BorderSizePixel = 0;
  730. BackgroundColor3 = themes.preset.accent
  731. }); library:apply_theme(split, "accent", "BackgroundColor3")
  732.  
  733. library:create("UIGradient", {
  734. Color = rgbseq{rgbkey(0, rgb(167, 167, 167)), rgbkey(1, rgb(167, 167, 167))};
  735. Parent = split
  736. });
  737.  
  738. local inline6 = library:create("Frame", {
  739. Parent = inline5;
  740. Size = dim2(1, -34, 0, 0);
  741. BackgroundTransparency = 1;
  742. Position = dim2(0, 17, 0, 31);
  743. BorderColor3 = rgb(0, 0, 0);
  744. BorderSizePixel = 0;
  745. AutomaticSize = Enum.AutomaticSize.XY;
  746. BackgroundColor3 = rgb(0, 0, 0)
  747. });
  748.  
  749. local inline7 = library:create("Frame", {
  750. Parent = inline6;
  751. Size = dim2(1, -2, 1, -2);
  752. Position = dim2(0, 1, 0, 1);
  753. BackgroundTransparency = 1;
  754. BorderColor3 = rgb(0, 0, 0);
  755. BorderSizePixel = 0;
  756. AutomaticSize = Enum.AutomaticSize.XY;
  757. BackgroundColor3 = rgb(46, 46, 46)
  758. });
  759.  
  760. local inline8 = library:create("Frame", {
  761. Parent = inline7;
  762. Size = dim2(1, -2, 1, -2);
  763. Position = dim2(0, 1, 0, 1);
  764. BorderColor3 = rgb(0, 0, 0);
  765. BorderSizePixel = 0;
  766. AutomaticSize = Enum.AutomaticSize.XY;
  767. BackgroundTransparency = 1;
  768. BackgroundColor3 = rgb(21, 21, 21)
  769. }); library.keybind_list = inline8
  770.  
  771. library:create("UIListLayout", {
  772. Parent = inline8;
  773. Padding = dim(0, 10);
  774. SortOrder = Enum.SortOrder.LayoutOrder
  775. });
  776.  
  777. library:create("UIPadding", {
  778. PaddingTop = dim(0, 8);
  779. PaddingBottom = dim(0, 8);
  780. Parent = inline8;
  781. PaddingRight = dim(0, 2);
  782. PaddingLeft = dim(0, 8)
  783. });
  784.  
  785. library:create("UIPadding", {
  786. PaddingBottom = dim(0, 2);
  787. PaddingRight = dim(0, 2);
  788. Parent = inline7
  789. });
  790.  
  791. library:create("UIPadding", {
  792. PaddingBottom = dim(0, 2);
  793. PaddingRight = dim(0, 2);
  794. Parent = inline6
  795. });
  796.  
  797. library:create("UIPadding", {
  798. PaddingBottom = dim(0, 10);
  799. PaddingRight = dim(0, 34);
  800. Parent = inline5
  801. });
  802.  
  803. library:create("UIPadding", {
  804. Parent = inline4
  805. });
  806.  
  807. library:create("UIPadding", {
  808. PaddingBottom = dim(0, 2);
  809. PaddingRight = dim(0, 2);
  810. Parent = inline3
  811. });
  812.  
  813. library:create("UIPadding", {
  814. PaddingBottom = dim(0, 2);
  815. PaddingRight = dim(0, 2);
  816. Parent = inline2
  817. });
  818.  
  819. library:create("UIPadding", {
  820. PaddingBottom = dim(0, 2);
  821. PaddingRight = dim(0, 2);
  822. Parent = inline1
  823. });
  824.  
  825. library:create("UIPadding", {
  826. PaddingBottom = dim(0, 2);
  827. PaddingRight = dim(0, 2);
  828. Parent = cfg.keybind_list
  829. });
  830. --
  831.  
  832. -- Playerlist
  833. items[ "outline" ] = library:create( "Frame" , {
  834. Parent = library[ "other" ];
  835. Name = "\0";
  836. BorderColor3 = rgb(0, 0, 0);
  837. Size = dim2(0.1417543888092041, 0, 0.3601022958755493, 0);
  838. BorderSizePixel = 0;
  839. BackgroundColor3 = rgb(18, 18, 20)
  840. }); cfg.mod_list = items[ "outline" ]
  841.  
  842. library:draggify(items[ "outline" ])
  843. library:resizify(items[ "outline" ])
  844. items[ "outline" ].Position = dim2(0, items[ "main" ].AbsoluteSize.X + items[ "main" ].AbsolutePosition.X + 5, 0, items[ "main" ].AbsolutePosition.Y + 58);
  845.  
  846. items[ "inline" ] = library:create( "Frame" , {
  847. Parent = items[ "outline" ];
  848. Name = "\0";
  849. Position = dim2(0, 1, 0, 1);
  850. BorderColor3 = rgb(0, 0, 0);
  851. Size = dim2(1, -2, 1, -2);
  852. BorderSizePixel = 0;
  853. BackgroundColor3 = rgb(7, 7, 9)
  854. });
  855.  
  856. items[ "title" ] = library:create( "TextLabel" , {
  857. FontFace = fonts.main;
  858. TextColor3 = rgb(68, 68, 70);
  859. BorderColor3 = rgb(0, 0, 0);
  860. Text = "MODERATOR LIST";
  861. Parent = items[ "inline" ];
  862. TextStrokeTransparency = 0;
  863. Name = "\0";
  864. Size = dim2(1, 0, 0, 11);
  865. BackgroundTransparency = 1;
  866. TextXAlignment = Enum.TextXAlignment.Left;
  867. Position = dim2(0, 15, 0, 15);
  868. BorderSizePixel = 0;
  869. TextSize = 9;
  870. BackgroundColor3 = rgb(255, 255, 255)
  871. });
  872.  
  873. items[ "scrolling" ] = library:create( "ScrollingFrame" , {
  874. ScrollBarImageColor3 = rgb(132, 135, 250);
  875. Active = true;
  876. AutomaticCanvasSize = Enum.AutomaticSize.Y;
  877. ScrollBarThickness = 2;
  878. Parent = items[ "inline" ];
  879. Name = "\0";
  880. Size = dim2(1, 0, 1, -23);
  881. BackgroundColor3 = rgb(255, 255, 255);
  882. BackgroundTransparency = 1;
  883. Position = dim2(0, 0, 0, 23);
  884. ScrollingEnabled = false;
  885. BorderColor3 = rgb(0, 0, 0);
  886. BorderSizePixel = 0;
  887. CanvasSize = dim2(0, 0, 0, 0)
  888. });
  889.  
  890. library:create( "UIPadding" , {
  891. Parent = items[ "scrolling" ];
  892. PaddingTop = dim(0, 18);
  893. PaddingRight = dim(0, 15);
  894. PaddingLeft = dim(0, 15)
  895. });
  896.  
  897. items[ "object" ] = library:create( "TextLabel" , {
  898. FontFace = fonts.main;
  899. TextColor3 = rgb(0, 0, 0);
  900. BorderColor3 = rgb(0, 0, 0);
  901. Text = "";
  902. Parent = items[ "scrolling" ];
  903. BackgroundTransparency = 1;
  904. Name = "\0";
  905. Size = dim2(1, -31, 1, -10);
  906. BorderSizePixel = 0;
  907. TextSize = 9;
  908. BackgroundColor3 = rgb(255, 255, 255)
  909. });
  910.  
  911. items[ "playerlist_holder" ] = library:create( "Frame" , {
  912. Parent = items[ "object" ];
  913. BackgroundTransparency = 1;
  914. Name = "\0";
  915. BorderColor3 = rgb(0, 0, 0);
  916. Size = dim2(1, 0, 1, -23);
  917. BorderSizePixel = 0;
  918. BackgroundColor3 = rgb(255, 255, 255)
  919. });
  920.  
  921. items[ "ScrollingFrame" ] = library:create( "ScrollingFrame" , {
  922. ScrollBarImageColor3 = rgb(132, 135, 250);
  923. Active = true;
  924. AutomaticCanvasSize = Enum.AutomaticSize.Y;
  925. ScrollBarThickness = 2;
  926. Parent = items[ "playerlist_holder" ];
  927. Size = dim2(1, 0, 1, -20);
  928. BackgroundTransparency = 1;
  929. Position = dim2(0, 0, 0, 10);
  930. BackgroundColor3 = rgb(255, 255, 255);
  931. BorderColor3 = rgb(0, 0, 0);
  932. BorderSizePixel = 0;
  933. CanvasSize = dim2(0, 0, 0, 0)
  934. });
  935.  
  936. library:create( "UIPadding" , {
  937. PaddingTop = dim(0, 10);
  938. PaddingBottom = dim(0, 10);
  939. Parent = items[ "ScrollingFrame" ];
  940. PaddingRight = dim(0, 10);
  941. PaddingLeft = dim(0, 10)
  942. });
  943.  
  944. library:create( "UIListLayout" , {
  945. Parent = items[ "ScrollingFrame" ];
  946. Padding = dim(0, 10);
  947. SortOrder = Enum.SortOrder.LayoutOrder
  948. });
  949.  
  950. library:create( "UIStroke" , {
  951. Color = rgb(18, 18, 20);
  952. Parent = items[ "playerlist_holder" ]
  953. });
  954.  
  955. function cfg.add_mod(name)
  956. library:create( "TextLabel" , {
  957. TextWrapped = true;
  958. Name = name;
  959. TextColor3 = rgb(255, 255, 255);
  960. BorderColor3 = rgb(0, 0, 0);
  961. Text = name;
  962. Parent = items[ "ScrollingFrame" ];
  963. TextStrokeTransparency = 0;
  964. Size = dim2(1, 0, 0, 0);
  965. BorderSizePixel = 0;
  966. BackgroundTransparency = 1;
  967. Position = dim2(0, 20, 0, 0);
  968. AutomaticSize = Enum.AutomaticSize.XY;
  969. FontFace = fonts.main;
  970. TextSize = 9;
  971. BackgroundColor3 = rgb(255, 255, 255)
  972. });
  973. end
  974.  
  975. function cfg.remove_mod(name)
  976. items[ "ScrollingFrame" ][name]:Destroy()
  977. end
  978. --
  979.  
  980. return setmetatable(cfg, library)
  981. end
  982.  
  983. function library:tab(properties)
  984. local cfg = {
  985. name = properties.name or "ecstasy";
  986. items = {};
  987. icon = properties.icon or "rbxassetid://139765537381996"
  988. }
  989.  
  990. local items = cfg.items; do
  991. -- Tab buttons
  992. items[ "button" ] = library:create( "TextButton" , {
  993. Parent = self.items[ "tab_holder" ];
  994. Name = "\0";
  995. BackgroundTransparency = 1;
  996. Position = dim2(0, -1, 0, 0);
  997. Text = "";
  998. BorderColor3 = rgb(0, 0, 0);
  999. Size = dim2(1, 0, 0, 66);
  1000. BorderSizePixel = 0;
  1001. BackgroundColor3 = rgb(27, 27, 27)
  1002. });
  1003.  
  1004. items[ "logo" ] = library:create( "ImageLabel" , {
  1005. ImageColor3 = rgb(69, 69, 71);
  1006. BorderColor3 = rgb(0, 0, 0);
  1007. Parent = items[ "button" ];
  1008. AnchorPoint = vec2(0.5, 0.5);
  1009. Image = cfg.icon;
  1010. BackgroundTransparency = 1;
  1011. Position = dim2(0.5, 0, 0.5, -10);
  1012. Name = "\0";
  1013. Size = dim2(0, 32, 0, 32);
  1014. BorderSizePixel = 0;
  1015. BackgroundColor3 = rgb(255, 255, 255)
  1016. }); library:apply_theme(items[ "logo" ], "accent", "ImageColor3")
  1017.  
  1018. items[ "text" ] = library:create( "TextLabel" , {
  1019. FontFace = fonts.main;
  1020. TextColor3 = rgb(69, 69, 71);
  1021. BorderColor3 = rgb(0, 0, 0);
  1022. Text = cfg.name;
  1023. TextStrokeTransparency = 0;
  1024. Parent = items[ "button" ];
  1025. Name = "\0";
  1026. BackgroundTransparency = 1;
  1027. Position = dim2(0, 0, 0, 19);
  1028. Size = dim2(1, 0, 1, 0);
  1029. BorderSizePixel = 0;
  1030. TextSize = 9;
  1031. BackgroundColor3 = rgb(255, 255, 255)
  1032. }); library:apply_theme(items[ "text" ], "accent", "TextColor3")
  1033. --
  1034.  
  1035. -- Tab Directory
  1036. items[ "tab" ] = library:create( "Frame" , {
  1037. Parent = self.items[ "main" ];
  1038. Name = "\0";
  1039. Visible = false;
  1040. BackgroundTransparency = 1;
  1041. Position = dim2(0, 80, 0, 0);
  1042. BorderColor3 = rgb(0, 0, 0);
  1043. Size = dim2(1, -80, 1, 0);
  1044. BorderSizePixel = 0;
  1045. BackgroundColor3 = rgb(255, 255, 255)
  1046. });
  1047.  
  1048. library:create( "UIPadding" , {
  1049. PaddingTop = dim(0, 14);
  1050. PaddingBottom = dim(0, 14);
  1051. Parent = items[ "tab" ];
  1052. PaddingRight = dim(0, 14);
  1053. PaddingLeft = dim(0, 14)
  1054. });
  1055.  
  1056. library:create( "UIListLayout" , {
  1057. FillDirection = Enum.FillDirection.Horizontal;
  1058. HorizontalFlex = Enum.UIFlexAlignment.Fill;
  1059. Parent = items[ "tab" ];
  1060. Padding = dim(0, 14);
  1061. SortOrder = Enum.SortOrder.LayoutOrder;
  1062. VerticalFlex = Enum.UIFlexAlignment.Fill
  1063. });
  1064.  
  1065. for _, side in {"left", "middle", "right"} do
  1066. items[ side .. "_column" ] = library:create( "Frame" , {
  1067. Parent = items[ "tab" ];
  1068. BackgroundTransparency = 1;
  1069. Name = "\0";
  1070. BorderColor3 = rgb(0, 0, 0);
  1071. Size = dim2(1, 0, 1, 0);
  1072. BorderSizePixel = 0;
  1073. BackgroundColor3 = rgb(18, 18, 20)
  1074. });
  1075. end
  1076. --
  1077. end
  1078.  
  1079. function cfg.open_tab()
  1080. local selected_tab = self.selected_tab
  1081.  
  1082. if selected_tab then
  1083. selected_tab[ 1 ].ImageColor3 = rgb(69, 69, 71)
  1084. selected_tab[ 2 ].TextColor3 = rgb(69, 69, 71)
  1085. selected_tab[ 3 ].Visible = false
  1086. end
  1087.  
  1088. items[ "logo" ].ImageColor3 = themes.preset.accent
  1089. items[ "text" ].TextColor3 = themes.preset.accent
  1090. items[ "tab" ].Visible = true
  1091.  
  1092. self.selected_tab = {
  1093. items[ "logo" ];
  1094. items[ "text" ];
  1095. items[ "tab" ];
  1096. }
  1097. end
  1098.  
  1099. items[ "button" ].MouseButton1Down:Connect(function()
  1100. cfg.open_tab()
  1101. end)
  1102.  
  1103. if not self.selected_tab then
  1104. cfg.open_tab(true)
  1105. end
  1106.  
  1107. return setmetatable(cfg, library)
  1108. end
  1109.  
  1110. function library:section(properties)
  1111. local cfg = {
  1112. name = properties.name or properties.Name or "section";
  1113. side = properties.side or "left";
  1114. items = {};
  1115. };
  1116.  
  1117. local items = cfg.items; do -- Instances
  1118. items[ "outline" ] = library:create( "Frame" , {
  1119. Name = "\0";
  1120. Parent = self.items[ cfg.side .. "_column" ];
  1121. BorderColor3 = rgb(0, 0, 0);
  1122. Size = dim2(1, 0, 1, 0);
  1123. BorderSizePixel = 0;
  1124. BackgroundColor3 = rgb(18, 18, 20)
  1125. });
  1126.  
  1127. items[ "inline" ] = library:create( "Frame" , {
  1128. Parent = items[ "outline" ];
  1129. Name = "\0";
  1130. Position = dim2(0, 1, 0, 1);
  1131. BorderColor3 = rgb(0, 0, 0);
  1132. Size = dim2(1, -2, 1, -2);
  1133. BorderSizePixel = 0;
  1134. BackgroundColor3 = rgb(7, 7, 9)
  1135. });
  1136.  
  1137. items[ "title" ] = library:create( "TextLabel" , {
  1138. FontFace = fonts.main;
  1139. TextColor3 = rgb(68, 68, 70);
  1140. BorderColor3 = rgb(0, 0, 0);
  1141. Text = cfg.name;
  1142. Parent = items[ "inline" ];
  1143. TextStrokeTransparency = 0;
  1144. Name = "\0";
  1145. Size = dim2(1, 0, 0, 11);
  1146. BackgroundTransparency = 1;
  1147. TextXAlignment = Enum.TextXAlignment.Left;
  1148. Position = dim2(0, 15, 0, 15);
  1149. BorderSizePixel = 0;
  1150. TextSize = 9;
  1151. BackgroundColor3 = rgb(255, 255, 255)
  1152. });
  1153.  
  1154. items[ "scrolling_frame" ] = library:create( "ScrollingFrame" , {
  1155. ScrollBarImageColor3 = rgb(119, 119, 239);
  1156. Active = true;
  1157. AutomaticCanvasSize = Enum.AutomaticSize.Y;
  1158. ScrollBarThickness = 4;
  1159. Parent = items[ "inline" ];
  1160. Name = "\0";
  1161. Size = dim2(1, 0, 1, -23);
  1162. BackgroundTransparency = 1;
  1163. Position = dim2(0, 0, 0, 23);
  1164. BackgroundColor3 = rgb(255, 255, 255);
  1165. BorderColor3 = rgb(0, 0, 0);
  1166. BorderSizePixel = 0;
  1167. CanvasSize = dim2(0, 0, 0, 0)
  1168. });
  1169.  
  1170. items[ "elements" ] = library:create( "Frame" , {
  1171. Name = "\0";
  1172. Parent = items[ "scrolling_frame" ];
  1173. BorderColor3 = rgb(0, 0, 0);
  1174. Size = dim2(1, -31, 0, 0);
  1175. BorderSizePixel = 0;
  1176. BackgroundColor3 = rgb(255, 255, 255)
  1177. });
  1178.  
  1179. library:create( "UIListLayout" , {
  1180. Parent = items[ "elements" ];
  1181. Padding = dim(0, 15);
  1182. SortOrder = Enum.SortOrder.LayoutOrder
  1183. });
  1184.  
  1185. library:create( "UIPadding" , {
  1186. Parent = items[ "scrolling_frame" ];
  1187. PaddingTop = dim(0, 18);
  1188. PaddingRight = dim(0, 15);
  1189. PaddingLeft = dim(0, 15)
  1190. });
  1191.  
  1192.  
  1193.  
  1194.  
  1195. end;
  1196.  
  1197. return setmetatable(cfg, library)
  1198. end
  1199.  
  1200. -- Elements
  1201. function library:toggle(options)
  1202. local cfg = {
  1203. enabled = options.enabled or nil,
  1204. name = options.name or "Toggle",
  1205. info = options.info or "",
  1206. flag = options.flag or library:next_flag(),
  1207.  
  1208. default = options.default or false,
  1209. folding = options.folding or false,
  1210. callback = options.callback or function() end,
  1211.  
  1212. items = {};
  1213. }
  1214.  
  1215. flags[cfg.flag] = cfg.default
  1216.  
  1217. local items = cfg.items; do
  1218. items[ "object" ] = library:create( "TextButton" , {
  1219. FontFace = fonts.main;
  1220. TextColor3 = rgb(0, 0, 0);
  1221. BorderColor3 = rgb(0, 0, 0);
  1222. Text = "";
  1223. Parent = self.items[ "elements" ];
  1224. BackgroundTransparency = 1;
  1225. Name = "\0";
  1226. Size = dim2(1, 0, 0, 22);
  1227. BorderSizePixel = 0;
  1228. TextSize = 9;
  1229. BackgroundColor3 = rgb(255, 255, 255)
  1230. });
  1231.  
  1232. items[ "title" ] = library:create( "TextLabel" , {
  1233. FontFace = fonts.main;
  1234. TextColor3 = rgb(255, 255, 255);
  1235. BorderColor3 = rgb(0, 0, 0);
  1236. Text = cfg.name;
  1237. TextStrokeTransparency = 0;
  1238. Parent = items[ "object" ];
  1239. Name = "\0";
  1240. BackgroundTransparency = 1;
  1241. TextXAlignment = Enum.TextXAlignment.Left;
  1242. Size = dim2(1, 0, 0, 11);
  1243. BorderSizePixel = 0;
  1244. TextSize = 9;
  1245. BackgroundColor3 = rgb(255, 255, 255)
  1246. });
  1247.  
  1248. items[ "info" ] = library:create( "TextLabel" , {
  1249. TextWrapped = true;
  1250. Parent = items[ "object" ];
  1251. TextColor3 = rgb(68, 68, 70);
  1252. BorderColor3 = rgb(0, 0, 0);
  1253. Text = cfg.info;
  1254. Name = "\0";
  1255. TextStrokeTransparency = 0;
  1256. Size = dim2(1, 0, 0, 11);
  1257. Position = dim2(0, 0, 0, 13);
  1258. BackgroundTransparency = 1;
  1259. TextXAlignment = Enum.TextXAlignment.Left;
  1260. BorderSizePixel = 0;
  1261. FontFace = fonts.main;
  1262. TextSize = 9;
  1263. BackgroundColor3 = rgb(255, 255, 255)
  1264. });
  1265.  
  1266. items[ "toggle_holder" ] = library:create( "Frame" , {
  1267. AnchorPoint = vec2(1, 0);
  1268. Parent = items[ "object" ];
  1269. Name = "\0";
  1270. Position = dim2(1, 0, 0, 5);
  1271. BorderColor3 = rgb(0, 0, 0);
  1272. Size = dim2(0, 34, 0, 20);
  1273. BorderSizePixel = 0;
  1274. BackgroundColor3 = rgb(18, 18, 20)
  1275. });
  1276.  
  1277. library:create( "UICorner" , {
  1278. Parent = items[ "toggle_holder" ];
  1279. CornerRadius = dim(0, 99)
  1280. });
  1281.  
  1282. items[ "circle" ] = library:create( "Frame" , {
  1283. Parent = items[ "toggle_holder" ];
  1284. Name = "\0";
  1285. Position = dim2(0, 2, 0, 2);
  1286. BorderColor3 = rgb(0, 0, 0);
  1287. Size = dim2(0, 16, 0, 16);
  1288. BorderSizePixel = 0;
  1289. BackgroundColor3 = rgb(68, 68, 70)
  1290. }); library:apply_theme(items[ "circle" ], "accent", "BackgroundColor3")
  1291.  
  1292. library:create( "UICorner" , {
  1293. Parent = items[ "circle" ];
  1294. CornerRadius = dim(0, 99)
  1295. });
  1296. end;
  1297.  
  1298. function cfg.set(bool)
  1299. items[ "circle" ].BackgroundColor3 = bool and themes.preset.accent or rgb(68, 68, 70)
  1300. items[ "circle" ].Position = bool and dim_offset(15, 2) or dim_offset(2, 2)
  1301.  
  1302. cfg.callback(bool)
  1303.  
  1304. flags[cfg.flag] = bool
  1305. end
  1306.  
  1307. items[ "object" ].MouseButton1Click:Connect(function()
  1308. cfg.enabled = not cfg.enabled
  1309.  
  1310. cfg.set(cfg.enabled)
  1311. end)
  1312.  
  1313. cfg.set(cfg.default)
  1314. config_flags[cfg.flag] = cfg.set
  1315.  
  1316. return setmetatable(cfg, library)
  1317. end
  1318.  
  1319. function library:slider(options)
  1320. local cfg = {
  1321. name = options.name or nil,
  1322. suffix = options.suffix or "",
  1323. flag = options.flag or library:next_flag(),
  1324. callback = options.callback or function() end,
  1325.  
  1326. -- value settings
  1327. min = options.min or options.minimum or 0,
  1328. max = options.max or options.maximum or 100,
  1329. intervals = options.interval or options.decimal or 1,
  1330. default = options.default or 10,
  1331. value = options.default or 10,
  1332.  
  1333. dragging = false,
  1334. items = {}
  1335. }
  1336.  
  1337. flags[cfg.flag] = cfg.default
  1338.  
  1339. local items = cfg.items; do
  1340. items[ "object" ] = library:create( "TextLabel" , {
  1341. FontFace = fonts.main;
  1342. TextColor3 = rgb(0, 0, 0);
  1343. BorderColor3 = rgb(0, 0, 0);
  1344. Text = "";
  1345. Parent = self.items[ "elements" ];
  1346. Name = "\0";
  1347. BackgroundTransparency = 1;
  1348. Size = dim2(1, 0, 0, 28);
  1349. BorderSizePixel = 0;
  1350. AutomaticSize = Enum.AutomaticSize.Y;
  1351. TextSize = 9;
  1352. BackgroundColor3 = rgb(255, 255, 255)
  1353. });
  1354.  
  1355. items[ "title" ] = library:create( "TextLabel" , {
  1356. FontFace = fonts.main;
  1357. TextColor3 = rgb(255, 255, 255);
  1358. BorderColor3 = rgb(0, 0, 0);
  1359. Text = cfg.name;
  1360. TextStrokeTransparency = 0;
  1361. Parent = items[ "object" ];
  1362. Name = "\0";
  1363. BackgroundTransparency = 1;
  1364. TextXAlignment = Enum.TextXAlignment.Left;
  1365. Size = dim2(1, 0, 0, 11);
  1366. BorderSizePixel = 0;
  1367. TextSize = 9;
  1368. BackgroundColor3 = rgb(255, 255, 255)
  1369. });
  1370.  
  1371. items[ "slider" ] = library:create( "TextButton" , {
  1372. Parent = items[ "object" ];
  1373. Text = "";
  1374. AutoButtonColor = false;
  1375. Name = "\0";
  1376. Position = dim2(0, 0, 0, 22);
  1377. BorderColor3 = rgb(0, 0, 0);
  1378. Size = dim2(1, 0, 0, 6);
  1379. BorderSizePixel = 0;
  1380. BackgroundColor3 = rgb(33, 33, 33)
  1381. });
  1382.  
  1383. items[ "fill" ] = library:create( "Frame" , {
  1384. Name = "\0";
  1385. Parent = items[ "slider" ];
  1386. BorderColor3 = rgb(0, 0, 0);
  1387. Size = dim2(0.5, 0, 1, 0);
  1388. BorderSizePixel = 0;
  1389. BackgroundColor3 = themes.preset.accent
  1390. }); library:apply_theme(items[ "fill" ], "accent", "BackgroundColor3")
  1391.  
  1392. items[ "circle" ] = library:create( "Frame" , {
  1393. AnchorPoint = vec2(0.5, 0.5);
  1394. Parent = items[ "fill" ];
  1395. Name = "\0";
  1396. Position = dim2(1, 0, 0.5, 0);
  1397. BorderColor3 = rgb(0, 0, 0);
  1398. Size = dim2(0, 12, 0, 12);
  1399. BorderSizePixel = 0;
  1400. BackgroundColor3 = themes.preset.accent
  1401. }); library:apply_theme(items[ "circle" ], "accent", "BackgroundColor3")
  1402.  
  1403. library:create( "UICorner" , {
  1404. Parent = items[ "circle" ];
  1405. CornerRadius = dim(0, 99)
  1406. });
  1407.  
  1408. items[ "value" ] = library:create( "TextLabel" , {
  1409. FontFace = fonts.main;
  1410. TextColor3 = rgb(255, 255, 255);
  1411. BorderColor3 = rgb(0, 0, 0);
  1412. Text = "300 metres";
  1413. TextStrokeTransparency = 0;
  1414. Parent = items[ "object" ];
  1415. Name = "\0";
  1416. BackgroundTransparency = 1;
  1417. TextXAlignment = Enum.TextXAlignment.Right;
  1418. Size = dim2(1, 0, 0, 11);
  1419. BorderSizePixel = 0;
  1420. TextSize = 9;
  1421. BackgroundColor3 = rgb(255, 255, 255)
  1422. });
  1423. end
  1424.  
  1425. function cfg.set(value)
  1426. cfg.value = clamp(library:round(value, cfg.intervals), cfg.min, cfg.max)
  1427.  
  1428. items[ "fill" ].Size = dim2((cfg.value - cfg.min) / (cfg.max - cfg.min), 0, 1, 0)
  1429. items[ "value" ].Text = tostring(cfg.value) .. cfg.suffix
  1430.  
  1431. flags[cfg.flag] = cfg.value
  1432. cfg.callback(flags[cfg.flag])
  1433. end
  1434.  
  1435. items[ "slider" ].MouseButton1Down:Connect(function()
  1436. cfg.dragging = true
  1437. end)
  1438.  
  1439. library:connection(uis.InputChanged, function(input)
  1440. if cfg.dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  1441. local size_x = (input.Position.X - items[ "slider" ].AbsolutePosition.X) / items[ "slider" ].AbsoluteSize.X
  1442. local value = ((cfg.max - cfg.min) * size_x) + cfg.min
  1443.  
  1444. cfg.set(value)
  1445. end
  1446. end)
  1447.  
  1448. library:connection(uis.InputEnded, function(input)
  1449. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1450. cfg.dragging = false
  1451. end
  1452. end)
  1453.  
  1454. cfg.set(cfg.default)
  1455. config_flags[cfg.flag] = cfg.set
  1456.  
  1457. return setmetatable(cfg, library)
  1458. end
  1459.  
  1460. function library:dropdown(options)
  1461. local cfg = {
  1462. name = options.name or "Dropdown";
  1463. info = options.info or "";
  1464. flag = options.flag or library:next_flag();
  1465.  
  1466. options = options.items or {""};
  1467. callback = options.callback or function() end;
  1468. multi = options.multi or false;
  1469. scrolling = options.scrolling or false;
  1470.  
  1471. -- Ignore these
  1472. open = false;
  1473. option_instances = {};
  1474. multi_items = {};
  1475. ignore = options.ignore or false;
  1476. items = {};
  1477. }
  1478.  
  1479. cfg.default = options.default or (cfg.multi and {cfg.items[1]}) or cfg.items[1] or "None"
  1480. flags[cfg.flag] = cfg.default
  1481.  
  1482. local items = cfg.items; do
  1483. -- Element
  1484. items[ "object" ] = library:create( "TextLabel" , {
  1485. FontFace = fonts.main;
  1486. TextColor3 = rgb(0, 0, 0);
  1487. BorderColor3 = rgb(0, 0, 0);
  1488. Text = "";
  1489. Parent = self.items[ "elements" ];
  1490. BackgroundTransparency = 1;
  1491. Name = "\0";
  1492. Size = dim2(1, 0, 0, 25);
  1493. BorderSizePixel = 0;
  1494. TextSize = 9;
  1495. BackgroundColor3 = rgb(255, 255, 255)
  1496. });
  1497.  
  1498. items[ "title" ] = library:create( "TextLabel" , {
  1499. FontFace = fonts.main;
  1500. TextColor3 = rgb(237, 237, 237);
  1501. BorderColor3 = rgb(0, 0, 0);
  1502. Text = cfg.name;
  1503. Parent = items[ "object" ];
  1504. Name = "\0";
  1505. BackgroundTransparency = 1;
  1506. TextXAlignment = Enum.TextXAlignment.Left;
  1507. Size = dim2(1, 0, 0, 11);
  1508. BorderSizePixel = 0;
  1509. TextSize = 9;
  1510. BackgroundColor3 = rgb(255, 255, 255)
  1511. });
  1512.  
  1513. items[ "info" ] = library:create( "TextLabel" , {
  1514. FontFace = fonts.main;
  1515. TextColor3 = rgb(68, 68, 70);
  1516. BorderColor3 = rgb(0, 0, 0);
  1517. Text = cfg.info;
  1518. Parent = items[ "object" ];
  1519. Name = "\0";
  1520. Size = dim2(1, 0, 0, 11);
  1521. Position = dim2(0, 0, 0, 13);
  1522. BackgroundTransparency = 1;
  1523. TextXAlignment = Enum.TextXAlignment.Left;
  1524. BorderSizePixel = 0;
  1525. TextWrapped = true;
  1526. TextSize = 9;
  1527. BackgroundColor3 = rgb(255, 255, 255)
  1528. });
  1529.  
  1530. items[ "dropdown_holder" ] = library:create( "TextButton" , {
  1531. AnchorPoint = vec2(1, 0.5);
  1532. Parent = items[ "object" ];
  1533. Name = "\0";
  1534. Text = "";
  1535. AutoButtonColor = false;
  1536. Position = dim2(1, 0, 0.5, 0);
  1537. BorderColor3 = rgb(0, 0, 0);
  1538. Size = dim2(0, 85, 0, 18);
  1539. BorderSizePixel = 0;
  1540. BackgroundColor3 = rgb(18, 18, 20)
  1541. });
  1542.  
  1543. items[ "text_holder" ] = library:create( "TextButton" , {
  1544. Parent = items[ "dropdown_holder" ];
  1545. Name = "\0";
  1546. Text = "";
  1547. AutoButtonColor = false;
  1548. BorderColor3 = rgb(0, 0, 0);
  1549. Position = dim2(0, 1, 0, 1);
  1550. Size = dim2(1, -2, 1, -2);
  1551. BorderSizePixel = 0;
  1552. BackgroundColor3 = rgb(7, 7, 9);
  1553. });
  1554.  
  1555. library:create( "UICorner" , {
  1556. Parent = items[ "dropdown_holder" ];
  1557. CornerRadius = dim(0, 3)
  1558. });
  1559.  
  1560. library:create( "UICorner" , {
  1561. Parent = items[ "text_holder" ];
  1562. CornerRadius = dim(0, 3)
  1563. });
  1564.  
  1565. items[ "inner_text" ] = library:create( "TextLabel" , {
  1566. TextWrapped = true;
  1567. TextColor3 = rgb(255, 255, 255);
  1568. BorderColor3 = rgb(0, 0, 0);
  1569. Text = "RMB";
  1570. Parent = items[ "text_holder" ];
  1571. TextStrokeTransparency = 0;
  1572. Size = dim2(1, 0, 1, 0);
  1573. Position = dim2(0, 4, 0, 0);
  1574. BackgroundTransparency = 1;
  1575. TextXAlignment = Enum.TextXAlignment.Left;
  1576. BorderSizePixel = 0;
  1577. FontFace = fonts.main;
  1578. TextSize = 9;
  1579. BackgroundColor3 = rgb(255, 255, 255)
  1580. });
  1581.  
  1582. items[ "arrow" ] = library:create( "ImageLabel" , {
  1583. BorderColor3 = rgb(0, 0, 0);
  1584. Parent = items[ "text_holder" ];
  1585. AnchorPoint = vec2(1, 0.5);
  1586. Image = "rbxassetid://116451868004607";
  1587. BackgroundTransparency = 1;
  1588. Position = dim2(1, -10, 0.5, 0);
  1589. Name = "\0";
  1590. Size = dim2(0, 7, 0, 5);
  1591. BorderSizePixel = 0;
  1592. BackgroundColor3 = rgb(255, 255, 255)
  1593. });
  1594. --
  1595.  
  1596. -- Holder
  1597. items[ "holder" ] = library:create( "Frame" , {
  1598. Parent = library[ "items" ];
  1599. Size = dim2(0, 0, 0, 0);
  1600. Position = dim2(0, 0, 0, 0);
  1601. Visible = false;
  1602. BorderColor3 = rgb(0, 0, 0);
  1603. BorderSizePixel = 0;
  1604. AutomaticSize = Enum.AutomaticSize.XY;
  1605. BackgroundColor3 = rgb(7, 7, 9)
  1606. });
  1607.  
  1608. library:create( "UICorner" , {
  1609. Parent = items[ "holder" ];
  1610. CornerRadius = dim(0, 3)
  1611. });
  1612.  
  1613. library:create( "UIStroke" , {
  1614. Color = rgb(18, 18, 20);
  1615. Parent = items[ "holder" ]
  1616. });
  1617.  
  1618. library:create( "UIListLayout" , {
  1619. Parent = items[ "holder" ];
  1620. Padding = dim(0, 10);
  1621. SortOrder = Enum.SortOrder.LayoutOrder;
  1622. HorizontalFlex = Enum.UIFlexAlignment.Fill
  1623. });
  1624.  
  1625. library:create( "UIPadding" , {
  1626. PaddingTop = dim(0, 10);
  1627. PaddingBottom = dim(0, 10);
  1628. Parent = items[ "holder" ];
  1629. PaddingRight = dim(0, 10);
  1630. PaddingLeft = dim(0, 10)
  1631. });
  1632. --
  1633. end
  1634.  
  1635. function cfg.render_option(text)
  1636. local option = library:create( "TextButton" , {
  1637. TextColor3 = rgb(255, 255, 255);
  1638. BorderColor3 = rgb(0, 0, 0);
  1639. Text = text;
  1640. Parent = items[ "holder" ];
  1641. TextStrokeTransparency = 0;
  1642. Position = dim2(0, 4, 0, 0);
  1643. BorderSizePixel = 0;
  1644. BackgroundTransparency = 1;
  1645. TextXAlignment = Enum.TextXAlignment.Left;
  1646. FontFace = fonts.main;
  1647. AutomaticSize = Enum.AutomaticSize.XY;
  1648. TextSize = 9;
  1649. BackgroundColor3 = rgb(255, 255, 255)
  1650. }); library:apply_theme(option, "accent", "TextColor3");
  1651.  
  1652. return option
  1653. end
  1654.  
  1655. function cfg.set_visible(bool)
  1656. items[ "holder" ].Visible = bool
  1657. items[ "holder" ].Position = dim2(0, items[ "dropdown_holder" ].AbsolutePosition.X, 0, items[ "dropdown_holder" ].AbsolutePosition.Y + 85)
  1658.  
  1659. items[ "arrow" ].Rotation = bool and 180 or 0
  1660. end
  1661.  
  1662. function cfg.set(value)
  1663. local selected = {}
  1664. local isTable = type(value) == "table"
  1665.  
  1666. for _, option in next, cfg.option_instances do
  1667. if option.Text == value or (isTable and find(value, option.Text)) then
  1668. insert(selected, option.Text)
  1669. cfg.multi_items = selected
  1670. option.TextColor3 = themes.preset.accent
  1671. else
  1672. option.TextColor3 = themes.preset.text
  1673. end
  1674. end
  1675.  
  1676. items[ "inner_text" ].Text = if isTable then concat(selected, ", ") else selected[1] or ""
  1677. flags[cfg.flag] = if isTable then selected else selected[1]
  1678.  
  1679. cfg.callback(flags[cfg.flag])
  1680. end
  1681.  
  1682. function cfg.refresh_options(list)
  1683. for _, option in cfg.option_instances do
  1684. option:Destroy()
  1685. end
  1686.  
  1687. cfg.option_instances = {}
  1688.  
  1689. for _, option in list do
  1690. local button = cfg.render_option(option)
  1691.  
  1692. insert(cfg.option_instances, button)
  1693.  
  1694. button.MouseButton1Down:Connect(function()
  1695. if cfg.multi then
  1696. local selected_index = find(cfg.multi_items, button.Text)
  1697.  
  1698. if selected_index then
  1699. remove(cfg.multi_items, selected_index)
  1700. else
  1701. insert(cfg.multi_items, button.Text)
  1702. end
  1703.  
  1704. cfg.set(cfg.multi_items)
  1705. else
  1706. cfg.set_visible(false)
  1707. cfg.open = false
  1708.  
  1709. cfg.set(button.Text)
  1710. end
  1711. end)
  1712. end
  1713. end
  1714.  
  1715. items[ "text_holder" ].MouseButton1Click:Connect(function()
  1716. cfg.open = not cfg.open
  1717.  
  1718. cfg.set_visible(cfg.open)
  1719. end)
  1720.  
  1721. library:connection(uis.InputBegan, function(input)
  1722. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1723. if not (library:mouse_in_frame(items[ "text_holder" ]) or library:mouse_in_frame(items[ "holder" ])) then
  1724. cfg.open = false
  1725. cfg.set_visible(false)
  1726. end
  1727. end
  1728. end)
  1729.  
  1730. flags[cfg.flag] = {}
  1731. config_flags[cfg.flag] = cfg.set
  1732.  
  1733. cfg.refresh_options(cfg.options)
  1734. cfg.set(cfg.default)
  1735.  
  1736. return setmetatable(cfg, library)
  1737. end
  1738.  
  1739. function library:colorpicker(options)
  1740. local cfg = {
  1741. name = options.name or "Colorpicker",
  1742. info = options.info or "Info";
  1743. flag = options.flag or library:next_flag(),
  1744.  
  1745. color = options.color or color(1, 1, 1), -- Default to white color if not provided
  1746. alpha = options.alpha and 1 - options.alpha or 0,
  1747.  
  1748. open = false,
  1749. callback = options.callback or function() end,
  1750. items = {};
  1751. }
  1752.  
  1753. local dragging_sat = false
  1754. local dragging_hue = false
  1755. local dragging_alpha = false
  1756.  
  1757. local h, s, v = cfg.color:ToHSV()
  1758. local a = cfg.alpha
  1759.  
  1760. flags[cfg.flag] = {Color = cfg.color, Transparency = cfg.alpha}
  1761.  
  1762. local items = cfg.items; do
  1763. -- Component
  1764. items[ "object" ] = library:create( "TextLabel" , {
  1765. FontFace = fonts.main;
  1766. TextColor3 = rgb(0, 0, 0);
  1767. BorderColor3 = rgb(0, 0, 0);
  1768. Text = "";
  1769. Parent = self.items[ "elements" ];
  1770. Name = "\0";
  1771. BackgroundTransparency = 1;
  1772. Size = dim2(1, 0, 0, 22);
  1773. BorderSizePixel = 0;
  1774. AutomaticSize = Enum.AutomaticSize.Y;
  1775. TextSize = 9;
  1776. BackgroundColor3 = rgb(255, 255, 255)
  1777. });
  1778.  
  1779. items[ "title" ] = library:create( "TextLabel" , {
  1780. FontFace = fonts.main;
  1781. TextColor3 = rgb(255, 255, 255);
  1782. BorderColor3 = rgb(0, 0, 0);
  1783. Text = cfg.name;
  1784. TextStrokeTransparency = 0;
  1785. Parent = items[ "object" ];
  1786. Name = "\0";
  1787. BackgroundTransparency = 1;
  1788. TextXAlignment = Enum.TextXAlignment.Left;
  1789. Size = dim2(1, 0, 0, 11);
  1790. BorderSizePixel = 0;
  1791. TextSize = 9;
  1792. BackgroundColor3 = rgb(255, 255, 255)
  1793. });
  1794.  
  1795. items[ "info" ] = library:create( "TextLabel" , {
  1796. TextWrapped = true;
  1797. Parent = items[ "object" ];
  1798. TextColor3 = rgb(68, 68, 70);
  1799. BorderColor3 = rgb(0, 0, 0);
  1800. Text = cfg.info;
  1801. Name = "\0";
  1802. TextStrokeTransparency = 0;
  1803. Size = dim2(1, 0, 0, 11);
  1804. Position = dim2(0, 0, 0, 13);
  1805. BackgroundTransparency = 1;
  1806. TextXAlignment = Enum.TextXAlignment.Left;
  1807. BorderSizePixel = 0;
  1808. FontFace = fonts.main;
  1809. TextSize = 9;
  1810. BackgroundColor3 = rgb(255, 255, 255)
  1811. });
  1812.  
  1813. items[ "colorpicker" ] = library:create( "TextButton" , {
  1814. AnchorPoint = vec2(1, 0);
  1815. Parent = items[ "object" ];
  1816. Text = "";
  1817. AutoButtonColor = false;
  1818. Name = "\0";
  1819. Position = dim2(1, 0, 0, 5);
  1820. BorderColor3 = rgb(0, 0, 0);
  1821. Size = dim2(0, 16, 0, 16);
  1822. BorderSizePixel = 0;
  1823. BackgroundColor3 = rgb(132, 135, 250)
  1824. });
  1825.  
  1826. library:create( "UICorner" , {
  1827. Parent = items[ "colorpicker" ];
  1828. CornerRadius = dim(0, 3)
  1829. });
  1830. --
  1831.  
  1832. -- Colorpicker
  1833. items[ "colorpicker_holder" ] = library:create( "Frame" , {
  1834. Parent = library[ "items" ];
  1835. Size = dim2(0, 180, 0, 180);
  1836. Name = "\0";
  1837. Visible = false;
  1838. BorderColor3 = rgb(0, 0, 0);
  1839. ZIndex = 100;
  1840. BorderSizePixel = 0;
  1841. BackgroundColor3 = rgb(0, 0, 0)
  1842. });
  1843.  
  1844. library:create( "UICorner" , {
  1845. Parent = items[ "colorpicker_holder" ];
  1846. CornerRadius = dim(0, 4)
  1847. });
  1848.  
  1849. items[ "colorpicker_inline" ] = library:create( "Frame" , {
  1850. Parent = items[ "colorpicker_holder" ];
  1851. Size = dim2(1, -2, 1, -2);
  1852. Name = "\0";
  1853. ClipsDescendants = true;
  1854. BorderColor3 = rgb(0, 0, 0);
  1855. Position = dim2(0, 1, 0, 1);
  1856. BorderSizePixel = 0;
  1857. BackgroundColor3 = rgb(32, 32, 32)
  1858. });
  1859.  
  1860. library:create( "UICorner" , {
  1861. Parent = items[ "colorpicker_inline" ];
  1862. CornerRadius = dim(0, 4)
  1863. });
  1864.  
  1865. items[ "colorpicker_background" ] = library:create( "Frame" , {
  1866. Parent = items[ "colorpicker_inline" ];
  1867. Size = dim2(1, -2, 1, -2);
  1868. Name = "\0";
  1869. ClipsDescendants = true;
  1870. BorderColor3 = rgb(0, 0, 0);
  1871. Position = dim2(0, 1, 0, 1);
  1872. BorderSizePixel = 0;
  1873. BackgroundColor3 = rgb(8, 8, 8)
  1874. });
  1875.  
  1876. library:create( "UICorner" , {
  1877. Parent = items[ "colorpicker_background" ];
  1878. CornerRadius = dim(0, 4)
  1879. });
  1880.  
  1881. library:create( "UIPadding" , {
  1882. PaddingTop = dim(0, 5);
  1883. PaddingBottom = dim(0, 5);
  1884. Parent = items[ "colorpicker_background" ];
  1885. PaddingRight = dim(0, 5);
  1886. PaddingLeft = dim(0, 5)
  1887. });
  1888.  
  1889. items[ "saturation_outline" ] = library:create( "Frame" , {
  1890. Name = "\0";
  1891. Parent = items[ "colorpicker_background" ];
  1892. BorderColor3 = rgb(0, 0, 0);
  1893. Size = dim2(1, -12, 1, -12);
  1894. BorderSizePixel = 0;
  1895. BackgroundColor3 = rgb(0, 0, 0)
  1896. });
  1897.  
  1898. items[ "color_saturation" ] = library:create( "TextButton" , {
  1899. Parent = items[ "saturation_outline" ];
  1900. AutoButtonColor = false;
  1901. Text = "";
  1902. Name = "\0";
  1903. Position = dim2(0, 1, 0, 1);
  1904. BorderColor3 = rgb(0, 0, 0);
  1905. Size = dim2(1, -2, 1, -2);
  1906. BorderSizePixel = 0;
  1907. BackgroundColor3 = rgb(255, 39, 39)
  1908. });
  1909.  
  1910. items[ "sat" ] = library:create( "Frame" , {
  1911. Parent = items[ "color_saturation" ];
  1912. Name = "\0";
  1913. Size = dim2(1, 0, 1, 0);
  1914. BorderColor3 = rgb(0, 0, 0);
  1915. ZIndex = 2;
  1916. BorderSizePixel = 0;
  1917. BackgroundColor3 = rgb(255, 255, 255)
  1918. });
  1919.  
  1920. library:create( "UIGradient" , {
  1921. Rotation = 270;
  1922. Transparency = numseq{numkey(0, 0), numkey(1, 1)};
  1923. Parent = items[ "sat" ];
  1924. Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(0, 0, 0))}
  1925. });
  1926.  
  1927. items[ "satval_picker" ] = library:create( "Frame" , {
  1928. Parent = items[ "color_saturation" ];
  1929. Size = dim2(0, 3, 0, 3);
  1930. Name = "\0";
  1931. Position = dim2(0, 1, 0.5, 1);
  1932. BorderColor3 = rgb(0, 0, 0);
  1933. ZIndex = 4;
  1934. BorderSizePixel = 0;
  1935. BackgroundColor3 = rgb(0, 0, 0)
  1936. });
  1937.  
  1938. library:create( "Frame" , {
  1939. Parent = items[ "satval_picker" ];
  1940. Size = dim2(1, -2, 1, -2);
  1941. Name = "\0";
  1942. Position = dim2(0, 1, 0, 1);
  1943. BorderColor3 = rgb(0, 0, 0);
  1944. ZIndex = 2;
  1945. BorderSizePixel = 0;
  1946. BackgroundColor3 = rgb(255, 255, 255)
  1947. });
  1948.  
  1949. items[ "val" ] = library:create( "Frame" , {
  1950. Name = "\0";
  1951. Parent = items[ "color_saturation" ];
  1952. BorderColor3 = rgb(0, 0, 0);
  1953. Size = dim2(1, 0, 1, 0);
  1954. BorderSizePixel = 0;
  1955. BackgroundColor3 = rgb(255, 255, 255)
  1956. });
  1957.  
  1958. library:create( "UIGradient" , {
  1959. Parent = items[ "val" ];
  1960. Transparency = numseq{numkey(0, 0), numkey(1, 1)}
  1961. });
  1962.  
  1963. items[ "hue_slider" ] = library:create( "TextButton" , {
  1964. Parent = items[ "colorpicker_background" ];
  1965. Text = "";
  1966. AutoButtonColor = false;
  1967. Name = "\0";
  1968. Position = dim2(1, -10, 0, 0);
  1969. BorderColor3 = rgb(0, 0, 0);
  1970. Size = dim2(0, 10, 1, -12);
  1971. BorderSizePixel = 0;
  1972. BackgroundColor3 = rgb(0, 0, 0)
  1973. });
  1974.  
  1975. items[ "hue_components" ] = library:create( "Frame" , {
  1976. Parent = items[ "hue_slider" ];
  1977. Name = "\0";
  1978. Position = dim2(0, 1, 0, 1);
  1979. BorderColor3 = rgb(0, 0, 0);
  1980. Size = dim2(1, -2, 1, -2);
  1981. BorderSizePixel = 0;
  1982. BackgroundColor3 = rgb(255, 255, 255)
  1983. });
  1984.  
  1985. library:create( "UIGradient" , {
  1986. Rotation = 270;
  1987. Parent = items[ "hue_components" ];
  1988. Color = rgbseq{rgbkey(0, rgb(255, 0, 0)), rgbkey(0.17, rgb(255, 255, 0)), rgbkey(0.33, rgb(0, 255, 0)), rgbkey(0.5, rgb(0, 255, 255)), rgbkey(0.67, rgb(0, 0, 255)), rgbkey(0.83, rgb(255, 0, 255)), rgbkey(1, rgb(255, 0, 0))}
  1989. });
  1990.  
  1991. items[ "hue_picker" ] = library:create( "Frame" , {
  1992. Parent = items[ "hue_components" ];
  1993. Size = dim2(1, 2, 0, 3);
  1994. Name = "\0";
  1995. Position = dim2(0, -1, 0, -1);
  1996. BorderColor3 = rgb(0, 0, 0);
  1997. ZIndex = 4;
  1998. BorderSizePixel = 0;
  1999. BackgroundColor3 = rgb(0, 0, 0)
  2000. });
  2001.  
  2002. library:create( "Frame" , {
  2003. Parent = items[ "hue_picker" ];
  2004. Size = dim2(1, -2, 1, -2);
  2005. Name = "\0";
  2006. Position = dim2(0, 1, 0, 1);
  2007. BorderColor3 = rgb(0, 0, 0);
  2008. ZIndex = 2;
  2009. BorderSizePixel = 0;
  2010. BackgroundColor3 = rgb(255, 255, 255)
  2011. });
  2012.  
  2013. items[ "alpha_slider" ] = library:create( "TextButton" , {
  2014. Parent = items[ "colorpicker_background" ];
  2015. Text = "";
  2016. AutoButtonColor = false;
  2017. Name = "\0";
  2018. Position = dim2(0, 0, 1, -10);
  2019. BorderColor3 = rgb(0, 0, 0);
  2020. Size = dim2(1, -12, 0, 10);
  2021. BorderSizePixel = 0;
  2022. BackgroundColor3 = rgb(0, 0, 0)
  2023. });
  2024.  
  2025. items[ "alpha_components" ] = library:create( "Frame" , {
  2026. Parent = items[ "alpha_slider" ];
  2027. Name = "\0";
  2028. Position = dim2(0, 1, 0, 1);
  2029. BorderColor3 = rgb(0, 0, 0);
  2030. Size = dim2(1, -2, 1, -2);
  2031. BorderSizePixel = 0;
  2032. BackgroundColor3 = rgb(255, 255, 255)
  2033. });
  2034.  
  2035. library:create( "UIGradient" , {
  2036. Color = rgbseq{rgbkey(0, rgb(0, 0, 0)), rgbkey(1, rgb(255, 255, 255))};
  2037. Parent = items[ "alpha_components" ]
  2038. });
  2039.  
  2040. items[ "alpha_picker" ] = library:create( "Frame" , {
  2041. Parent = items[ "alpha_components" ];
  2042. Size = dim2(0, 3, 1, 2);
  2043. Name = "\0";
  2044. Position = dim2(0, -1, 0, -1);
  2045. BorderColor3 = rgb(0, 0, 0);
  2046. ZIndex = 4;
  2047. BorderSizePixel = 0;
  2048. BackgroundColor3 = rgb(0, 0, 0)
  2049. });
  2050.  
  2051. library:create( "Frame" , {
  2052. Parent = items[ "alpha_picker" ];
  2053. Size = dim2(1, -2, 1, -2);
  2054. Name = "\0";
  2055. Position = dim2(0, 1, 0, 1);
  2056. BorderColor3 = rgb(0, 0, 0);
  2057. ZIndex = 2;
  2058. BorderSizePixel = 0;
  2059. BackgroundColor3 = rgb(255, 255, 255)
  2060. });
  2061.  
  2062.  
  2063. --
  2064. end;
  2065.  
  2066. function cfg.set_visible(bool)
  2067. items[ "colorpicker_holder" ].Visible = bool
  2068. items[ "colorpicker_holder" ].Position = dim_offset(items[ "colorpicker" ].AbsolutePosition.X, items[ "colorpicker" ].AbsolutePosition.Y + items[ "colorpicker" ].AbsoluteSize.Y + 65)
  2069. end
  2070.  
  2071. function cfg.set(color, alpha)
  2072. if color then
  2073. h, s, v = color:ToHSV()
  2074. end
  2075.  
  2076. if alpha then
  2077. a = alpha
  2078. end
  2079.  
  2080. local Color = Color3.fromHSV(h, s, v)
  2081.  
  2082. items[ "hue_picker" ].Position = dim2(0, -1, 1 - h, -1)
  2083. items[ "alpha_picker" ].Position = dim2(1 - a, -1, 0, -1)
  2084. items[ "satval_picker" ].Position = dim2(s, -1, 1 - v, -1)
  2085.  
  2086. items[ "colorpicker" ].BackgroundColor3 = Color
  2087. items[ "color_saturation" ].BackgroundColor3 = Color3.fromHSV(h, 1, 1)
  2088.  
  2089. flags[cfg.flag] = {
  2090. Color = Color;
  2091. Transparency = a
  2092. }
  2093.  
  2094. cfg.callback(Color, a)
  2095. end
  2096.  
  2097. function cfg.update_color()
  2098. local mouse = uis:GetMouseLocation()
  2099. local offset = vec2(mouse.X, mouse.Y - gui_offset)
  2100.  
  2101. if dragging_sat then
  2102. s = math.clamp((offset - items["color_saturation"].AbsolutePosition).X / items["color_saturation"].AbsoluteSize.X, 0, 1)
  2103. v = 1 - math.clamp((offset - items["color_saturation"].AbsolutePosition).Y / items["color_saturation"].AbsoluteSize.Y, 0, 1)
  2104. elseif dragging_hue then
  2105. h = 1 - math.clamp((offset - items[ "hue_slider" ].AbsolutePosition).Y / items[ "hue_slider" ].AbsoluteSize.Y, 0, 1)
  2106. elseif dragging_alpha then
  2107. a = 1 - math.clamp((offset - items[ "alpha_slider" ].AbsolutePosition).X / items[ "alpha_slider" ].AbsoluteSize.X, 0, 1)
  2108. end
  2109.  
  2110. cfg.set(nil, nil)
  2111. end
  2112.  
  2113. items[ "colorpicker" ].MouseButton1Click:Connect(function()
  2114. cfg.open = not cfg.open
  2115.  
  2116. cfg.set_visible(cfg.open)
  2117. end)
  2118.  
  2119. uis.InputChanged:Connect(function(input)
  2120. if (dragging_sat or dragging_hue or dragging_alpha) and input.UserInputType == Enum.UserInputType.MouseMovement then
  2121. cfg.update_color()
  2122. end
  2123. end)
  2124.  
  2125. library:connection(uis.InputEnded, function(input)
  2126. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2127. dragging_sat = false
  2128. dragging_hue = false
  2129. dragging_alpha = false
  2130.  
  2131. if not (library:mouse_in_frame(items[ "colorpicker" ]) or library:mouse_in_frame(items[ "colorpicker_holder" ])) then
  2132. cfg.open = false
  2133. cfg.set_visible(false)
  2134. end
  2135. end
  2136. end)
  2137.  
  2138. library:connection(uis.InputBegan, function(input)
  2139. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2140. if not (library:mouse_in_frame(items[ "colorpicker" ]) or library:mouse_in_frame(items[ "colorpicker_holder" ])) then
  2141. cfg.open = false
  2142. cfg.set_visible(false)
  2143. end
  2144. end
  2145. end)
  2146.  
  2147. items[ "alpha_slider" ].MouseButton1Down:Connect(function()
  2148. dragging_alpha = true
  2149. end)
  2150.  
  2151. items[ "hue_slider" ].MouseButton1Down:Connect(function()
  2152. dragging_hue = true
  2153. end)
  2154.  
  2155. items[ "color_saturation" ].MouseButton1Down:Connect(function()
  2156. dragging_sat = true
  2157. end)
  2158.  
  2159. cfg.set(cfg.color, cfg.alpha)
  2160. config_flags[cfg.flag] = cfg.set
  2161.  
  2162. return setmetatable(cfg, library)
  2163. end
  2164.  
  2165. function library:textbox(options)
  2166. local cfg = {
  2167. name = options.name or "TextBox",
  2168. placeholder = options.placeholder or options.placeholdertext or options.holder or options.holdertext or "type here...",
  2169. default = options.default or "",
  2170. flag = options.flag or library:next_flag(),
  2171. callback = options.callback or function() end,
  2172. visible = options.visible or true,
  2173. items = {};
  2174. }
  2175.  
  2176. flags[cfg.flag] = cfg.default
  2177.  
  2178. local items = cfg.items; do
  2179. items[ "object" ] = library:create( "TextLabel" , {
  2180. FontFace = fonts.main;
  2181. TextColor3 = rgb(0, 0, 0);
  2182. BorderColor3 = rgb(0, 0, 0);
  2183. Text = "";
  2184. Parent = self.items[ "elements" ];
  2185. Name = "\0";
  2186. BackgroundTransparency = 1;
  2187. Size = dim2(1, 0, 0, 28);
  2188. BorderSizePixel = 0;
  2189. AutomaticSize = Enum.AutomaticSize.Y;
  2190. TextSize = 9;
  2191. BackgroundColor3 = rgb(255, 255, 255)
  2192. });
  2193.  
  2194. items[ "holder" ] = library:create( "Frame" , {
  2195. AnchorPoint = vec2(1, 0.5);
  2196. Parent = items[ "object" ];
  2197. Name = "\0";
  2198. Position = dim2(1, 0, 0.5, 10);
  2199. BorderColor3 = rgb(0, 0, 0);
  2200. Size = dim2(1, 0, 0, 22);
  2201. BorderSizePixel = 0;
  2202. BackgroundColor3 = rgb(7, 7, 9)
  2203. });
  2204.  
  2205. library:create( "UICorner" , {
  2206. Parent = items[ "holder" ];
  2207. CornerRadius = dim(0, 3)
  2208. });
  2209.  
  2210. library:create( "UIStroke" , {
  2211. Color = rgb(18, 18, 20);
  2212. Parent = items[ "holder" ]
  2213. });
  2214.  
  2215. items[ "title" ] = library:create( "TextLabel" , {
  2216. FontFace = fonts.main;
  2217. TextColor3 = rgb(255, 255, 255);
  2218. BorderColor3 = rgb(0, 0, 0);
  2219. Text = cfg.name;
  2220. Parent = items[ "object" ];
  2221. TextStrokeTransparency = 0;
  2222. Name = "\0";
  2223. Size = dim2(1, 0, 0, 0);
  2224. BackgroundTransparency = 1;
  2225. TextXAlignment = Enum.TextXAlignment.Left;
  2226. BorderSizePixel = 0;
  2227. AutomaticSize = Enum.AutomaticSize.Y;
  2228. TextSize = 9;
  2229. BackgroundColor3 = rgb(255, 255, 255)
  2230. });
  2231.  
  2232. items[ "input" ] = library:create( "TextBox" , {
  2233. FontFace = fonts.main;
  2234. TextColor3 = rgb(255, 255, 255);
  2235. BorderColor3 = rgb(0, 0, 0);
  2236. Text = "255";
  2237. Parent = items[ "holder" ];
  2238. Name = "\0";
  2239. Size = dim2(1, 0, 1, 0);
  2240. BorderSizePixel = 0;
  2241. BackgroundTransparency = 1;
  2242. PlaceholderColor3 = rgb(255, 255, 255);
  2243. CursorPosition = -1;
  2244. TextWrapped = true;
  2245. ClearTextOnFocus = false;
  2246. TextSize = 9;
  2247. BackgroundColor3 = rgb(255, 255, 255)
  2248. });
  2249. end
  2250.  
  2251. function cfg.set(text)
  2252. flags[cfg.flag] = text
  2253.  
  2254. items[ "input" ].Text = text
  2255.  
  2256. cfg.callback(text)
  2257. end
  2258.  
  2259. items[ "input" ]:GetPropertyChangedSignal("Text"):Connect(function()
  2260. cfg.set(items[ "input" ].Text)
  2261. end)
  2262.  
  2263. if cfg.default then
  2264. cfg.set(cfg.default)
  2265. end
  2266.  
  2267. config_flags[cfg.flag] = cfg.set
  2268.  
  2269. return setmetatable(cfg, library)
  2270. end
  2271.  
  2272. function library:keybind(options)
  2273. local cfg = {
  2274. flag = options.flag or library:next_flag(),
  2275. callback = options.callback or function() end,
  2276. name = options.name or "Keybind";
  2277. info = options.info or "";
  2278. ignore_key = options.ignore or false,
  2279.  
  2280. key = options.key or nil,
  2281. mode = options.mode or "Toggle",
  2282. active = options.default or false,
  2283.  
  2284. open = false,
  2285. binding = nil,
  2286.  
  2287. hold_instances = {},
  2288. items = {};
  2289. }
  2290.  
  2291. flags[cfg.flag] = {
  2292. mode = cfg.mode,
  2293. key = cfg.key,
  2294. active = cfg.active
  2295. }
  2296.  
  2297. local items = cfg.items; do
  2298. -- Component
  2299. items[ "object" ] = library:create( "TextLabel" , {
  2300. FontFace = fonts.main;
  2301. TextColor3 = rgb(0, 0, 0);
  2302. BorderColor3 = rgb(0, 0, 0);
  2303. Text = "";
  2304. Parent = self.items[ "elements" ];
  2305. BackgroundTransparency = 1;
  2306. Name = "\0";
  2307. Size = dim2(1, 0, 0, 25);
  2308. BorderSizePixel = 0;
  2309. TextSize = 9;
  2310. BackgroundColor3 = rgb(255, 255, 255)
  2311. });
  2312.  
  2313. items[ "title" ] = library:create( "TextLabel" , {
  2314. FontFace = fonts.main;
  2315. TextColor3 = rgb(237, 237, 237);
  2316. BorderColor3 = rgb(0, 0, 0);
  2317. Text = cfg.name;
  2318. Parent = items[ "object" ];
  2319. Name = "\0";
  2320. BackgroundTransparency = 1;
  2321. TextXAlignment = Enum.TextXAlignment.Left;
  2322. Size = dim2(1, 0, 0, 11);
  2323. BorderSizePixel = 0;
  2324. TextSize = 9;
  2325. BackgroundColor3 = rgb(255, 255, 255)
  2326. });
  2327.  
  2328. items[ "info" ] = library:create( "TextLabel" , {
  2329. FontFace = fonts.main;
  2330. TextColor3 = rgb(68, 68, 70);
  2331. BorderColor3 = rgb(0, 0, 0);
  2332. Text = cfg.info;
  2333. Parent = items[ "object" ];
  2334. Name = "\0";
  2335. Size = dim2(1, 0, 0, 11);
  2336. Position = dim2(0, 0, 0, 13);
  2337. BackgroundTransparency = 1;
  2338. TextXAlignment = Enum.TextXAlignment.Left;
  2339. BorderSizePixel = 0;
  2340. TextWrapped = true;
  2341. TextSize = 9;
  2342. BackgroundColor3 = rgb(255, 255, 255)
  2343. });
  2344.  
  2345. items[ "filler" ] = library:create( "Frame" , {
  2346. AnchorPoint = vec2(1, 0.5);
  2347. Parent = items[ "object" ];
  2348. Name = "\0";
  2349. Position = dim2(1, 0, 0.5, 0);
  2350. BorderColor3 = rgb(0, 0, 0);
  2351. Size = dim2(0, 46, 0, 19);
  2352. BorderSizePixel = 0;
  2353. BackgroundColor3 = rgb(7, 7, 9)
  2354. });
  2355.  
  2356. items[ "keybinds" ] = library:create( "TextButton" , {
  2357. AnchorPoint = vec2(1, 0.5);
  2358. Text = "";
  2359. Parent = items[ "object" ];
  2360. Name = "\0";
  2361. Position = dim2(1, 0, 0.5, 0);
  2362. BorderColor3 = rgb(0, 0, 0);
  2363. Size = dim2(0, 46, 0, 19);
  2364. BorderSizePixel = 0;
  2365. AutoButtonColor = false;
  2366. BackgroundTransparency = 1;
  2367. BackgroundColor3 = rgb(7, 7, 9)
  2368. });
  2369.  
  2370. library:create( "UICorner" , {
  2371. Parent = items[ "filler" ];
  2372. CornerRadius = dim(0, 3)
  2373. });
  2374.  
  2375. items[ "name" ] = library:create( "TextLabel" , {
  2376. TextWrapped = true;
  2377. TextColor3 = rgb(255, 255, 255);
  2378. BorderColor3 = rgb(0, 0, 0);
  2379. Text = "RMB";
  2380. TextStrokeTransparency = 0;
  2381. Parent = items[ "keybinds" ];
  2382. Name = "\0";
  2383. BackgroundTransparency = 1;
  2384. Size = dim2(1, 0, 1, 0);
  2385. BorderSizePixel = 0;
  2386. FontFace = fonts.main;
  2387. TextSize = 9;
  2388. BackgroundColor3 = rgb(255, 255, 255)
  2389. });
  2390.  
  2391. library:create( "UIStroke" , {
  2392. Color = rgb(18, 18, 20);
  2393. Parent = items[ "filler" ]
  2394. });
  2395. --
  2396.  
  2397. -- Mode Holder
  2398. items[ "element" ] = library:create( "Frame" , {
  2399. BorderColor3 = rgb(0, 0, 0);
  2400. AnchorPoint = vec2(1, 0.5);
  2401. Parent = library[ "items" ];
  2402. Name = "\0";
  2403. Visible = false;
  2404. Position = dim2(1, 0, 0.5, 0);
  2405. Size = dim2(0, 0, 0, 0);
  2406. BorderSizePixel = 0;
  2407. AutomaticSize = Enum.AutomaticSize.XY;
  2408. BackgroundColor3 = rgb(7, 7, 9)
  2409. });
  2410.  
  2411. library:create( "UICorner" , {
  2412. Parent = items[ "element" ];
  2413. CornerRadius = dim(0, 3)
  2414. });
  2415.  
  2416. library:create( "UIStroke" , {
  2417. Color = rgb(18, 18, 20);
  2418. Parent = items[ "element" ]
  2419. });
  2420.  
  2421. library:create( "UIListLayout" , {
  2422. Parent = items[ "element" ];
  2423. Padding = dim(0, 10);
  2424. SortOrder = Enum.SortOrder.LayoutOrder;
  2425. HorizontalFlex = Enum.UIFlexAlignment.Fill
  2426. });
  2427.  
  2428. library:create( "UIPadding" , {
  2429. PaddingTop = dim(0, 10);
  2430. PaddingBottom = dim(0, 10);
  2431. Parent = items[ "element" ];
  2432. PaddingRight = dim(0, 10);
  2433. PaddingLeft = dim(0, 10)
  2434. });
  2435.  
  2436. local options = {"Hold", "Toggle", "Always"}
  2437.  
  2438. for _, option in options do
  2439. local name = library:create( "TextButton" , {
  2440. TextWrapped = true;
  2441. TextColor3 = rgb(255, 255, 255);
  2442. BorderColor3 = rgb(0, 0, 0);
  2443. Text = option;
  2444. Parent = items[ "element" ];
  2445. TextStrokeTransparency = 0;
  2446. Position = dim2(0, 4, 0, 0);
  2447. BorderSizePixel = 0;
  2448. BackgroundTransparency = 1;
  2449. TextXAlignment = Enum.TextXAlignment.Left;
  2450. FontFace = fonts.main;
  2451. AutomaticSize = Enum.AutomaticSize.XY;
  2452. TextSize = 9;
  2453. BackgroundColor3 = rgb(255, 255, 255)
  2454. }); cfg.hold_instances[option] = name
  2455. library:apply_theme(name, "accent", "TextColor3")
  2456.  
  2457. name.MouseButton1Click:Connect(function()
  2458. cfg.set(option)
  2459.  
  2460. cfg.set_visible(false)
  2461.  
  2462. cfg.open = false
  2463. end)
  2464. end
  2465. --
  2466.  
  2467. -- Keybind list text
  2468. if not cfg.ignore_key then
  2469. items[ "keybind_list_text" ] = library:create("TextLabel", {
  2470. FontFace = fonts.main;
  2471. TextColor3 = rgb(255, 255, 255);
  2472. BorderColor3 = rgb(0, 0, 0);
  2473. Text = "[ M ] triggerbot: always";
  2474. Parent = library.keybind_list;
  2475. AutomaticSize = Enum.AutomaticSize.XY;
  2476. Position = dim2(0, 18, 0, -3);
  2477. BackgroundTransparency = 1;
  2478. TextXAlignment = Enum.TextXAlignment.Left;
  2479. BorderSizePixel = 0;
  2480. ZIndex = 2;
  2481. TextStrokeTransparency = 0;
  2482. TextSize = 9;
  2483. BackgroundColor3 = rgb(255, 255, 255)
  2484. });
  2485. end
  2486. --
  2487. end
  2488.  
  2489. function cfg.modify_mode_color(path) -- ts so frikin tuff 💀
  2490. for _, v in cfg.hold_instances do
  2491. v.TextColor3 = themes.preset.text
  2492. end
  2493.  
  2494. cfg.hold_instances[path].TextColor3 = themes.preset.accent
  2495. end
  2496.  
  2497. function cfg.set_mode(mode)
  2498. cfg.mode = mode
  2499.  
  2500. if mode == "Always" then
  2501. cfg.set(true)
  2502. elseif mode == "Hold" then
  2503. cfg.set(false)
  2504. end
  2505.  
  2506. flags[cfg.flag]["mode"] = mode
  2507. cfg.modify_mode_color(mode)
  2508. end
  2509.  
  2510. function cfg.set(input)
  2511. if type(input) == "boolean" then
  2512. cfg.active = input
  2513.  
  2514. if cfg.mode == "Always" then
  2515. cfg.active = true
  2516. end
  2517. elseif tostring(input):find("Enum") then
  2518. input = input.Name == "Escape" and "NONE" or input
  2519.  
  2520. cfg.key = input or "NONE"
  2521. elseif find({"Toggle", "Hold", "Always"}, input) then
  2522. if input == "Always" then
  2523. cfg.active = true
  2524. end
  2525.  
  2526. cfg.mode = input
  2527. cfg.set_mode(cfg.mode)
  2528. elseif type(input) == "table" then
  2529. input.key = type(input.key) == "string" and input.key ~= "NONE" and library:convert_enum(input.key) or input.key
  2530. input.key = input.key == Enum.KeyCode.Escape and "NONE" or input.key
  2531.  
  2532. cfg.key = input.key or "NONE"
  2533. cfg.mode = input.mode or "Toggle"
  2534.  
  2535. if input.active then
  2536. cfg.active = input.active
  2537. end
  2538.  
  2539. cfg.set_mode(cfg.mode)
  2540. end
  2541.  
  2542. cfg.callback(cfg.active)
  2543.  
  2544. local text = tostring(cfg.key) ~= "Enums" and (keys[cfg.key] or tostring(cfg.key):gsub("Enum.", "")) or nil
  2545. local __text = text and (tostring(text):gsub("KeyCode.", ""):gsub("UserInputType.", ""))
  2546.  
  2547. items[ "name" ].Text = __text
  2548.  
  2549. flags[cfg.flag] = {
  2550. mode = cfg.mode,
  2551. key = cfg.key,
  2552. active = cfg.active
  2553. }
  2554.  
  2555. if items[ "keybind_list_text" ] then
  2556. items[ "keybind_list_text" ].Text = "[ ".. __text .." ] ".. cfg.name .." : ".. string.lower(cfg.mode) .."";
  2557. items[ "keybind_list_text" ].Visible = cfg.active
  2558. end
  2559. end
  2560.  
  2561. function cfg.set_visible(bool)
  2562. items[ "element" ].Visible = bool
  2563. items[ "element" ].Position = dim_offset(items[ "keybinds" ].AbsolutePosition.X + items[ "element" ].AbsoluteSize.X, items[ "keybinds" ].AbsolutePosition.Y + items[ "keybinds" ].AbsoluteSize.Y + 95)
  2564. end
  2565.  
  2566. items[ "keybinds" ].MouseButton1Down:Connect(function()
  2567. task.wait()
  2568. items[ "name" ].Text = "..."
  2569.  
  2570. cfg.binding = library:connection(uis.InputBegan, function(keycode, game_event)
  2571. cfg.set(keycode.KeyCode ~= Enum.KeyCode.Unknown and keycode.KeyCode or keycode.UserInputType)
  2572.  
  2573. cfg.binding:Disconnect()
  2574. cfg.binding = nil
  2575. end)
  2576. end)
  2577.  
  2578. items[ "keybinds" ].MouseButton2Down:Connect(function()
  2579. cfg.open = not cfg.open
  2580.  
  2581. cfg.set_visible(cfg.open)
  2582. end)
  2583.  
  2584. library:connection(uis.InputBegan, function(input, game_event)
  2585. if not game_event then
  2586. local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType
  2587.  
  2588. if selected_key == cfg.key then
  2589. if cfg.mode == "Toggle" then
  2590. cfg.active = not cfg.active
  2591. cfg.set(cfg.active)
  2592. elseif cfg.mode == "Hold" then
  2593. cfg.set(true)
  2594. end
  2595. end
  2596. end
  2597.  
  2598. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2599. if not (library:mouse_in_frame(items[ "keybinds" ]) or library:mouse_in_frame(items[ "element" ])) then
  2600. cfg.open = false
  2601. cfg.set_visible(false)
  2602. end
  2603. end
  2604. end)
  2605.  
  2606. library:connection(uis.InputEnded, function(input, game_event)
  2607. if game_event then
  2608. return
  2609. end
  2610.  
  2611. local selected_key = input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode or input.UserInputType
  2612.  
  2613. if selected_key == cfg.key then
  2614. if cfg.mode == "Hold" then
  2615. cfg.set(false)
  2616. end
  2617. end
  2618. end)
  2619.  
  2620. cfg.set({mode = cfg.mode, active = cfg.active, key = cfg.key})
  2621. config_flags[cfg.flag] = cfg.set
  2622.  
  2623. return setmetatable(cfg, library)
  2624. end
  2625.  
  2626. function library:button(options)
  2627. local cfg = {
  2628. name = options.name or "TextBox",
  2629. callback = options.callback or function() end,
  2630. items = {};
  2631. }
  2632.  
  2633. local items = cfg.items; do
  2634. items[ "object" ] = library:create( "TextButton" , {
  2635. FontFace = fonts.main;
  2636. TextColor3 = rgb(0, 0, 0);
  2637. BorderColor3 = rgb(0, 0, 0);
  2638. Text = "";
  2639. Parent = self.items[ "elements" ];
  2640. BackgroundTransparency = 1;
  2641. Name = "\0";
  2642. Size = dim2(1, 0, 0, 22);
  2643. BorderSizePixel = 0;
  2644. TextSize = 9;
  2645. BackgroundColor3 = rgb(255, 255, 255)
  2646. });
  2647.  
  2648. items[ "button" ] = library:create( "Frame" , {
  2649. AnchorPoint = vec2(1, 0.5);
  2650. Parent = items[ "object" ];
  2651. Name = "\0";
  2652. Position = dim2(1, 0, 0.5, 0);
  2653. BorderColor3 = rgb(0, 0, 0);
  2654. Size = dim2(1, 0, 1, 0);
  2655. BorderSizePixel = 0;
  2656. BackgroundColor3 = rgb(7, 7, 9)
  2657. });
  2658.  
  2659. library:create( "UICorner" , {
  2660. Parent = items[ "button" ];
  2661. CornerRadius = dim(0, 3)
  2662. });
  2663.  
  2664. items[ "title" ] = library:create( "TextLabel" , {
  2665. TextWrapped = true;
  2666. TextColor3 = rgb(255, 255, 255);
  2667. BorderColor3 = rgb(0, 0, 0);
  2668. Text = cfg.name;
  2669. Parent = items[ "button" ];
  2670. TextStrokeTransparency = 0;
  2671. Name = "\0";
  2672. Size = dim2(1, 0, 1, 0);
  2673. BackgroundTransparency = 1;
  2674. Position = dim2(0, 4, 0, 0);
  2675. BorderSizePixel = 0;
  2676. FontFace = fonts.main;
  2677. TextSize = 9;
  2678. BackgroundColor3 = rgb(255, 255, 255)
  2679. });
  2680.  
  2681. library:create( "UIStroke" , {
  2682. Color = rgb(18, 18, 20);
  2683. Parent = items[ "button" ]
  2684. });
  2685. end
  2686.  
  2687. items[ "object" ].MouseButton1Click:Connect(function()
  2688. cfg.callback()
  2689. end)
  2690.  
  2691. return setmetatable(cfg, library)
  2692. end
  2693. --
  2694. --
  2695. --
  2696.  
  2697. -- Notification Library
  2698. local notifications = library.notifications
  2699.  
  2700. function notifications:refresh_notifs()
  2701. local yOffset = 50
  2702. for i, v in ipairs(notifications.notifs) do
  2703. local Position = vec2(20, yOffset)
  2704. tween_service:Create(v, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Position = dim_offset(Position.X, Position.Y)}):Play()
  2705. yOffset = yOffset + v.AbsoluteSize.Y + 10
  2706. end
  2707. end
  2708.  
  2709. function notifications:fade(path, is_fading)
  2710. local fading = is_fading and 1 or 0
  2711.  
  2712. tween_service:Create(path, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = fading}):Play()
  2713.  
  2714. for _, instance in path:GetDescendants() do
  2715. if instance:IsA("UIStroke") then
  2716. tween_service:Create(instance, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Transparency = fading}):Play()
  2717. elseif instance:IsA("TextLabel") then
  2718. tween_service:Create(instance, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {TextTransparency = fading}):Play()
  2719. elseif instance:IsA("Frame") then
  2720. tween_service:Create(instance, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {BackgroundTransparency = fading}):Play()
  2721. end
  2722. end
  2723. end
  2724.  
  2725. function notifications:create_notification(options)
  2726. local cfg = {
  2727. name = options.name or "💊 ECSTASY",
  2728. outline;
  2729. }
  2730.  
  2731. -- Instances
  2732. local outline = library:create("Frame", {
  2733. Parent = library[ "items" ];
  2734. Size = dim2(0, 0, 0, 0);
  2735. BorderColor3 = rgb(0, 0, 0);
  2736. BorderSizePixel = 0;
  2737. AutomaticSize = Enum.AutomaticSize.XY;
  2738. BackgroundColor3 = rgb(46, 46, 46)
  2739. });
  2740.  
  2741. local inline = library:create("Frame", {
  2742. Parent = outline;
  2743. Position = dim2(0, 1, 0, 1);
  2744. BorderColor3 = rgb(0, 0, 0);
  2745. BorderSizePixel = 0;
  2746. AutomaticSize = Enum.AutomaticSize.XY;
  2747. BackgroundColor3 = rgb(21, 21, 21)
  2748. });
  2749.  
  2750. local uigradient = library:create("UIGradient", {
  2751. Color = rgbseq{rgbkey(0, rgb(255, 0, 0)), rgbkey(0.17, rgb(255, 255, 0)), rgbkey(0.33, rgb(0, 255, 0)), rgbkey(0.5, rgb(0, 255, 255)), rgbkey(0.67, rgb(0, 0, 255)), rgbkey(0.83, rgb(255, 0, 255)), rgbkey(1, rgb(255, 0, 0))};
  2752. Transparency = numseq{numkey(0, -1), numkey(1, -1)};
  2753. Parent = menu_title
  2754. });
  2755.  
  2756. library:create("UIPadding", {
  2757. PaddingTop = dim(0, 7);
  2758. PaddingBottom = dim(0, 6);
  2759. Parent = inline;
  2760. PaddingRight = dim(0, 8);
  2761. PaddingLeft = dim(0, 4)
  2762. });
  2763.  
  2764. local misc_text = library:create("TextLabel", {
  2765. FontFace = fonts.main;
  2766. Parent = inline;
  2767. LineHeight = 1.75;
  2768. TextColor3 = rgb(255, 255, 255);
  2769. BorderColor3 = rgb(0, 0, 0);
  2770. Text = string.format(" 🔴 PARADOX | %s", cfg.name);
  2771. AutomaticSize = Enum.AutomaticSize.XY;
  2772. Size = dim2(1, -4, 1, 0);
  2773. Position = dim2(0, 4, 0, -2);
  2774. BackgroundTransparency = 1;
  2775. TextXAlignment = Enum.TextXAlignment.Left;
  2776. BorderSizePixel = 0;
  2777. ZIndex = 2;
  2778. TextSize = 9;
  2779. BackgroundColor3 = rgb(255, 255, 255)
  2780. });
  2781.  
  2782. library:create("UIPadding", {
  2783. PaddingBottom = dim(0, 1);
  2784. PaddingRight = dim(0, 1);
  2785. Parent = outline
  2786. });
  2787.  
  2788. local line = library:create( "Frame" , {
  2789. Parent = outline;
  2790. Name = "\0";
  2791. Position = dim2(0, 1, 1, -1);
  2792. BorderColor3 = rgb(0, 0, 0);
  2793. Size = dim2(0, 0, 0, 1);
  2794. BorderSizePixel = 0;
  2795. BackgroundColor3 = themes.preset.accent
  2796. });
  2797.  
  2798. local accent = library:create( "Frame" , {
  2799. Parent = outline;
  2800. Name = "\0";
  2801. Position = dim2(0, 1, 0, 1);
  2802. BorderColor3 = rgb(0, 0, 0);
  2803. Size = dim2(0, 1, 1, -1);
  2804. BorderSizePixel = 0;
  2805. BackgroundColor3 = themes.preset.accent
  2806. });
  2807. --
  2808.  
  2809. local index = #notifications.notifs + 1
  2810. notifications.notifs[index] = outline
  2811.  
  2812. notifications:refresh_notifs()
  2813. tween_service:Create(outline, TweenInfo.new(1, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {AnchorPoint = vec2(0, 0)}):Play()
  2814.  
  2815. notifications:fade(outline, false)
  2816.  
  2817. task.spawn(function()
  2818. tween_service:Create(line, TweenInfo.new(3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Size = dim2(1, -1, 0, 1)}):Play()
  2819. task.wait(5)
  2820. notifications.notifs[index] = nil
  2821. notifications:fade(outline, true)
  2822. task.wait(1)
  2823. outline:Destroy()
  2824. notifications:refresh_notifs()
  2825. end)
  2826. end
  2827. -- end of ui library
  2828.  
Add Comment
Please, Sign In to add comment