Advertisement
vxste

Untitled

Jul 14th, 2024 (edited)
3,087
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 145.91 KB | None | 0 0
  1. --[[
  2. Yun Founders: flash#9999, loris#9547, worldwide#0001 , Saul Goodman#2345
  3. Yun Devs: zomb#7741, nives#0001, loot#1337
  4. Special Thanks To: Qw#1549
  5. --]]
  6. function initLibrary()
  7. local folderName = "epic config folder"
  8.  
  9.  
  10. if not isfolder(folderName) then
  11. makefolder(folderName)
  12. end
  13.  
  14.  
  15. local gameConfigFolder = folderName .. "/" .. game.PlaceId
  16.  
  17.  
  18. if not isfolder(gameConfigFolder) then
  19. makefolder(gameConfigFolder)
  20. end
  21.  
  22.  
  23. local inputService = game:GetService("UserInputService")
  24. local tweenService = game:GetService("TweenService")
  25. local runService = game:GetService("RunService")
  26. local coreGui = game:GetService("CoreGui")
  27.  
  28.  
  29. local utility = {}
  30.  
  31.  
  32. function utility.create(class, properties)
  33. properties = properties or {}
  34.  
  35.  
  36. local obj = Instance.new(class)
  37.  
  38.  
  39. local forcedProperties = {
  40. AutoButtonColor = false
  41. }
  42.  
  43.  
  44. for prop, v in next, properties do
  45. obj[prop] = v
  46. end
  47.  
  48.  
  49. for prop, v in next, forcedProperties do
  50. pcall(function()
  51. obj[prop] = v
  52. end)
  53. end
  54.  
  55. return obj
  56. end
  57.  
  58.  
  59. function utility.change_color(color, amount)
  60. local r = math.clamp(math.floor(color.r * 255) + amount, 0, 255)
  61. local g = math.clamp(math.floor(color.g * 255) + amount, 0, 255)
  62. local b = math.clamp(math.floor(color.b * 255) + amount, 0, 255)
  63.  
  64.  
  65. return Color3.fromRGB(r, g, b)
  66. end
  67.  
  68.  
  69. function utility.get_rgb(color)
  70. local r = math.floor(color.r * 255)
  71. local g = math.floor(color.g * 255)
  72. local b = math.floor(color.b * 255)
  73.  
  74.  
  75. return r, g, b
  76. end
  77.  
  78.  
  79. function utility.tween(obj, info, properties, callback)
  80. local anim = tweenService:Create(obj, TweenInfo.new(unpack(info)), properties)
  81. anim:Play()
  82.  
  83.  
  84. if callback then
  85. anim.Completed:Connect(callback)
  86. end
  87. end
  88.  
  89.  
  90. function utility.drag(obj, dragSpeed)
  91. local start, objPosition, dragging
  92.  
  93.  
  94. obj.InputBegan:Connect(function(input)
  95. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  96. dragging = true
  97. start = input.Position
  98. objPosition = obj.Position
  99. end
  100. end)
  101.  
  102.  
  103. obj.InputEnded:Connect(function(input )
  104. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  105. dragging = false
  106. end
  107. end)
  108.  
  109.  
  110. inputService.InputChanged:Connect(function(input)
  111. if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
  112. utility.tween(obj, {dragSpeed}, {Position = UDim2.new(objPosition.X.Scale, objPosition.X.Offset + (input.Position - start).X, objPosition.Y.Scale, objPosition.Y.Offset + (input.Position - start).Y)})
  113. end
  114. end)
  115. end
  116.  
  117.  
  118. function utility.get_center(sizeX, sizeY)
  119. return UDim2.new(0.5, -(sizeX / 2), 0.5, -(sizeY / 2))
  120. end
  121.  
  122.  
  123. function utility.hex_to_rgb(hex)
  124. return Color3.fromRGB(tonumber("0x" .. hex:sub(2, 3)), tonumber("0x" .. hex:sub(4, 5)), tonumber("0x"..hex:sub(6, 7)))
  125. end
  126.  
  127.  
  128. function utility.rgb_to_hex(color)
  129. return string.format("#%02X%02X%02X", math.clamp(color.R * 255, 0, 255), math.clamp(color.G * 255, 0, 255), math.clamp(color.B * 255, 0, 255))
  130. end
  131.  
  132.  
  133. function utility.table(tbl)
  134. local oldtbl = tbl or {}
  135. local newtbl = {}
  136. local formattedtbl = {}
  137.  
  138.  
  139. for option, v in next, oldtbl do
  140. newtbl[option:lower()] = v
  141. end
  142.  
  143.  
  144. setmetatable(formattedtbl, {
  145. __newindex = function(t, k, v)
  146. rawset(newtbl, k:lower(), v)
  147. end,
  148. __index = function(t, k, v)
  149. return newtbl[k:lower()]
  150. end
  151. })
  152.  
  153.  
  154. return formattedtbl
  155. end
  156.  
  157.  
  158. local library = utility.table{
  159. flags = {},
  160. toggled = true,
  161. color = Color3.fromRGB(255, 0, 0),
  162. keybind = Enum.KeyCode.RightShift,
  163. dragSpeed = 0.1
  164. }
  165.  
  166.  
  167. local coloredGradients = {}
  168.  
  169.  
  170. function library:SetColor(color)
  171. for _, obj in next, coloredGradients do
  172. obj.Color = ColorSequence.new{
  173. ColorSequenceKeypoint.new(0, color),
  174. ColorSequenceKeypoint.new(1, utility.change_color(color, -49))
  175. }
  176. end
  177.  
  178.  
  179. library.color = color
  180. end
  181.  
  182.  
  183. local gui = utility.create("ScreenGui")
  184.  
  185.  
  186. inputService.InputBegan:Connect(function(input)
  187. if input.KeyCode == library.keybind then
  188. library.toggled = not library.toggled
  189. gui.Enabled = library.toggled
  190. end
  191. end)
  192.  
  193.  
  194. if syn and syn.protect_gui then
  195. syn.protect_gui(gui)
  196. end
  197.  
  198.  
  199. gui.Parent = coreGui
  200.  
  201.  
  202. local flags = {toggles = {}, boxes = {}, sliders = {}, dropdowns = {}, multidropdowns = {}, keybinds = {}, colorpickers = {}}
  203.  
  204.  
  205. function library:LoadConfig(file)
  206. local str = readfile(gameConfigFolder .. "/" .. file .. ".cfg")
  207. local tbl = loadstring(str)()
  208.  
  209. for flag, value in next, tbl.toggles do
  210. flags.toggles[flag](value)
  211. end
  212.  
  213.  
  214. for flag, value in next, tbl.boxes do
  215. flags.boxes[flag](value)
  216. end
  217.  
  218.  
  219. for flag, value in next, tbl.sliders do
  220. flags.sliders[flag](value)
  221. end
  222.  
  223.  
  224. for flag, value in next, tbl.dropdowns do
  225. flags.dropdowns[flag](value)
  226. end
  227.  
  228.  
  229. for flag, value in next, tbl.multidropdowns do
  230. flags.multidropdowns[flag](value)
  231. end
  232.  
  233.  
  234. for flag, value in next, tbl.keybinds do
  235. flags.keybinds[flag](value)
  236. end
  237.  
  238.  
  239. for flag, value in next, tbl.colorpickers do
  240. flags.colorpickers[flag](value)
  241. end
  242. end
  243.  
  244.  
  245. function library:SaveConfig(name)
  246. local configstr = "{toggles={"
  247. local count = 0
  248.  
  249.  
  250. for flag, _ in next, flags.toggles do
  251. count = count + 1
  252. configstr = configstr .. "['" .. flag .. "']=" .. tostring(library.flags[flag]) .. ","
  253. end
  254.  
  255.  
  256. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},boxes={"
  257.  
  258.  
  259. count = 0
  260. for flag, _ in next, flags.boxes do
  261. count = count + 1
  262. configstr = configstr .. "['" .. flag .. "']='" .. tostring(library.flags[flag]) .. "',"
  263. end
  264.  
  265.  
  266. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},sliders={"
  267.  
  268.  
  269. count = 0
  270. for flag, _ in next, flags.sliders do
  271. count = count + 1
  272. configstr = configstr .. "['" .. flag .. "']=" .. tostring(library.flags[flag]) .. ","
  273. end
  274.  
  275.  
  276. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},dropdowns={"
  277.  
  278.  
  279. count = 0
  280. for flag, _ in next, flags.dropdowns do
  281. count = count + 1
  282. configstr = configstr .. "['" .. flag .. "']='" .. tostring(library.flags[flag]) .. "',"
  283. end
  284.  
  285.  
  286. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},multidropdowns={"
  287.  
  288.  
  289. count = 0
  290. for flag, _ in next, flags.multidropdowns do
  291. count = count + 1
  292. configstr = configstr .. "['" .. flag .. "']={'" .. table.concat(library.flags[flag], "','") .. "'},"
  293. end
  294.  
  295.  
  296. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},keybinds={"
  297.  
  298.  
  299. count = 0
  300. for flag, _ in next, flags.keybinds do
  301. count = count + 1
  302. configstr = configstr .. "['" .. flag .. "']=" .. tostring(library.flags[flag]) .. ","
  303. end
  304.  
  305.  
  306. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "},colorpickers={"
  307.  
  308.  
  309. count = 0
  310. for flag, _ in next, flags.colorpickers do
  311. count = count + 1
  312. configstr = configstr .. "['" .. flag .. "']=Color3.new(" .. tostring(library.flags[flag]) .. "),"
  313. end
  314.  
  315.  
  316. configstr = (count > 0 and configstr:sub(1, -2) or configstr) .. "}}"
  317.  
  318.  
  319. writefile(gameConfigFolder .. "/" .. name .. ".cfg", "return " .. configstr)
  320. end
  321.  
  322.  
  323.  
  324.  
  325. function library:Load(opts)
  326. local options = utility.table(opts)
  327. local name = options.name or "Epic UI Library"
  328. local sizeX = options.sizeX or 466
  329. local sizeY = options.sizeY or 350
  330. local color = options.color or Color3.fromRGB(255, 255, 255)
  331. local dragSpeed = options.dragSpeed or 0
  332.  
  333.  
  334. library.color = color
  335.  
  336.  
  337. local topbar = utility.create("Frame", {
  338. ZIndex = 2,
  339. Size = UDim2.new(0, sizeX, 0, 26),
  340. Position = utility.get_center(sizeX, sizeY),
  341. BorderSizePixel = 0,
  342. BackgroundColor3 = Color3.fromRGB(22, 22, 22),
  343. Parent = gui
  344. })
  345.  
  346.  
  347. utility.drag(topbar, dragSpeed)
  348.  
  349.  
  350. utility.create("TextLabel", {
  351. ZIndex = 3,
  352. Size = UDim2.new(0, 0, 1, 0),
  353. BackgroundTransparency = 1,
  354. Position = UDim2.new(0, 8, 0, 0),
  355. FontSize = Enum.FontSize.Size14,
  356. TextSize = 14,
  357. TextColor3 = Color3.fromRGB(255, 255, 255),
  358. Text = name,
  359. Font = Enum.Font.GothamSemibold,
  360. TextXAlignment = Enum.TextXAlignment.Left,
  361. Parent = topbar
  362. })
  363.  
  364. local main = utility.create("Frame", {
  365. Size = UDim2.new(1, 0, 0, sizeY),
  366. BorderColor3 = Color3.fromRGB(20, 20, 20),
  367. BackgroundColor3 = Color3.fromRGB(32, 32, 32),
  368. Parent = topbar
  369. })
  370.  
  371.  
  372. local tabs = utility.create("Frame", {
  373. ZIndex = 2,
  374. Size = UDim2.new(1, -8, 1, -64),
  375. BackgroundTransparency = 1,
  376. Position = UDim2.new(0, 4, 0, 58),
  377. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  378. Parent = main
  379. })
  380.  
  381. local tabToggles = utility.create("Frame", {
  382. ZIndex = 2,
  383. Size = UDim2.new(1, 0, 0, 26),
  384. BorderColor3 = Color3.fromRGB(20, 20, 20),
  385. Position = UDim2.new(0, 0, 0, 26),
  386. BackgroundColor3 = Color3.fromRGB(26, 26, 26),
  387. Parent = main
  388. })
  389.  
  390.  
  391. local tabTogglesHolder = utility.create("Frame", {
  392. Size = UDim2.new(1, -12, 1, 0),
  393. Position = UDim2.new(0, 6, 0, 0),
  394. Parent = tabToggles
  395. })
  396.  
  397.  
  398. utility.create("UIListLayout", {
  399. FillDirection = Enum.FillDirection.Horizontal,
  400. SortOrder = Enum.SortOrder.LayoutOrder,
  401. Padding = UDim.new(0, 4),
  402. Parent = tabTogglesHolder
  403. })
  404.  
  405.  
  406. local windowTypes = utility.table({count = 0})
  407.  
  408.  
  409. function windowTypes:Show()
  410. gui.Enabled = true
  411. end
  412.  
  413.  
  414. function windowTypes:Hide()
  415. gui.Enabled = false
  416. end
  417.  
  418.  
  419. function windowTypes:Tab(name)
  420. windowTypes.count = windowTypes.count + 1
  421. name = name or "Tab"
  422.  
  423.  
  424. local toggled = windowTypes.count == 1
  425.  
  426.  
  427. local tabToggle = utility.create("TextButton", {
  428. ZIndex = 3,
  429. BackgroundTransparency = 1,
  430. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  431. FontSize = Enum.FontSize.Size14,
  432. TextSize = 14,
  433. TextColor3 = Color3.fromRGB(255, 255, 255),
  434. Text = name,
  435. Font = toggled and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  436. Parent = tabTogglesHolder
  437. })
  438.  
  439. tabToggle.Size = UDim2.new(0, tabToggle.TextBounds.X + 12, 1, 0)
  440.  
  441.  
  442. local tab = utility.create("Frame", {
  443. Size = UDim2.new(1, 0, 1, 0),
  444. BackgroundTransparency = 1,
  445. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  446. Visible = toggled,
  447. Parent = tabs
  448. })
  449.  
  450. local column1 = utility.create("ScrollingFrame", {
  451. Size = UDim2.new(0.5, -2, 1, 0),
  452. BackgroundTransparency = 1,
  453. Active = true,
  454. BorderSizePixel = 0,
  455. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  456. ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0),
  457. ScrollBarImageTransparency = 1,
  458. ScrollBarThickness = 0,
  459. Parent = tab
  460. })
  461.  
  462.  
  463. local column1List = utility.create("UIListLayout", {
  464. SortOrder = Enum.SortOrder.LayoutOrder,
  465. Padding = UDim.new(0, 6),
  466. Parent = column1
  467. })
  468.  
  469.  
  470. column1List:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  471. column1.CanvasSize = UDim2.new(0, 0, 0, column1List.AbsoluteContentSize.Y)
  472. end)
  473.  
  474.  
  475. local column2 = utility.create("ScrollingFrame", {
  476. Size = UDim2.new(0.5, -2, 1, 0),
  477. BackgroundTransparency = 1,
  478. Position = UDim2.new(0.5, 2, 0, 0),
  479. Active = true,
  480. BorderSizePixel = 0,
  481. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  482. ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0),
  483. ScrollBarImageTransparency = 1,
  484. ScrollBarThickness = 0,
  485. CanvasPosition = Vector2.new(0, 150),
  486. Parent = tab
  487. })
  488.  
  489.  
  490. local column2List = utility.create("UIListLayout", {
  491. SortOrder = Enum.SortOrder.LayoutOrder,
  492. Padding = UDim.new(0, 6),
  493. Parent = column2
  494. })
  495.  
  496.  
  497. column2List:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  498. column2.CanvasSize = UDim2.new(0, 0, 0, column2List.AbsoluteContentSize.Y)
  499. end)
  500.  
  501.  
  502. local function openTab()
  503. for _, obj in next, tabTogglesHolder:GetChildren() do
  504. if obj:IsA("TextButton") then
  505. obj.Font = Enum.Font.Gotham
  506. end
  507. end
  508.  
  509.  
  510. tabToggle.Font = Enum.Font.GothamSemibold
  511.  
  512.  
  513. for _, obj in next, tabs:GetChildren() do
  514. obj.Visible = false
  515. end
  516.  
  517.  
  518. tab.Visible = true
  519. end
  520.  
  521.  
  522. tabToggle.MouseButton1Click:Connect(openTab)
  523.  
  524.  
  525. local tabTypes = utility.table()
  526.  
  527.  
  528. function tabTypes:Open()
  529. openTab()
  530. end
  531.  
  532. function tabTypes:Section(opts)
  533. local options = utility.table(opts)
  534. local name = options.name or "Section"
  535. local column = options.column or 1
  536.  
  537. local columnFrame = column == 1 and column1 or column == 2 and column2
  538.  
  539. local sectionHolder = utility.create("Frame", {
  540. Size = UDim2.new(1, 0, 0, 26),
  541. BackgroundTransparency = 1,
  542. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  543. Parent = columnFrame
  544. })
  545.  
  546. local section = utility.create("Frame", {
  547. ZIndex = 2,
  548. Size = UDim2.new(1, -2, 1, -2),
  549. BorderColor3 = Color3.fromRGB(22, 22, 22),
  550. Position = UDim2.new(0, 1, 0, 1),
  551. BackgroundColor3 = Color3.fromRGB(28, 28, 28),
  552. Parent = sectionHolder
  553. })
  554.  
  555. local sectionTopbar = utility.create("Frame", {
  556. ZIndex = 3,
  557. Size = UDim2.new(1, 0, 0, 24),
  558. BorderSizePixel = 0,
  559. BackgroundColor3 = Color3.fromRGB(22, 22, 22),
  560. Parent = section
  561. })
  562.  
  563.  
  564. utility.create("TextLabel", {
  565. ZIndex = 3,
  566. Size = UDim2.new(0, 0, 1, 0),
  567. BackgroundTransparency = 1,
  568. Position = UDim2.new(0, 8, 0, 0),
  569. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  570. FontSize = Enum.FontSize.Size14,
  571. TextSize = 13,
  572. TextColor3 = Color3.fromRGB(255, 255, 255),
  573. Text = name,
  574. Font = Enum.Font.GothamSemibold,
  575. TextXAlignment = Enum.TextXAlignment.Left,
  576. Parent = sectionTopbar
  577. })
  578.  
  579.  
  580. local sectionContent = utility.create("Frame", {
  581. Size = UDim2.new(1, -12, 1, -36),
  582. Position = UDim2.new(0, 6, 0, 30),
  583. BackgroundTransparency = 1,
  584. Parent = section
  585. })
  586.  
  587. local sectionContentList = utility.create("UIListLayout", {
  588. SortOrder = Enum.SortOrder.LayoutOrder,
  589. Padding = UDim.new(0, 6),
  590. Parent = sectionContent
  591. })
  592.  
  593.  
  594. sectionContentList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  595. sectionHolder.Size = UDim2.new(1, 0, 0, sectionContentList.AbsoluteContentSize.Y + 38)
  596. end)
  597.  
  598.  
  599. local sectionTypes = utility.table()
  600.  
  601.  
  602. function sectionTypes:Show()
  603. sectionHolder.Visible = true
  604. end
  605.  
  606.  
  607. function sectionTypes:Hide()
  608. sectionHolder.Visible = false
  609. end
  610.  
  611.  
  612. function sectionTypes:Label(text)
  613. local label = utility.create("TextLabel", {
  614. ZIndex = 3,
  615. Size = UDim2.new(0, 0, 0, 14),
  616. BackgroundTransparency = 1,
  617. Position = UDim2.new(0, 8, 0, 0),
  618. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  619. FontSize = Enum.FontSize.Size14,
  620. TextSize = 13,
  621. Text = text,
  622. TextColor3 = Color3.fromRGB(255, 255, 255),
  623. Font = Enum.Font.Gotham,
  624. TextXAlignment = Enum.TextXAlignment.Left,
  625. Parent = sectionContent
  626. })
  627.  
  628.  
  629. local labelTypes = utility.table()
  630.  
  631.  
  632. function labelTypes:Show()
  633. label.Visible = true
  634. end
  635.  
  636.  
  637. function labelTypes:Hide()
  638. label.Visible = false
  639. end
  640.  
  641.  
  642. function labelTypes:Set(str)
  643. label.Text = str
  644. end
  645.  
  646.  
  647. return labelTypes
  648. end
  649.  
  650.  
  651. function sectionTypes:SpecialLabel(text)
  652. local specialLabel = utility.create("TextLabel", {
  653. ZIndex = 5,
  654. Size = UDim2.new(1, 0, 0, 14),
  655. BackgroundTransparency = 1,
  656. Position = UDim2.new(0, 8, 0, 0),
  657. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  658. FontSize = Enum.FontSize.Size14,
  659. TextSize = 13,
  660. Text = text,
  661. TextColor3 = Color3.fromRGB(255, 255, 255),
  662. Font = Enum.Font.Gotham,
  663. Parent = sectionContent
  664. })
  665.  
  666.  
  667. utility.create("Frame", {
  668. ZIndex = 3,
  669. Size = UDim2.new(1, 0, 0, 1),
  670. Position = UDim2.new(0, 0, 0.5, 1),
  671. BorderSizePixel = 0,
  672. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  673. Parent = specialLabel
  674. })
  675.  
  676. local lineBlock = utility.create("Frame", {
  677. ZIndex = 4,
  678. Size = UDim2.new(0, specialLabel.TextBounds.X + 6, 0, 1),
  679. Position = UDim2.new(0.5, -((specialLabel.TextBounds.X + 6) / 2), 0.5, 1),
  680. BorderSizePixel = 0,
  681. BackgroundColor3 = Color3.fromRGB(28, 28, 28),
  682. Parent = specialLabel
  683. })
  684.  
  685.  
  686. specialLabel:GetPropertyChangedSignal("TextBounds"):Connect(function()
  687. lineBlock.Size = UDim2.new(0, specialLabel.TextBounds.X + 6, 0, 1)
  688. lineBlock.Position = UDim2.new(0.5, -((specialLabel.TextBounds.X + 6) / 2), 0.5, 1)
  689. end)
  690.  
  691.  
  692. local specialLabelTypes = utility.table()
  693.  
  694.  
  695. function specialLabelTypes:Show()
  696. specialLabel.Visible = true
  697. end
  698.  
  699.  
  700. function specialLabelTypes:Hide()
  701. specialLabel.Visible = false
  702. end
  703.  
  704.  
  705. function specialLabelTypes:Set(str)
  706. specialLabel.Text = str
  707. end
  708.  
  709.  
  710. return specialLabelTypes
  711. end
  712.  
  713.  
  714. function sectionTypes:Button(opts)
  715. local options = utility.table(opts)
  716. local name = options.name
  717. local callback = options.callback
  718.  
  719.  
  720. local button = utility.create("TextButton", {
  721. ZIndex = 3,
  722. Size = UDim2.new(1, 0, 0, 16),
  723. BorderColor3 = Color3.fromRGB(22, 22, 22),
  724. Font = Enum.Font.Gotham,
  725. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  726. Text = "",
  727. TextXAlignment = Enum.TextXAlignment.Left,
  728. Parent = sectionContent
  729. })
  730.  
  731. utility.create("UIGradient", {
  732. Rotation = 90,
  733. Color = ColorSequence.new{
  734. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  735. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  736. },
  737. Parent = button
  738. })
  739.  
  740. local title = utility.create("TextLabel", {
  741. ZIndex = 4,
  742. Size = UDim2.new(0, 0, 1, 0),
  743. BackgroundTransparency = 1,
  744. Position = UDim2.new(0, 8, 0, 0),
  745. FontSize = Enum.FontSize.Size14,
  746. TextSize = 13,
  747. TextColor3 = Color3.fromRGB(255, 255, 255),
  748. Text = name,
  749. Font = Enum.Font.Gotham,
  750. TextXAlignment = Enum.TextXAlignment.Left,
  751. Parent = button
  752. })
  753.  
  754.  
  755. local buttonTypes = utility.table()
  756.  
  757.  
  758. button.MouseButton1Click:Connect(function()
  759. callback(buttonTypes)
  760. end)
  761.  
  762.  
  763. function buttonTypes:Show()
  764. button.Visible = true
  765. end
  766.  
  767. function buttonTypes:Hide()
  768. button.Visible = false
  769. end
  770.  
  771. function buttonTypes:SetName(str)
  772. title.Text = str
  773. end
  774.  
  775.  
  776. function buttonTypes:SetCallback(func)
  777. callback = func
  778. end
  779.  
  780. return buttonTypes
  781. end
  782.  
  783.  
  784. function sectionTypes:Toggle(opts)
  785. local options = utility.table(opts)
  786. local name = options.name or "Toggle"
  787. local flag = options.flag
  788. local callback = options.callback or function() end
  789.  
  790.  
  791. local toggled = false
  792.  
  793.  
  794. if flag then
  795. library.flags[flag] = toggled
  796. end
  797.  
  798.  
  799.  
  800. local toggle = utility.create("TextButton", {
  801. Size = UDim2.new(1, 0, 0, 16),
  802. BackgroundTransparency = 1,
  803. TextColor3 = Color3.fromRGB(0, 0, 0),
  804. Font = Enum.Font.SourceSans,
  805. Parent = sectionContent
  806. })
  807.  
  808. local icon = utility.create("Frame", {
  809. ZIndex = 3,
  810. Size = UDim2.new(0, 14, 1, -2),
  811. BorderColor3 = Color3.fromRGB(37, 37, 37),
  812. Position = UDim2.new(0, 0, 0, 1),
  813. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  814. Parent = toggle
  815. })
  816.  
  817.  
  818. local iconGradient = utility.create("UIGradient", {
  819. Rotation = 90,
  820. Color = ColorSequence.new{
  821. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  822. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  823. },
  824. Parent = icon
  825. })
  826.  
  827. local title = utility.create("TextLabel", {
  828. ZIndex = 3,
  829. Size = UDim2.new(0, 0, 1, 0),
  830. BackgroundTransparency = 1,
  831. Position = UDim2.new(1, 7, 0, 0),
  832. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  833. FontSize = Enum.FontSize.Size14,
  834. TextSize = 13,
  835. TextColor3 = Color3.fromRGB(180, 180, 180),
  836. Text = name,
  837. Font = Enum.Font.Gotham,
  838. TextXAlignment = Enum.TextXAlignment.Left,
  839. Parent = icon
  840. })
  841.  
  842.  
  843. local function toggleToggle()
  844. toggled = not toggled
  845.  
  846.  
  847. if toggled then
  848. table.insert(coloredGradients, iconGradient)
  849. else
  850. table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  851. end
  852.  
  853.  
  854. local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  855. local gradientColor
  856. if toggled then
  857. gradientColor = ColorSequence.new{
  858. ColorSequenceKeypoint.new(0, library.color),
  859. ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  860. }
  861. else
  862. gradientColor = ColorSequence.new{
  863. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  864. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  865. }
  866. end
  867.  
  868.  
  869. iconGradient.Color = gradientColor
  870. title.TextColor3 = textColor
  871.  
  872.  
  873. if flag then
  874. library.flags[flag] = toggled
  875. end
  876.  
  877.  
  878. callback(toggled)
  879. end
  880.  
  881.  
  882. toggle.MouseButton1Click:Connect(toggleToggle)
  883.  
  884.  
  885. local toggleTypes = utility.table()
  886.  
  887.  
  888. function toggleTypes:Show()
  889. toggle.Visible = true
  890. end
  891.  
  892. function toggleTypes:Hide()
  893. toggle.Visible = false
  894. end
  895.  
  896. function toggleTypes:SetName(str)
  897. title.Text = str
  898. end
  899.  
  900.  
  901. function toggleTypes:Toggle(bool)
  902. if toggled ~= bool then
  903. toggleToggle()
  904. end
  905. end
  906.  
  907.  
  908. if flag then
  909. flags.toggles[flag] = function(bool)
  910. if toggled ~= bool then
  911. toggleToggle()
  912. end
  913. end
  914. end
  915.  
  916.  
  917. return toggleTypes
  918. end
  919.  
  920.  
  921. function sectionTypes:Box(opts)
  922. local options = utility.table(opts)
  923. local name = options.name or "Box"
  924. local placeholder = options.placeholder or "Box"
  925. local default = options.default or ""
  926. local boxType = options.type or "string"
  927. local flag = options.flag
  928. local callback = options.callback or function() end
  929.  
  930.  
  931. boxType = boxType:lower()
  932.  
  933.  
  934. if boxType == "number" then
  935. default = default:gsub("%D+", "")
  936.  
  937.  
  938. if flag then
  939. library.flags[flag] = tonumber(default)
  940. end
  941. else
  942. if flag then
  943. library.flags[flag] = default
  944. end
  945. end
  946.  
  947.  
  948. local boxHolder = utility.create("Frame", {
  949. Size = UDim2.new(1, 0, 0, 36),
  950. BackgroundTransparency = 1,
  951. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  952. Parent = sectionContent
  953. })
  954.  
  955. local box = utility.create("TextBox", {
  956. ZIndex = 4,
  957. Size = UDim2.new(1, 0, 0, 16),
  958. BorderColor3 = Color3.fromRGB(22, 22, 22),
  959. BackgroundTransparency = 1,
  960. Position = UDim2.new(0, 0, 1, -16),
  961. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  962. FontSize = Enum.FontSize.Size12,
  963. TextSize = 12,
  964. TextColor3 = Color3.fromRGB(255, 255, 255),
  965. Text = default,
  966. Font = Enum.Font.Gotham,
  967. PlaceholderText = placeholder,
  968. Parent = boxHolder
  969. })
  970.  
  971.  
  972. local bg = utility.create("Frame", {
  973. ZIndex = 3,
  974. Size = UDim2.new(1, 0, 1, 0),
  975. BorderColor3 = Color3.fromRGB(22, 22, 22),
  976. Position = UDim2.new(0, 0, 0, 0),
  977. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  978. Parent = box
  979. })
  980.  
  981.  
  982. utility.create("UIGradient", {
  983. Rotation = 90,
  984. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  985. Parent = bg
  986. })
  987.  
  988. local title = utility.create("TextLabel", {
  989. ZIndex = 3,
  990. Size = UDim2.new(0, 0, 0, 16),
  991. BackgroundTransparency = 1,
  992. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  993. FontSize = Enum.FontSize.Size14,
  994. TextSize = 13,
  995. TextColor3 = Color3.fromRGB(255, 255, 255),
  996. Text = name,
  997. Font = Enum.Font.Gotham,
  998. TextXAlignment = Enum.TextXAlignment.Left,
  999. Parent = boxHolder
  1000. })
  1001.  
  1002.  
  1003. box:GetPropertyChangedSignal("Text"):Connect(function()
  1004. if boxType == "number" then
  1005. box.Text = box.Text:gsub("%D+", "")
  1006. end
  1007. end)
  1008.  
  1009.  
  1010. local boxTypes = utility.table()
  1011.  
  1012.  
  1013. function boxTypes:Show()
  1014. boxHolder.Visible = true
  1015. end
  1016.  
  1017. function boxTypes:Hide()
  1018. boxHolder.Visible = false
  1019. end
  1020.  
  1021. function boxTypes:SetName(str)
  1022. title.Text = str
  1023. end
  1024.  
  1025.  
  1026. function boxTypes:SetPlaceholder(str)
  1027. box.PlaceholderText = str
  1028. end
  1029.  
  1030.  
  1031. function boxTypes:Set(str)
  1032. if boxType == "string" then
  1033. box.Text = str
  1034.  
  1035.  
  1036. if flag then
  1037. library.flags[flag] = str
  1038. end
  1039.  
  1040.  
  1041. callback(str)
  1042. else
  1043. str = str:gsub("%D+", "")
  1044. box.Text = str
  1045.  
  1046.  
  1047. if flag then
  1048. library.flags[flag] = str
  1049. end
  1050.  
  1051.  
  1052. callback(tonumber(str))
  1053. end
  1054. end
  1055.  
  1056.  
  1057. box.FocusLost:Connect(function()
  1058. boxTypes:Set(box.Text)
  1059. end)
  1060.  
  1061.  
  1062. function boxTypes:SetType(str)
  1063. if str:lower() == "number" or str:lower() == "string" then
  1064. boxType = str:lower()
  1065. end
  1066. end
  1067.  
  1068.  
  1069. if flag then
  1070. flags.boxes[flag] = function(str)
  1071. if boxType == "string" then
  1072. box.Text = str
  1073.  
  1074.  
  1075. if flag then
  1076. library.flags[flag] = str
  1077. end
  1078.  
  1079.  
  1080. callback(str)
  1081. else
  1082. str = str:gsub("%D+", "")
  1083. box.Text = str
  1084.  
  1085.  
  1086. if flag then
  1087. library.flags[flag] = str
  1088. end
  1089.  
  1090.  
  1091. callback(tonumber(str))
  1092. end
  1093. end
  1094. end
  1095.  
  1096.  
  1097. return boxTypes
  1098. end
  1099.  
  1100.  
  1101. function sectionTypes:Slider(opts)
  1102. local options = utility.table(opts)
  1103. local min = options.min or 0
  1104. local max = options.max or 100
  1105. local valueText = options.valueText or "Slider: [VALUE]/" .. tostring(max)
  1106. local default = options.default or math.clamp(0, min, max)
  1107. local decimals = options.decimals or 0.1
  1108. local flag = options.flag
  1109. local callback = options.callback or function() end
  1110.  
  1111.  
  1112. decimals = math.floor(10^decimals)
  1113.  
  1114.  
  1115. if flag then
  1116. library.flags[flag] = default
  1117. end
  1118.  
  1119.  
  1120. local value = default
  1121.  
  1122.  
  1123. local sliding = false
  1124.  
  1125.  
  1126. local slider = utility.create("Frame", {
  1127. ZIndex = 3,
  1128. Size = UDim2.new(1, 0, 0, 16),
  1129. BorderColor3 = Color3.fromRGB(22, 22, 22),
  1130. Position = UDim2.new(0, 0, 1, -13),
  1131. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1132. Parent = sectionContent
  1133. })
  1134.  
  1135. local fill = utility.create("Frame", {
  1136. ZIndex = 4,
  1137. Size = UDim2.new((default - min) / (max - min), 0, 1, 0),
  1138. BorderSizePixel = 0,
  1139. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1140. Parent = slider
  1141. })
  1142.  
  1143. local fillGradient = utility.create("UIGradient", {
  1144. Rotation = 90,
  1145. Color = ColorSequence.new{
  1146. ColorSequenceKeypoint.new(0, library.color),
  1147. ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  1148. },
  1149. Parent = fill
  1150. })
  1151.  
  1152.  
  1153. table.insert(coloredGradients, fillGradient)
  1154.  
  1155. utility.create("UIGradient", {
  1156. Rotation = 90,
  1157. Color = ColorSequence.new{
  1158. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  1159. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  1160. },
  1161. Parent = slider
  1162. })
  1163.  
  1164.  
  1165. local title = utility.create("TextLabel", {
  1166. ZIndex = 5,
  1167. Size = UDim2.new(1, 0, 1, 0),
  1168. BackgroundTransparency = 1,
  1169. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1170. FontSize = Enum.FontSize.Size12,
  1171. TextSize = 12,
  1172. TextColor3 = Color3.fromRGB(255, 255, 255),
  1173. Text = valueText:gsub("%[VALUE%]", tostring(default)),
  1174. Font = Enum.Font.Gotham,
  1175. Parent = slider
  1176. })
  1177.  
  1178.  
  1179. local function slide(input)
  1180. local sizeX = math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
  1181. fill.Size = UDim2.new(sizeX, 0, 1, 0)
  1182.  
  1183.  
  1184. value = math.floor((((max - min) * sizeX) + min) * decimals) / decimals
  1185. title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1186.  
  1187.  
  1188. if flag then
  1189. library.flags[flag] = value
  1190. end
  1191.  
  1192.  
  1193. callback(value)
  1194. end
  1195.  
  1196.  
  1197. slider.InputBegan:Connect(function(input)
  1198. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1199. sliding = true
  1200. slide(input)
  1201. end
  1202. end)
  1203.  
  1204.  
  1205. slider.InputEnded:Connect(function(input)
  1206. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1207. sliding = false
  1208. end
  1209. end)
  1210.  
  1211.  
  1212. inputService.InputChanged:Connect(function(input)
  1213. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1214. if sliding then
  1215. slide(input)
  1216. end
  1217. end
  1218. end)
  1219.  
  1220.  
  1221. local sliderTypes = utility.table()
  1222.  
  1223.  
  1224. function sliderTypes:Show()
  1225. slider.Visible = true
  1226. end
  1227.  
  1228.  
  1229. function sliderTypes:Hide()
  1230. slider.Visible = false
  1231. end
  1232.  
  1233.  
  1234. function sliderTypes:SetValueText(str)
  1235. valueText = str
  1236. title.Text = str
  1237. end
  1238.  
  1239.  
  1240. function sliderTypes:Set(num)
  1241. num = math.floor(math.clamp(num, min, max) * decimals) / decimals
  1242. value = num
  1243. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1244.  
  1245. if flag then
  1246. library.flags[flag] = value
  1247. end
  1248.  
  1249.  
  1250. callback(value)
  1251. end
  1252.  
  1253.  
  1254. function sliderTypes:SetMin(num)
  1255. min = num
  1256. value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1257. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1258.  
  1259.  
  1260. if flag then
  1261. library.flags[flag] = value
  1262. end
  1263.  
  1264.  
  1265. callback(value)
  1266. end
  1267.  
  1268.  
  1269. function sliderTypes:SetMax(num)
  1270. max = num
  1271. value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1272. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1273.  
  1274.  
  1275. if flag then
  1276. library.flags[flag] = value
  1277. end
  1278.  
  1279.  
  1280. callback(value)
  1281. end
  1282.  
  1283.  
  1284. if flag then
  1285. flags.sliders[flag] = function(num)
  1286. sliderTypes:Set(num)
  1287. end
  1288. end
  1289.  
  1290.  
  1291. return sliderTypes
  1292. end
  1293.  
  1294.  
  1295. function sectionTypes:ToggleSlider(opts)
  1296. local options = utility.table(opts)
  1297. local name = options.name or "Toggle Slider"
  1298. local min = options.min or 0
  1299. local max = options.max or 100
  1300. local valueText = options.valueText or "Toggle Slider: [VALUE]/" .. tostring(max)
  1301. local default = options.default or math.clamp(0, min, max)
  1302. local decimals = options.decimals or 0
  1303. local toggleFlag = options.toggleFlag
  1304. local sliderFlag = options.sliderFlag
  1305. local toggleCallback = options.toggleCallback or function() end
  1306. local sliderCallback = options.sliderCallback or function() end
  1307.  
  1308.  
  1309. decimals = math.floor(10^decimals)
  1310.  
  1311.  
  1312. local value = default
  1313. local toggled = false
  1314. local sliding = false
  1315.  
  1316.  
  1317. if sliderFlag then
  1318. library.flags[sliderFlag] = default
  1319. end
  1320.  
  1321.  
  1322. if toggleFlag then
  1323. library.flags[toggleFlag] = toggled
  1324. end
  1325.  
  1326.  
  1327. toggleCallback(toggled)
  1328.  
  1329.  
  1330. local toggleSliderHolder = utility.create("Frame", {
  1331. Size = UDim2.new(1, 0, 0, 35),
  1332. BackgroundTransparency = 1,
  1333. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1334. Parent = sectionContent
  1335. })
  1336.  
  1337. local slider = utility.create("Frame", {
  1338. ZIndex = 3,
  1339. Size = UDim2.new(1, 0, 0, 16),
  1340. BorderColor3 = Color3.fromRGB(22, 22, 22),
  1341. Position = UDim2.new(0, 0, 1, -16),
  1342. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1343. Parent = toggleSliderHolder
  1344. })
  1345.  
  1346. local fill = utility.create("Frame", {
  1347. ZIndex = 4,
  1348. Size = UDim2.new((default - min) / (max - min), 0, 1, 0),
  1349. BorderSizePixel = 0,
  1350. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1351. Parent = slider
  1352. })
  1353.  
  1354. local fillGradient = utility.create("UIGradient", {
  1355. Rotation = 90,
  1356. Color = ColorSequence.new{
  1357. ColorSequenceKeypoint.new(0, library.color),
  1358. ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  1359. },
  1360. Parent = fill
  1361. })
  1362.  
  1363.  
  1364. table.insert(coloredGradients, fillGradient)
  1365.  
  1366. utility.create("UIGradient", {
  1367. Rotation = 90,
  1368. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  1369. Parent = slider
  1370. })
  1371.  
  1372. local title = utility.create("TextLabel", {
  1373. ZIndex = 5,
  1374. Size = UDim2.new(1, 0, 1, 0),
  1375. BackgroundTransparency = 1,
  1376. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1377. FontSize = Enum.FontSize.Size12,
  1378. TextSize = 12,
  1379. TextColor3 = Color3.fromRGB(255, 255, 255),
  1380. Text = valueText:gsub("%[VALUE%]", tostring(default)),
  1381. Font = Enum.Font.Gotham,
  1382. Parent = slider
  1383. })
  1384.  
  1385.  
  1386. local toggle = utility.create("TextButton", {
  1387. Size = UDim2.new(1, 0, 0, 16),
  1388. BackgroundTransparency = 1,
  1389. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1390. FontSize = Enum.FontSize.Size14,
  1391. TextSize = 14,
  1392. TextColor3 = Color3.fromRGB(0, 0, 0),
  1393. Font = Enum.Font.SourceSans,
  1394. Parent = toggleSliderHolder
  1395. })
  1396.  
  1397. local icon = utility.create("TextButton", {
  1398. ZIndex = 3,
  1399. Size = UDim2.new(0, 14, 1, -2),
  1400. BorderColor3 = Color3.fromRGB(37, 37, 37),
  1401. Position = UDim2.new(0, 0, 0, 1),
  1402. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1403. Text = "",
  1404. Parent = toggle
  1405. })
  1406.  
  1407. local iconGradient = utility.create("UIGradient", {
  1408. Rotation = 90,
  1409. Color = ColorSequence.new{
  1410. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  1411. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  1412. },
  1413. Parent = icon
  1414. })
  1415.  
  1416. local toggleTitle = utility.create("TextLabel", {
  1417. ZIndex = 3,
  1418. Size = UDim2.new(0, 0, 1, 0),
  1419. BackgroundTransparency = 1,
  1420. Position = UDim2.new(1, 7, 0, 0),
  1421. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1422. FontSize = Enum.FontSize.Size14,
  1423. TextSize = 13,
  1424. TextColor3 = Color3.fromRGB(255, 255, 255),
  1425. Text = name,
  1426. Font = Enum.Font.Gotham,
  1427. TextXAlignment = Enum.TextXAlignment.Left,
  1428. Parent = icon
  1429. })
  1430.  
  1431.  
  1432. local function toggleToggle()
  1433. toggled = not toggled
  1434.  
  1435.  
  1436. if toggled then
  1437. table.insert(coloredGradients, iconGradient)
  1438. else
  1439. table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  1440. end
  1441.  
  1442.  
  1443. local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  1444. local gradientColor
  1445. if toggled then
  1446. gradientColor = ColorSequence.new{
  1447. ColorSequenceKeypoint.new(0, library.color),
  1448. ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  1449. }
  1450. else
  1451. gradientColor = ColorSequence.new{
  1452. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  1453. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  1454. }
  1455. end
  1456.  
  1457.  
  1458. iconGradient.Color = gradientColor
  1459. toggleTitle.TextColor3 = textColor
  1460.  
  1461.  
  1462. if toggleFlag then
  1463. library.flags[toggleFlag] = toggled
  1464. end
  1465.  
  1466.  
  1467. toggleCallback(toggled)
  1468. end
  1469.  
  1470.  
  1471. toggle.MouseButton1Click:Connect(toggleToggle)
  1472.  
  1473.  
  1474. local function slide(input)
  1475. local sizeX = math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
  1476. fill.Size = UDim2.new(sizeX, 0, 1, 0)
  1477.  
  1478.  
  1479. value = math.floor((((max - min) * sizeX) + min) * decimals) / decimals
  1480. title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1481.  
  1482.  
  1483. if sliderFlag then
  1484. library.flags[sliderFlag] = value
  1485. end
  1486.  
  1487.  
  1488. sliderCallback(value)
  1489. end
  1490.  
  1491.  
  1492. slider.InputBegan:Connect(function(input)
  1493. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1494. sliding = true
  1495. slide(input)
  1496. end
  1497. end)
  1498.  
  1499.  
  1500. slider.InputEnded:Connect(function(input)
  1501. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1502. sliding = false
  1503. end
  1504. end)
  1505.  
  1506.  
  1507. inputService.InputChanged:Connect(function(input)
  1508. if input.UserInputType == Enum.UserInputType.MouseMovement then
  1509. if sliding then
  1510. slide(input)
  1511. end
  1512. end
  1513. end)
  1514.  
  1515.  
  1516. local toggleSliderTypes = utility.table()
  1517.  
  1518.  
  1519. function toggleSliderTypes:Show()
  1520. toggleSliderHolder.Visible = true
  1521. end
  1522.  
  1523.  
  1524. function toggleSliderTypes:Hide()
  1525. toggleSliderHolder.Visible = false
  1526. end
  1527.  
  1528.  
  1529. function toggleSliderTypes:SetValueText(str)
  1530. valueText = str
  1531. title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1532. end
  1533.  
  1534.  
  1535. function toggleSliderTypes:Set(num)
  1536. num = math.floor(math.clamp(num, min, max) * decimals) / decimals
  1537. value = num
  1538. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1539. title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1540.  
  1541. if sliderFlag then
  1542. library.flags[sliderFlag] = value
  1543. end
  1544.  
  1545.  
  1546. sliderCallback(value)
  1547. end
  1548.  
  1549.  
  1550. function toggleSliderTypes:SetMin(num)
  1551. min = num
  1552. value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1553. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1554. title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1555.  
  1556.  
  1557. if sliderFlag then
  1558. library.flags[sliderFlag] = value
  1559. end
  1560.  
  1561.  
  1562. sliderCallback(value)
  1563. end
  1564.  
  1565.  
  1566. function toggleSliderTypes:SetMax(num)
  1567. max = num
  1568. value = math.floor(math.clamp(value, min, max) * decimals) / decimals
  1569. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  1570. title.Text = valueText:gsub("%[VALUE%]", tostring(value))
  1571.  
  1572.  
  1573. if sliderFlag then
  1574. library.flags[sliderFlag] = value
  1575. end
  1576.  
  1577.  
  1578. sliderCallback(value)
  1579. end
  1580.  
  1581.  
  1582. function toggleSliderTypes:Toggle(bool)
  1583. if toggled ~= bool then
  1584. toggleToggle()
  1585. end
  1586. end
  1587.  
  1588.  
  1589. if toggleFlag then
  1590. flags.toggles[toggleFlag] = function(bool)
  1591. if toggled ~= bool then
  1592. toggleToggle()
  1593. end
  1594. end
  1595. end
  1596.  
  1597.  
  1598. if sliderFlag then
  1599. flags.sliders[sliderFlag] = function(num)
  1600. toggleSliderTypes:Set(num)
  1601. end
  1602. end
  1603.  
  1604.  
  1605. return toggleSliderTypes
  1606. end
  1607.  
  1608.  
  1609. function sectionTypes:Dropdown(opts)
  1610. local options = utility.table(opts)
  1611. local name = options.name or "Dropdown"
  1612. local content = options.content or {}
  1613. local multiChoice = options.multiChoice or false
  1614. local default = (options.default and table.find(content, options.default)) or (multiChoice and {} or nil)
  1615. local flag = options.flag
  1616. local callback = options.callback or function() end
  1617.  
  1618.  
  1619.  
  1620.  
  1621. if flag then
  1622. library.flags[flag] = default
  1623. end
  1624.  
  1625.  
  1626. local opened = false
  1627.  
  1628.  
  1629. local current = default
  1630. local chosen = {}
  1631.  
  1632.  
  1633. local dropdownHolder = utility.create("Frame", {
  1634. Size = UDim2.new(1, 0, 0, 36),
  1635. BackgroundTransparency = 1,
  1636. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1637. Parent = sectionContent
  1638. })
  1639.  
  1640. local title = utility.create("TextLabel", {
  1641. ZIndex = 3,
  1642. Size = UDim2.new(0, 0, 0, 16),
  1643. BackgroundTransparency = 1,
  1644. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1645. FontSize = Enum.FontSize.Size14,
  1646. TextSize = 13,
  1647. TextColor3 = Color3.fromRGB(255, 255, 255),
  1648. Text = name,
  1649. Font = Enum.Font.Gotham,
  1650. TextXAlignment = Enum.TextXAlignment.Left,
  1651. Parent = dropdownHolder
  1652. })
  1653.  
  1654. local open = utility.create("TextButton", {
  1655. ZIndex = 3,
  1656. Size = UDim2.new(1, 0, 0, 16),
  1657. BorderColor3 = Color3.fromRGB(22, 22, 22),
  1658. Position = UDim2.new(0, 0, 0, 20),
  1659. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1660. Text = "",
  1661. Font = Enum.Font.Gotham,
  1662. TextXAlignment = Enum.TextXAlignment.Left,
  1663. Parent = dropdownHolder
  1664. })
  1665.  
  1666. utility.create("UIGradient", {
  1667. Rotation = 90,
  1668. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  1669. Parent = open
  1670. })
  1671.  
  1672. local value = utility.create("TextLabel", {
  1673. ZIndex = 4,
  1674. Size = UDim2.new(0, 0, 1, 0),
  1675. BackgroundTransparency = 1,
  1676. Position = UDim2.new(0, 8, 0, 0),
  1677. FontSize = Enum.FontSize.Size12,
  1678. TextSize = 12,
  1679. TextColor3 = (multiChoice and (#default > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180))) or default and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180),
  1680. Text = multiChoice and (#default > 0 and table.concat(default, ", ") or "NONE") or (default or "NONE"),
  1681. Font = Enum.Font.Gotham,
  1682. TextXAlignment = Enum.TextXAlignment.Left,
  1683. Parent = open
  1684. })
  1685.  
  1686. local icon = utility.create("ImageLabel", {
  1687. ZIndex = 4,
  1688. Size = UDim2.new(0, 14, 0, 14),
  1689. Rotation = 180,
  1690. BackgroundTransparency = 1,
  1691. Position = UDim2.new(1, -16, 0, 1),
  1692. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1693. Image = "http://www.roblox.com/asset/?id=8747047318",
  1694. Parent = open
  1695. })
  1696.  
  1697. local contentFrame = utility.create("Frame", {
  1698. ZIndex = 10,
  1699. Visible = false,
  1700. Size = UDim2.new(1, 0, 0, 0),
  1701. BorderColor3 = Color3.fromRGB(22, 22, 22),
  1702. Position = UDim2.new(0, 0, 1, 3),
  1703. BackgroundColor3 = Color3.fromRGB(33, 33, 33),
  1704. Parent = open
  1705. })
  1706.  
  1707. local contentHolder = utility.create("Frame", {
  1708. Size = UDim2.new(1, 0, 1, -4),
  1709. Position = UDim2.new(0, 0, 0, 2),
  1710. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1711. Parent = contentFrame
  1712. })
  1713.  
  1714.  
  1715. local contentList = utility.create("UIListLayout", {
  1716. SortOrder = Enum.SortOrder.LayoutOrder,
  1717. Parent = contentHolder
  1718. })
  1719.  
  1720.  
  1721. contentList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  1722. contentFrame.Size = UDim2.new(1, 0, 0, contentList.AbsoluteContentSize.Y + 4)
  1723. end)
  1724.  
  1725.  
  1726. local function openDropdown()
  1727. opened = not opened
  1728. icon.Rotation = opened and 0 or 180
  1729. contentFrame.Visible = opened
  1730. dropdownHolder.Size = UDim2.new(1, 0, 0, opened and dropdownHolder.AbsoluteSize.Y + contentFrame.AbsoluteSize.Y + 3 or 36)
  1731. end
  1732.  
  1733.  
  1734. local function selectObj(obj, padding, bool)
  1735. for i, v in next, contentHolder:GetChildren() do
  1736. if v:IsA("TextButton") then
  1737. v:FindFirstChildOfClass("UIPadding").PaddingLeft = UDim.new(0, 6)
  1738. v.Font = Enum.Font.Gotham
  1739. end
  1740. end
  1741.  
  1742.  
  1743. obj.Font = bool and Enum.Font.GothamSemibold or Enum.Font.Gotham
  1744. padding.PaddingLeft = bool and UDim.new(0, 10) or UDim.new(0, 6)
  1745. value.TextColor3 = bool and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  1746. end
  1747.  
  1748.  
  1749. local function multiSelectObj(obj, padding, bool)
  1750. obj.Font = bool and Enum.Font.GothamSemibold or Enum.Font.Gotham
  1751. padding.PaddingLeft = bool and UDim.new(0, 10) or UDim.new(0, 6)
  1752. end
  1753.  
  1754. open.MouseButton1Click:Connect(openDropdown)
  1755.  
  1756.  
  1757. for _, opt in next, content do
  1758. local option = utility.create("TextButton", {
  1759. Name = opt,
  1760. ZIndex = 11,
  1761. Size = UDim2.new(1, 0, 0, 14),
  1762. BackgroundTransparency = 1,
  1763. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1764. FontSize = Enum.FontSize.Size12,
  1765. TextSize = 12,
  1766. TextColor3 = Color3.fromRGB(255, 255, 255),
  1767. Text = tostring(opt),
  1768. Font = current == opt and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  1769. TextXAlignment = Enum.TextXAlignment.Left,
  1770. Parent = contentHolder
  1771. })
  1772.  
  1773. local optionPadding = utility.create("UIPadding", {
  1774. PaddingLeft = current == opt and UDim.new(0, 10) or UDim.new(0, 6),
  1775. Parent = option
  1776. })
  1777.  
  1778.  
  1779. option.MouseButton1Click:Connect(function()
  1780. if not multiChoice then
  1781. if current ~= opt then
  1782. current = opt
  1783. selectObj(option, optionPadding, true)
  1784. value.Text = opt
  1785.  
  1786. if flag then
  1787. library.flags[flag] = opt
  1788. end
  1789.  
  1790.  
  1791. callback(opt)
  1792. else
  1793. current = nil
  1794. selectObj(option, optionPadding, false)
  1795. value.Text = "NONE"
  1796.  
  1797.  
  1798. if flag then
  1799. library.flags[flag] = nil
  1800. end
  1801.  
  1802.  
  1803. callback(nil)
  1804. end
  1805. else
  1806. if not table.find(chosen, opt) then
  1807. table.insert(chosen, opt)
  1808.  
  1809.  
  1810. multiSelectObj(option, optionPadding, true)
  1811. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  1812. value.Text = table.concat(chosen, ", ")
  1813.  
  1814. if flag then
  1815. library.flags[flag] = chosen
  1816. end
  1817.  
  1818.  
  1819. callback(chosen)
  1820. else
  1821. table.remove(chosen, table.find(chosen, opt))
  1822.  
  1823.  
  1824. multiSelectObj(option, optionPadding, false)
  1825. value.TextColor3 = #chosen > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  1826. value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  1827.  
  1828.  
  1829. if flag then
  1830. library.flags[flag] = chosen
  1831. end
  1832.  
  1833.  
  1834. callback(chosen)
  1835. end
  1836. end
  1837. end)
  1838. end
  1839.  
  1840.  
  1841. local dropdownTypes = utility.table()
  1842.  
  1843.  
  1844. function dropdownTypes:Show()
  1845. dropdownHolder.Visible = true
  1846. end
  1847.  
  1848.  
  1849. function dropdownTypes:Hide()
  1850. dropdownHolder.Visible = false
  1851. end
  1852.  
  1853.  
  1854. function dropdownTypes:SetName(str)
  1855. title.Text = str
  1856. end
  1857.  
  1858.  
  1859. function dropdownTypes:Set(opt)
  1860. if opt then
  1861. if typeof(opt) == "string" then
  1862. if table.find(content, opt) then
  1863. if not multiChoice then
  1864. current = opt
  1865. selectObj(contentHolder:FindFirstChild(opt), contentHolder:FindFirstChild(opt):FindFirstChildOfClass("UIPadding"), true)
  1866. value.Text = opt
  1867.  
  1868. if flag then
  1869. library.flags[flag] = opt
  1870. end
  1871.  
  1872.  
  1873. callback(opt)
  1874. else
  1875. table.insert(chosen, opt)
  1876.  
  1877.  
  1878. multiSelectObj(contentHolder:FindFirstChild(opt), contentHolder:FindFirstChild(opt):FindFirstChildOfClass("UIPadding"), true)
  1879. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  1880. value.Text = table.concat(chosen, ", ")
  1881.  
  1882. if flag then
  1883. library.flags[flag] = chosen
  1884. end
  1885.  
  1886.  
  1887. callback(chosen)
  1888. end
  1889. end
  1890. elseif multiChoice then
  1891. table.clear(chosen)
  1892. chosen = opt
  1893.  
  1894.  
  1895. for i, v in next, opt do
  1896. if contentHolder:FindFirstChild(v) then
  1897. multiSelectObj(contentHolder:FindFirstChild(v), contentHolder:FindFirstChild(v):FindFirstChildOfClass("UIPadding"), true)
  1898.  
  1899.  
  1900. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  1901. value.Text = table.concat(chosen, ", ")
  1902. end
  1903. end
  1904. end
  1905. else
  1906. if not multiChoice then
  1907. current = nil
  1908.  
  1909.  
  1910. for i, v in next, contentHolder:GetChildren() do
  1911. if v:IsA("TextButton") then
  1912. v:FindFirstChildOfClass("UIPadding").PaddingLeft = UDim.new(0, 6)
  1913. v.Font = Enum.Font.Gotham
  1914. end
  1915. end
  1916.  
  1917.  
  1918. value.Text = "NONE"
  1919. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  1920.  
  1921.  
  1922. if flag then
  1923. library.flags[flag] = nil
  1924. end
  1925.  
  1926.  
  1927. callback(nil)
  1928. elseif multiChoice then
  1929. table.clear(chosen)
  1930.  
  1931.  
  1932. for i, v in next, contentHolder:GetChildren() do
  1933. if v:IsA("TextButton") then
  1934. v:FindFirstChildOfClass("UIPadding").PaddingLeft = UDim.new(0, 6)
  1935. v.Font = Enum.Font.GothamSemiBold
  1936. end
  1937. end
  1938.  
  1939.  
  1940. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  1941. value.Text = "NONE"
  1942.  
  1943.  
  1944. if flag then
  1945. library.flags[flag] = chosen
  1946. end
  1947.  
  1948.  
  1949. callback(chosen)
  1950. end
  1951. end
  1952. end
  1953.  
  1954.  
  1955. function dropdownTypes:Add(opt)
  1956. table.insert(content, opt)
  1957.  
  1958.  
  1959. local option = utility.create("TextButton", {
  1960. Name = opt,
  1961. ZIndex = 11,
  1962. Size = UDim2.new(1, 0, 0, 14),
  1963. BackgroundTransparency = 1,
  1964. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1965. FontSize = Enum.FontSize.Size12,
  1966. TextSize = 12,
  1967. TextColor3 = Color3.fromRGB(255, 255, 255),
  1968. Text = tostring(opt),
  1969. Font = current == opt and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  1970. TextXAlignment = Enum.TextXAlignment.Left,
  1971. Parent = contentHolder
  1972. })
  1973.  
  1974. local optionPadding = utility.create("UIPadding", {
  1975. PaddingLeft = current == opt and UDim.new(0, 10) or UDim.new(0, 6),
  1976. Parent = option
  1977. })
  1978.  
  1979.  
  1980. option.MouseButton1Click:Connect(function()
  1981. if not multiChoice then
  1982. if current ~= opt then
  1983. current = opt
  1984. selectObj(option, optionPadding, true)
  1985. value.Text = opt
  1986.  
  1987. if flag then
  1988. library.flags[flag] = opt
  1989. end
  1990.  
  1991.  
  1992. callback(opt)
  1993. else
  1994. current = nil
  1995. selectObj(option, optionPadding, false)
  1996. value.Text = "NONE"
  1997.  
  1998.  
  1999. if flag then
  2000. library.flags[flag] = nil
  2001. end
  2002.  
  2003.  
  2004. callback(nil)
  2005. end
  2006. else
  2007. if not table.find(chosen, opt) then
  2008. table.insert(chosen, opt)
  2009.  
  2010.  
  2011. multiSelectObj(option, optionPadding, true)
  2012. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2013. value.Text = table.concat(chosen, ", ")
  2014.  
  2015. if flag then
  2016. library.flags[flag] = chosen
  2017. end
  2018.  
  2019.  
  2020. callback(chosen)
  2021. else
  2022. table.remove(chosen, table.find(chosen, opt))
  2023.  
  2024.  
  2025. multiSelectObj(option, optionPadding, false)
  2026. value.TextColor3 = #chosen > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  2027. value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  2028.  
  2029.  
  2030. if flag then
  2031. library.flags[flag] = chosen
  2032. end
  2033.  
  2034.  
  2035. callback(chosen)
  2036. end
  2037. end
  2038. end)
  2039. end
  2040.  
  2041.  
  2042. function dropdownTypes:Remove(opt)
  2043. if table.find(content, opt) then
  2044. if not multiChoice then
  2045. if current == opt then
  2046. dropdownTypes:Set(nil)
  2047. end
  2048.  
  2049.  
  2050. if contentHolder:FindFirstChild(opt) then
  2051. contentHolder:FindFirstChild(opt):Destroy()
  2052. end
  2053. else
  2054. if table.find(chosen, opt) then
  2055. table.remove(chosen, table.find(chosen, opt))
  2056. value.TextColor3 = #chosen > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  2057. value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  2058. end
  2059.  
  2060.  
  2061. if contentHolder:FindFirstChild(opt) then
  2062. contentHolder:FindFirstChild(opt):Destroy()
  2063. end
  2064. end
  2065. end
  2066. end
  2067.  
  2068.  
  2069. function dropdownTypes:Refresh(tbl)
  2070. content = tbl
  2071. for _, opt in next, contentHolder:GetChildren() do
  2072. if opt:IsA("TextButton") then
  2073. opt:Destroy()
  2074. end
  2075. end
  2076.  
  2077.  
  2078. dropdownTypes:Set(nil)
  2079.  
  2080.  
  2081. for _, opt in next, content do
  2082. local option = utility.create("TextButton", {
  2083. Name = opt,
  2084. ZIndex = 11,
  2085. Size = UDim2.new(1, 0, 0, 14),
  2086. BackgroundTransparency = 1,
  2087. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2088. FontSize = Enum.FontSize.Size12,
  2089. TextSize = 12,
  2090. TextColor3 = Color3.fromRGB(255, 255, 255),
  2091. Text = tostring(opt),
  2092. Font = current == opt and Enum.Font.GothamSemibold or Enum.Font.Gotham,
  2093. TextXAlignment = Enum.TextXAlignment.Left,
  2094. Parent = contentHolder
  2095. })
  2096.  
  2097. local optionPadding = utility.create("UIPadding", {
  2098. PaddingLeft = current == opt and UDim.new(0, 10) or UDim.new(0, 6),
  2099. Parent = option
  2100. })
  2101.  
  2102. option.MouseButton1Click:Connect(function()
  2103. if not multiChoice then
  2104. if current ~= opt then
  2105. current = opt
  2106. selectObj(option, optionPadding, true)
  2107. value.Text = opt
  2108.  
  2109. if flag then
  2110. library.flags[flag] = opt
  2111. end
  2112.  
  2113. callback(opt)
  2114. else
  2115. current = nil
  2116. selectObj(option, optionPadding, false)
  2117. value.Text = "NONE"
  2118.  
  2119. if flag then
  2120. library.flags[flag] = nil
  2121. end
  2122.  
  2123. callback(nil)
  2124. end
  2125. else
  2126. if not table.find(chosen, opt) then
  2127. table.insert(chosen, opt)
  2128.  
  2129. multiSelectObj(option, optionPadding, true)
  2130. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2131. value.Text = table.concat(chosen, ", ")
  2132.  
  2133. if flag then
  2134. library.flags[flag] = chosen
  2135. end
  2136.  
  2137. callback(chosen)
  2138. else
  2139. table.remove(chosen, table.find(chosen, opt))
  2140.  
  2141. multiSelectObj(option, optionPadding, false)
  2142. value.TextColor3 = #chosen > 0 and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  2143. value.Text = #chosen > 0 and table.concat(chosen, ", ") or "NONE"
  2144.  
  2145. if flag then
  2146. library.flags[flag] = chosen
  2147. end
  2148.  
  2149. callback(chosen)
  2150. end
  2151. end
  2152. end)
  2153. end
  2154. end
  2155.  
  2156.  
  2157. if flag then
  2158. if not multiChoice then
  2159. flags.dropdowns[flag] = function(opt)
  2160. dropdownTypes:Set(opt)
  2161. end
  2162. else
  2163. flags.multidropdowns[flag] = function(opt)
  2164. dropdownTypes:Set(opt)
  2165. end
  2166. end
  2167. end
  2168.  
  2169.  
  2170. return dropdownTypes
  2171. end
  2172.  
  2173.  
  2174. function sectionTypes:Keybind(opts)
  2175. local options = utility.table(opts)
  2176. local name = options.name or "Keybind"
  2177. local default = options.default
  2178. local blacklist = options.blacklist or {}
  2179. local flag = options.flag
  2180. local callback = options.callback or function() end
  2181.  
  2182.  
  2183. if flag then
  2184. library.flags[flag] = default
  2185. end
  2186.  
  2187.  
  2188. local keys = {
  2189. [Enum.KeyCode.LeftShift] = "Left Shift";
  2190. [Enum.KeyCode.RightShift] = "Right Shift";
  2191. [Enum.KeyCode.LeftControl] = "Left Ctrl";
  2192. [Enum.KeyCode.RightControl] = "Right Ctrl";
  2193. [Enum.KeyCode.LeftAlt] = "Left Alt";
  2194. [Enum.KeyCode.RightAlt] = "Right Alt";
  2195. [Enum.KeyCode.CapsLock] = "CapsLock";
  2196. [Enum.KeyCode.One] = "1";
  2197. [Enum.KeyCode.Two] = "2";
  2198. [Enum.KeyCode.Three] = "3";
  2199. [Enum.KeyCode.Four] = "4";
  2200. [Enum.KeyCode.Five] = "5";
  2201. [Enum.KeyCode.Six] = "6";
  2202. [Enum.KeyCode.Seven] = "7";
  2203. [Enum.KeyCode.Eight] = "8";
  2204. [Enum.KeyCode.Nine] = "9";
  2205. [Enum.KeyCode.Zero] = "0";
  2206. [Enum.KeyCode.KeypadOne] = "Num 1";
  2207. [Enum.KeyCode.KeypadTwo] = "Num 2";
  2208. [Enum.KeyCode.KeypadThree] = "Num 3";
  2209. [Enum.KeyCode.KeypadFour] = "Num 4";
  2210. [Enum.KeyCode.KeypadFive] = "Num 5";
  2211. [Enum.KeyCode.KeypadSix] = "Num 6";
  2212. [Enum.KeyCode.KeypadSeven] = "Num 7";
  2213. [Enum.KeyCode.KeypadEight] = "Num 8";
  2214. [Enum.KeyCode.KeypadNine] = "Num 9";
  2215. [Enum.KeyCode.KeypadZero] = "Num 0";
  2216. [Enum.KeyCode.Minus] = "-";
  2217. [Enum.KeyCode.Equals] = "=";
  2218. [Enum.KeyCode.Tilde] = "~";
  2219. [Enum.KeyCode.LeftBracket] = "[";
  2220. [Enum.KeyCode.RightBracket] = "]";
  2221. [Enum.KeyCode.RightParenthesis] = ")";
  2222. [Enum.KeyCode.LeftParenthesis] = "(";
  2223. [Enum.KeyCode.Semicolon] = ";";
  2224. [Enum.KeyCode.Quote] = "'";
  2225. [Enum.KeyCode.BackSlash] = "\\";
  2226. [Enum.KeyCode.Comma] = ";";
  2227. [Enum.KeyCode.Period] = ".";
  2228. [Enum.KeyCode.Slash] = "/";
  2229. [Enum.KeyCode.Asterisk] = "*";
  2230. [Enum.KeyCode.Plus] = "+";
  2231. [Enum.KeyCode.Period] = ".";
  2232. [Enum.KeyCode.Backquote] = "`";
  2233. [Enum.UserInputType.MouseButton1] = "Mouse 1";
  2234. [Enum.UserInputType.MouseButton2] = "Mouse 2";
  2235. [Enum.UserInputType.MouseButton3] = "Mouse 3"
  2236. }
  2237.  
  2238.  
  2239. local keyChosen = default
  2240.  
  2241.  
  2242. local keybind = utility.create("TextButton", {
  2243. Size = UDim2.new(1, 0, 0, 16),
  2244. BackgroundTransparency = 1,
  2245. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2246. FontSize = Enum.FontSize.Size14,
  2247. TextSize = 14,
  2248. TextColor3 = Color3.fromRGB(0, 0, 0),
  2249. Font = Enum.Font.SourceSans,
  2250. Parent = sectionContent
  2251. })
  2252.  
  2253. local title = utility.create("TextLabel", {
  2254. ZIndex = 3,
  2255. Size = UDim2.new(0, 0, 1, 0),
  2256. BackgroundTransparency = 1,
  2257. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2258. FontSize = Enum.FontSize.Size14,
  2259. TextSize = 13,
  2260. TextColor3 = Color3.fromRGB(255, 255, 255),
  2261. Text = name,
  2262. Font = Enum.Font.Gotham,
  2263. TextXAlignment = Enum.TextXAlignment.Left,
  2264. Parent = keybind
  2265. })
  2266.  
  2267. local value = utility.create("TextLabel", {
  2268. ZIndex = 3,
  2269. Size = UDim2.new(0, 0, 1, 0),
  2270. BackgroundTransparency = 1,
  2271. Position = UDim2.new(1, 0, 0, 0),
  2272. FontSize = Enum.FontSize.Size14,
  2273. TextSize = 13,
  2274. TextColor3 = Color3.fromRGB(180, 180, 180),
  2275. Text = default and (keys[default] or tostring(default):gsub("Enum.KeyCode.", "")) or "NONE",
  2276. Font = Enum.Font.Gotham,
  2277. TextXAlignment = Enum.TextXAlignment.Right,
  2278. Parent = keybind
  2279. })
  2280.  
  2281.  
  2282. keybind.MouseButton1Click:Connect(function()
  2283. value.Text = "..."
  2284. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2285.  
  2286.  
  2287. local binding
  2288. binding = inputService.InputBegan:Connect(function(input)
  2289. local key = keys[input.KeyCode] or keys[input.UserInputType]
  2290. value.Text = (keys[key] or tostring(input.KeyCode):gsub("Enum.KeyCode.", ""))
  2291. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2292.  
  2293.  
  2294. if input.UserInputType == Enum.UserInputType.Keyboard then
  2295. if not table.find(blacklist, input.KeyCode) then
  2296. keyChosen = input.KeyCode
  2297.  
  2298.  
  2299. if flag then
  2300. library.flags[flag] = input.KeyCode
  2301. end
  2302.  
  2303.  
  2304. binding:Disconnect()
  2305. else
  2306. keyChosen = nil
  2307. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2308. value.Text = "NONE"
  2309.  
  2310. if flag then
  2311. library.flags[flag] = nil
  2312. end
  2313.  
  2314.  
  2315. binding:Disconnect()
  2316. end
  2317. else
  2318. if not table.find(blacklist, input.UserInputType) then
  2319. keyChosen = input.UserInputType
  2320.  
  2321.  
  2322. if flag then
  2323. library.flags[flag] = input.UserInputType
  2324. end
  2325.  
  2326.  
  2327. binding:Disconnect()
  2328. else
  2329. keyChosen = nil
  2330. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2331. value.Text = "NONE"
  2332.  
  2333. if flag then
  2334. library.flags[flag] = nil
  2335. end
  2336.  
  2337.  
  2338. binding:Disconnect()
  2339. end
  2340. end
  2341. end)
  2342. end)
  2343.  
  2344.  
  2345. inputService.InputBegan:Connect(function(input)
  2346. if input.UserInputType == Enum.UserInputType.Keyboard then
  2347. if input.KeyCode == keyChosen then
  2348. callback(keyChosen)
  2349. end
  2350. else
  2351. if input.UserInputType == keyChosen then
  2352. callback(keyChosen)
  2353. end
  2354. end
  2355. end)
  2356.  
  2357.  
  2358. local keybindTypes = utility.table()
  2359.  
  2360.  
  2361. function keybindTypes:Show()
  2362. keybind.Visible = true
  2363. end
  2364.  
  2365.  
  2366. function keybindTypes:Hide()
  2367. keybind.Visible = false
  2368. end
  2369.  
  2370.  
  2371. function keybindTypes:SetName(str)
  2372. title.Text = str
  2373. end
  2374.  
  2375.  
  2376. function keybindTypes:Set(newKey)
  2377. if typeof(newKey) == "EnumItem" then
  2378. if not table.find(blacklist, newKey) then
  2379. local key = keys[newKey]
  2380. value.Text = (keys[key] or tostring(newKey):gsub("Enum.KeyCode.", ""))
  2381. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2382.  
  2383. keyChosen = newKey
  2384.  
  2385. if flag then
  2386. library.flags[flag] = newKey
  2387. end
  2388. else
  2389. keyChosen = nil
  2390. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2391. value.Text = "NONE"
  2392.  
  2393.  
  2394. if flag then
  2395. library.flags[flag] = nil
  2396. end
  2397. end
  2398. end
  2399. end
  2400.  
  2401.  
  2402. if flag then
  2403. flags.keybinds[flag] = function(key)
  2404. keybindTypes:Set(key)
  2405. end
  2406. end
  2407.  
  2408.  
  2409. return keybindTypes
  2410. end
  2411.  
  2412.  
  2413. function sectionTypes:ToggleKeybind(opts)
  2414. local options = utility.table(opts)
  2415. local name = options.name or "Toggle Keybind"
  2416. local default = options.default
  2417. local blacklist = options.blacklist or {}
  2418. local toggleFlag = options.toggleFlag
  2419. local keybindFlag = options.keybindFlag
  2420. local toggleCallback = options.toggleCallback or function() end
  2421. local keybindCallback = options.keybindCallback or function() end
  2422.  
  2423.  
  2424. local keys = {
  2425. [Enum.KeyCode.LeftShift] = "Left Shift";
  2426. [Enum.KeyCode.RightShift] = "Right Shift";
  2427. [Enum.KeyCode.LeftControl] = "Left Ctrl";
  2428. [Enum.KeyCode.RightControl] = "Right Ctrl";
  2429. [Enum.KeyCode.LeftAlt] = "Left Alt";
  2430. [Enum.KeyCode.RightAlt] = "Right Alt";
  2431. [Enum.KeyCode.CapsLock] = "CapsLock";
  2432. [Enum.KeyCode.One] = "1";
  2433. [Enum.KeyCode.Two] = "2";
  2434. [Enum.KeyCode.Three] = "3";
  2435. [Enum.KeyCode.Four] = "4";
  2436. [Enum.KeyCode.Five] = "5";
  2437. [Enum.KeyCode.Six] = "6";
  2438. [Enum.KeyCode.Seven] = "7";
  2439. [Enum.KeyCode.Eight] = "8";
  2440. [Enum.KeyCode.Nine] = "9";
  2441. [Enum.KeyCode.Zero] = "0";
  2442. [Enum.KeyCode.KeypadOne] = "Num 1";
  2443. [Enum.KeyCode.KeypadTwo] = "Num 2";
  2444. [Enum.KeyCode.KeypadThree] = "Num 3";
  2445. [Enum.KeyCode.KeypadFour] = "Num 4";
  2446. [Enum.KeyCode.KeypadFive] = "Num 5";
  2447. [Enum.KeyCode.KeypadSix] = "Num 6";
  2448. [Enum.KeyCode.KeypadSeven] = "Num 7";
  2449. [Enum.KeyCode.KeypadEight] = "Num 8";
  2450. [Enum.KeyCode.KeypadNine] = "Num 9";
  2451. [Enum.KeyCode.KeypadZero] = "Num 0";
  2452. [Enum.KeyCode.Minus] = "-";
  2453. [Enum.KeyCode.Equals] = "=";
  2454. [Enum.KeyCode.Tilde] = "~";
  2455. [Enum.KeyCode.LeftBracket] = "[";
  2456. [Enum.KeyCode.RightBracket] = "]";
  2457. [Enum.KeyCode.RightParenthesis] = ")";
  2458. [Enum.KeyCode.LeftParenthesis] = "(";
  2459. [Enum.KeyCode.Semicolon] = ";";
  2460. [Enum.KeyCode.Quote] = "'";
  2461. [Enum.KeyCode.BackSlash] = "\\";
  2462. [Enum.KeyCode.Comma] = ";";
  2463. [Enum.KeyCode.Period] = ".";
  2464. [Enum.KeyCode.Slash] = "/";
  2465. [Enum.KeyCode.Asterisk] = "*";
  2466. [Enum.KeyCode.Plus] = "+";
  2467. [Enum.KeyCode.Period] = ".";
  2468. [Enum.KeyCode.Backquote] = "`";
  2469. [Enum.UserInputType.MouseButton1] = "Mouse 1";
  2470. [Enum.UserInputType.MouseButton2] = "Mouse 2";
  2471. [Enum.UserInputType.MouseButton3] = "Mouse 3"
  2472. }
  2473.  
  2474.  
  2475. local toggled = false
  2476. local keyChosen = default
  2477.  
  2478.  
  2479. if toggleFlag then
  2480. library.flags[toggleFlag] = toggled
  2481. end
  2482.  
  2483.  
  2484. if keybindFlag then
  2485. library.flags[keybindFlag] = default
  2486. end
  2487.  
  2488.  
  2489. local toggleKeybind = utility.create("TextButton", {
  2490. Size = UDim2.new(1, 0, 0, 16),
  2491. BackgroundTransparency = 1,
  2492. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2493. FontSize = Enum.FontSize.Size14,
  2494. TextSize = 14,
  2495. TextColor3 = Color3.fromRGB(0, 0, 0),
  2496. Font = Enum.Font.SourceSans,
  2497. Parent = sectionContent
  2498. })
  2499.  
  2500.  
  2501. local title = utility.create("TextLabel", {
  2502. ZIndex = 3,
  2503. Size = UDim2.new(0, 0, 1, 0),
  2504. BackgroundTransparency = 1,
  2505. Position = UDim2.new(0, 21, 0, 0),
  2506. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2507. FontSize = Enum.FontSize.Size14,
  2508. TextSize = 13,
  2509. TextColor3 = Color3.fromRGB(255, 255, 255),
  2510. Text = name,
  2511. Font = Enum.Font.Gotham,
  2512. TextXAlignment = Enum.TextXAlignment.Left,
  2513. Parent = toggleKeybind
  2514. })
  2515.  
  2516.  
  2517. local icon = utility.create("Frame", {
  2518. ZIndex = 3,
  2519. Size = UDim2.new(0, 14, 1, -2),
  2520. BorderColor3 = Color3.fromRGB(37, 37, 37),
  2521. Position = UDim2.new(0, 0, 0, 1),
  2522. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2523. Parent = toggleKeybind
  2524. })
  2525.  
  2526. local iconGradient = utility.create("UIGradient", {
  2527. Rotation = 90,
  2528. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  2529. Parent = icon
  2530. })
  2531.  
  2532. local value = utility.create("TextButton", {
  2533. ZIndex = 3,
  2534. BackgroundTransparency = 1,
  2535. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2536. FontSize = Enum.FontSize.Size14,
  2537. TextSize = 13,
  2538. TextColor3 = Color3.fromRGB(180, 180, 180),
  2539. Text = default and (keys[default] or tostring(default):gsub("Enum.KeyCode.", "")) or "NONE",
  2540. Font = Enum.Font.Gotham,
  2541. TextXAlignment = Enum.TextXAlignment.Right,
  2542. Parent = toggleKeybind
  2543. })
  2544.  
  2545.  
  2546. value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2547. value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2548.  
  2549.  
  2550. local function toggleToggle()
  2551. toggled = not toggled
  2552.  
  2553.  
  2554. if toggled then
  2555. table.insert(coloredGradients, iconGradient)
  2556. else
  2557. table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  2558. end
  2559.  
  2560.  
  2561. local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  2562. local gradientColor
  2563. if toggled then
  2564. gradientColor = ColorSequence.new{
  2565. ColorSequenceKeypoint.new(0, library.color),
  2566. ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  2567. }
  2568. else
  2569. gradientColor = ColorSequence.new{
  2570. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  2571. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  2572. }
  2573. end
  2574.  
  2575.  
  2576. iconGradient.Color = gradientColor
  2577. title.TextColor3 = textColor
  2578.  
  2579.  
  2580. if toggleFlag then
  2581. library.flags[toggleFlag] = toggled
  2582. end
  2583.  
  2584.  
  2585. toggleCallback(toggled)
  2586. end
  2587.  
  2588.  
  2589. toggleKeybind.MouseButton1Click:Connect(toggleToggle)
  2590.  
  2591.  
  2592. value.MouseButton1Click:Connect(function()
  2593. value.Text = "..."
  2594. value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2595. value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2596. value.TextColor3 = Color3.fromRGB(255, 255, 255)
  2597.  
  2598. local binding
  2599. binding = inputService.InputBegan:Connect(function(input)
  2600. local key = keys[input.KeyCode] or keys[input.UserInputType]
  2601. value.Text = (keys[key] or tostring(input.KeyCode):gsub("Enum.KeyCode.", ""))
  2602. value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2603. value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2604. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2605.  
  2606. if input.UserInputType == Enum.UserInputType.Keyboard then
  2607. if not table.find(blacklist, input.KeyCode) then
  2608. keyChosen = input.KeyCode
  2609.  
  2610. if keybindFlag then
  2611. library.flags[keybindFlag] = input.KeyCode
  2612. end
  2613.  
  2614. binding:Disconnect()
  2615. else
  2616. keyChosen = nil
  2617. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2618. value.Text = "NONE"
  2619. value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2620. value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2621.  
  2622. if keybindFlag then
  2623. library.flags[keybindFlag] = nil
  2624. end
  2625.  
  2626. binding:Disconnect()
  2627. end
  2628. else
  2629. if not table.find(blacklist, input.UserInputType) then
  2630. keyChosen = input.UserInputType
  2631.  
  2632. if keybindFlag then
  2633. library.flags[keybindFlag] = input.UserInputType
  2634. end
  2635.  
  2636. binding:Disconnect()
  2637. else
  2638. keyChosen = nil
  2639. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2640. value.Text = "NONE"
  2641. value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2642. value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2643.  
  2644. if keybindFlag then
  2645. library.flags[keybindFlag] = nil
  2646. end
  2647.  
  2648. binding:Disconnect()
  2649. end
  2650. end
  2651. end)
  2652. end)
  2653.  
  2654. inputService.InputBegan:Connect(function(input)
  2655. if input.UserInputType == Enum.UserInputType.Keyboard then
  2656. if input.KeyCode == keyChosen then
  2657. toggleToggle()
  2658. keybindCallback(keyChosen)
  2659. end
  2660. else
  2661. if input.UserInputType == keyChosen then
  2662. toggleToggle()
  2663. keybindCallback(keyChosen)
  2664. end
  2665. end
  2666. end)
  2667.  
  2668. local toggleKeybindTypes = utility.table()
  2669.  
  2670. function toggleKeybindTypes:Show()
  2671. keybind.Visible = true
  2672. end
  2673.  
  2674. function toggleKeybindTypes:Hide()
  2675. keybind.Visible = false
  2676. end
  2677.  
  2678. function toggleKeybindTypes:SetName(str)
  2679. title.Text = str
  2680. end
  2681.  
  2682.  
  2683. function toggleKeybindTypes:Toggle(bool)
  2684. if toggled ~= bool then
  2685. toggleToggle()
  2686. end
  2687. end
  2688.  
  2689. function toggleKeybindTypes:Set(newKey)
  2690. if typeof(newKey) == "EnumItem" then
  2691. if not table.find(blacklist, newKey) then
  2692. local key = keys[newKey]
  2693. value.Text = (keys[key] or tostring(newKey):gsub("Enum.KeyCode.", ""))
  2694. value.Size = UDim2.new(0, value.TextBounds.X, 1, 0)
  2695. value.Position = UDim2.new(1, -value.TextBounds.X, 0, 0)
  2696. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2697.  
  2698. keyChosen = newKey
  2699.  
  2700. if keybindFlag then
  2701. library.flags[keybindFlag] = newKey
  2702. end
  2703. else
  2704. keyChosen = nil
  2705. value.TextColor3 = Color3.fromRGB(180, 180, 180)
  2706. value.Text = "NONE"
  2707.  
  2708. if keybindFlag then
  2709. library.flags[keybindFlag] = nil
  2710. end
  2711. end
  2712. end
  2713. end
  2714.  
  2715. if keybindFlag then
  2716. flags.keybinds[keybindFlag] = function(key)
  2717. toggleKeybindTypes:Set(key)
  2718. end
  2719. end
  2720.  
  2721.  
  2722. if toggleFlag then
  2723. flags.toggles[toggleFlag] = function(bool)
  2724. toggleKeybindTypes:Toggle(bool)
  2725. end
  2726. end
  2727.  
  2728. return toggleKeybindTypes
  2729. end
  2730.  
  2731.  
  2732. function sectionTypes:ColorPicker(opts)
  2733. local options = utility.table(opts)
  2734. local name = options.name or "Color Picker"
  2735. local default = options.default or Color3.fromRGB(255, 255, 255)
  2736. local flag = options.flag
  2737. local callback = options.callback or function() end
  2738.  
  2739.  
  2740. local open = false
  2741. local hue, sat, val = default:ToHSV()
  2742.  
  2743.  
  2744. local slidingHue = false
  2745. local slidingSaturation = false
  2746.  
  2747.  
  2748. local hsv = Color3.fromHSV(hue, sat, val)
  2749.  
  2750.  
  2751. if flag then
  2752. library.flags[flag] = default
  2753. end
  2754.  
  2755.  
  2756.  
  2757. local colorPickerHolder = utility.create("Frame", {
  2758. Size = UDim2.new(1, 0, 0, 16),
  2759. Position = UDim2.new(0, 0, 0, 0),
  2760. BackgroundTransparency = 1,
  2761. Parent = sectionContent
  2762. })
  2763.  
  2764.  
  2765. local colorPicker = utility.create("TextButton", {
  2766. Size = UDim2.new(1, 0, 0, 16),
  2767. BackgroundTransparency = 1,
  2768. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2769. FontSize = Enum.FontSize.Size14,
  2770. TextSize = 14,
  2771. TextColor3 = Color3.fromRGB(0, 0, 0),
  2772. Font = Enum.Font.SourceSans,
  2773. Parent = colorPickerHolder
  2774. })
  2775.  
  2776. local title = utility.create("TextLabel", {
  2777. ZIndex = 3,
  2778. Size = UDim2.new(0, 0, 1, 0),
  2779. BackgroundTransparency = 1,
  2780. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2781. FontSize = Enum.FontSize.Size14,
  2782. TextSize = 13,
  2783. TextColor3 = Color3.fromRGB(255, 255, 255),
  2784. Text = name,
  2785. Font = Enum.Font.Gotham,
  2786. TextXAlignment = Enum.TextXAlignment.Left,
  2787. Parent = colorPicker
  2788. })
  2789.  
  2790. local icon = utility.create("Frame", {
  2791. ZIndex = 3,
  2792. Size = UDim2.new(0, 22, 0, 14),
  2793. BorderColor3 = Color3.fromRGB(22, 22, 22),
  2794. Position = UDim2.new(1, -22, 0, 1),
  2795. BackgroundColor3 = default,
  2796. Parent = colorPicker
  2797. })
  2798.  
  2799. local iconGradient = utility.create("UIGradient", {
  2800. Rotation = 90,
  2801. Color = ColorSequence.new{
  2802. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
  2803. ColorSequenceKeypoint.new(1, Color3.fromRGB(105, 105, 105))
  2804. },
  2805. Parent = icon
  2806. })
  2807.  
  2808. local picker = utility.create("Frame", {
  2809. ZIndex = 12,
  2810. Visible = false,
  2811. Size = UDim2.new(1, -8, 0, 183),
  2812. ClipsDescendants = true,
  2813. BorderColor3 = Color3.fromRGB(22, 22, 22),
  2814. Position = UDim2.new(0, 12, 1, 3),
  2815. BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  2816. Parent = colorPicker
  2817. })
  2818.  
  2819. local saturationFrame = utility.create("ImageLabel", {
  2820. ZIndex = 13,
  2821. Size = UDim2.new(1, -29, 0, 130),
  2822. BorderColor3 = Color3.fromRGB(22, 22, 22),
  2823. Position = UDim2.new(0, 5, 0, 5),
  2824. BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  2825. Image = "http://www.roblox.com/asset/?id=8630797271",
  2826. Parent = picker
  2827. })
  2828.  
  2829. local saturationPicker = utility.create("Frame", {
  2830. ZIndex = 15,
  2831. Size = UDim2.new(0, 4, 0, 4),
  2832. Position = UDim2.new(0, 5, 0, 5),
  2833. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2834. BorderColor3 = Color3.fromRGB(0, 0, 0),
  2835. BorderSizePixel = 1,
  2836. Parent = saturationFrame
  2837. })
  2838.  
  2839. local hueFrame = utility.create("ImageLabel", {
  2840. ZIndex = 13,
  2841. Size = UDim2.new(0, 14, 0, 130),
  2842. ClipsDescendants = true,
  2843. BorderColor3 = Color3.fromRGB(22, 22, 22),
  2844. BackgroundTransparency = 1,
  2845. Position = UDim2.new(1, -19, 0, 5),
  2846. BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  2847. ScaleType = Enum.ScaleType.Crop,
  2848. Image = "http://www.roblox.com/asset/?id=8630799159",
  2849. Parent = picker
  2850. })
  2851.  
  2852. local huePicker = utility.create("Frame", {
  2853. ZIndex = 15,
  2854. Size = UDim2.new(1, 0, 0, 2),
  2855. Position = UDim2.new(0, 0, 0, 10),
  2856. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2857. BorderColor3 = Color3.fromRGB(0, 0, 0),
  2858. BorderSizePixel = 1,
  2859. Parent = hueFrame
  2860. })
  2861.  
  2862. local rgb = utility.create("TextBox", {
  2863. ZIndex = 14,
  2864. Size = UDim2.new(1, -10, 0, 16),
  2865. BackgroundTransparency = 1,
  2866. Position = UDim2.new(0, 5, 1, -42),
  2867. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2868. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  2869. FontSize = Enum.FontSize.Size12,
  2870. TextSize = 12,
  2871. TextColor3 = Color3.fromRGB(255, 255, 255),
  2872. Text = table.concat({utility.get_rgb(default)}, ", "),
  2873. ClearTextOnFocus = false,
  2874. Font = Enum.Font.Gotham,
  2875. PlaceholderText = "R, G, B",
  2876. Parent = picker
  2877. })
  2878.  
  2879. local bg = utility.create("Frame", {
  2880. ZIndex = 13,
  2881. Size = UDim2.new(1, 0, 1, 0),
  2882. BorderColor3 = Color3.fromRGB(22, 22, 22),
  2883. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2884. Parent = rgb
  2885. })
  2886.  
  2887. utility.create("UIGradient", {
  2888. Rotation = 90,
  2889. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  2890. Parent = bg
  2891. })
  2892.  
  2893. local hex = utility.create("TextBox", {
  2894. ZIndex = 14,
  2895. Size = UDim2.new(1, -10, 0, 16),
  2896. BackgroundTransparency = 1,
  2897. Position = UDim2.new(0, 5, 1, -21),
  2898. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  2899. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  2900. FontSize = Enum.FontSize.Size12,
  2901. TextSize = 12,
  2902. TextColor3 = Color3.fromRGB(255, 255, 255),
  2903. Text = utility.rgb_to_hex(default),
  2904. ClearTextOnFocus = false,
  2905. Font = Enum.Font.Gotham,
  2906. PlaceholderText = utility.rgb_to_hex(default),
  2907. Parent = picker
  2908. })
  2909.  
  2910. local bg = utility.create("Frame", {
  2911. ZIndex = 13,
  2912. Size = UDim2.new(1, 0, 1, 0),
  2913. BorderColor3 = Color3.fromRGB(22, 22, 22),
  2914. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2915. Parent = hex
  2916. })
  2917.  
  2918. utility.create("UIGradient", {
  2919. Rotation = 90,
  2920. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  2921. Parent = bg
  2922. })
  2923.  
  2924.  
  2925. local function openPicker()
  2926. open = not open
  2927. picker.Visible = open
  2928. colorPickerHolder.Size = UDim2.new(1, 0, 0, open and colorPicker.AbsoluteSize.Y + picker.AbsoluteSize.Y + 3 or 16)
  2929. end
  2930.  
  2931.  
  2932. colorPicker.MouseButton1Click:connect(openPicker)
  2933.  
  2934.  
  2935. local function updateHue(input)
  2936. local sizeY = 1 - math.clamp((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y, 0, 1)
  2937. local posY = math.clamp(((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 2)
  2938. huePicker.Position = UDim2.new(0, 0, 0, posY)
  2939.  
  2940.  
  2941. hue = sizeY
  2942.  
  2943.  
  2944. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2945. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2946.  
  2947.  
  2948. hsv = Color3.fromHSV(hue, sat, val)
  2949. saturationFrame.BackgroundColor3 = hsv
  2950. icon.BackgroundColor3 = hsv
  2951.  
  2952.  
  2953. if flag then
  2954. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2955. end
  2956.  
  2957.  
  2958. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2959. end
  2960.  
  2961.  
  2962. hueFrame.InputBegan:Connect(function(input)
  2963. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2964. slidingHue = true
  2965. updateHue(input)
  2966. end
  2967. end)
  2968.  
  2969.  
  2970. hueFrame.InputEnded:Connect(function(input)
  2971. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2972. slidingHue = false
  2973. end
  2974. end)
  2975.  
  2976.  
  2977. inputService.InputChanged:Connect(function(input)
  2978. if input.UserInputType == Enum.UserInputType.MouseMovement then
  2979. if slidingHue then
  2980. updateHue(input)
  2981. end
  2982. end
  2983. end)
  2984.  
  2985.  
  2986. local function updateSatVal(input)
  2987. local sizeX = math.clamp((input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X, 0, 1)
  2988. local sizeY = 1 - math.clamp((input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y, 0, 1)
  2989. local posY = math.clamp(((input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y) * saturationFrame.AbsoluteSize.Y, 0, saturationFrame.AbsoluteSize.Y - 4)
  2990. local posX = math.clamp(((input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X) * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)
  2991.  
  2992.  
  2993. saturationPicker.Position = UDim2.new(0, posX, 0, posY)
  2994.  
  2995.  
  2996. sat = sizeX
  2997. val = sizeY
  2998.  
  2999.  
  3000. hsv = Color3.fromHSV(hue, sat, val)
  3001.  
  3002.  
  3003. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3004. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3005.  
  3006.  
  3007. saturationFrame.BackgroundColor3 = hsv
  3008. icon.BackgroundColor3 = hsv
  3009.  
  3010.  
  3011. if flag then
  3012. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3013. end
  3014.  
  3015.  
  3016. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3017. end
  3018.  
  3019.  
  3020. saturationFrame.InputBegan:Connect(function(input)
  3021. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3022. slidingSaturation = true
  3023. updateSatVal(input)
  3024. end
  3025. end)
  3026.  
  3027.  
  3028. saturationFrame.InputEnded:Connect(function(input)
  3029. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3030. slidingSaturation = false
  3031. end
  3032. end)
  3033.  
  3034.  
  3035. inputService.InputChanged:Connect(function(input)
  3036. if input.UserInputType == Enum.UserInputType.MouseMovement then
  3037. if slidingSaturation then
  3038. updateSatVal(input)
  3039. end
  3040. end
  3041. end)
  3042.  
  3043.  
  3044. local colorPickerTypes = utility.table()
  3045.  
  3046.  
  3047. function colorPickerTypes:Show()
  3048. colorPickerHolder.Visible = true
  3049. end
  3050.  
  3051. function colorPickerTypes:Hide()
  3052. colorPickerHolder.Visible = false
  3053. end
  3054.  
  3055. function colorPickerTypes:SetName(str)
  3056. title.Text = str
  3057. end
  3058.  
  3059.  
  3060. function colorPickerTypes:SetRGB(color)
  3061. hue, sat, val = color:ToHSV()
  3062. hsv = Color3.fromHSV(hue, sat, val)
  3063.  
  3064.  
  3065. saturationFrame.BackgroundColor3 = hsv
  3066. icon.BackgroundColor3 = hsv
  3067. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturationFrame.AbsoluteSize.Y, 0, saturationFrame.AbsoluteSize.Y - 4)))
  3068. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  3069.  
  3070.  
  3071. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3072. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3073.  
  3074.  
  3075. if flag then
  3076. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3077. end
  3078.  
  3079.  
  3080. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3081. end
  3082.  
  3083.  
  3084. function colorPickerTypes:SetHex(hexValue)
  3085. color = utility.hex_to_rgb(hexValue)
  3086.  
  3087. hue, sat, val = color:ToHSV()
  3088. hsv = Color3.fromHSV(hue, sat, val)
  3089.  
  3090.  
  3091. saturationFrame.BackgroundColor3 = hsv
  3092. icon.BackgroundColor3 = hsv
  3093. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturationFrame.AbsoluteSize.Y, 0, saturationFrame.AbsoluteSize.Y - 4)))
  3094. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  3095.  
  3096.  
  3097. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3098. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3099.  
  3100.  
  3101. if flag then
  3102. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3103. end
  3104.  
  3105.  
  3106. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3107. end
  3108.  
  3109.  
  3110. rgb.FocusLost:Connect(function()
  3111. local _, amount = rgb.Text:gsub(", ", "")
  3112. if amount == 2 then
  3113. local values = rgb.Text:split(", ")
  3114. local r, g, b = math.clamp(values[1], 0, 255), math.clamp(values[2], 0, 255), math.clamp(values[3], 0, 255)
  3115. colorPickerTypes:SetRGB(Color3.fromRGB(r, g, b))
  3116. else
  3117. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3118. end
  3119. end)
  3120.  
  3121. hex.FocusLost:Connect(function()
  3122. if hex.Text:find("#") and hex.Text:len() == 7 then
  3123. colorPickerTypes:SetHex(hex.Text)
  3124. else
  3125. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3126. end
  3127. end)
  3128.  
  3129.  
  3130. hex:GetPropertyChangedSignal("Text"):Connect(function()
  3131. if hex.Text == "" then
  3132. hex.Text = "#"
  3133. end
  3134. end)
  3135.  
  3136.  
  3137. if flag then
  3138. flags.colorpickers[flag] = function(color)
  3139. colorPickerTypes:SetRGB(color)
  3140. end
  3141. end
  3142.  
  3143.  
  3144. return colorPickerTypes
  3145. end
  3146.  
  3147.  
  3148. function sectionTypes:ToggleColorPicker(opts)
  3149. local options = utility.table(opts)
  3150. local name = options.name or "Toggle Color Picker"
  3151. local default = options.default or Color3.fromRGB(255, 255, 255)
  3152. local toggleFlag = options.toggleFlag
  3153. local colorPickerFlag = options.colorPickerFlag
  3154. local toggleCallback = options.toggleCallback or function() end
  3155. local colorPickerCallback = options.colorPickerCallback or function() end
  3156.  
  3157.  
  3158. local open = false
  3159. local toggled = false
  3160. local hue, sat, val = default:ToHSV()
  3161.  
  3162.  
  3163. local slidingHue = false
  3164. local slidingSaturation = false
  3165.  
  3166.  
  3167. local hsv = Color3.fromHSV(hue, sat, val)
  3168.  
  3169.  
  3170. if colorPickerFlag then
  3171. library.flags[colorPickerFlag] = default
  3172. end
  3173.  
  3174. if toggleFlag then
  3175. library.flags[toggleFlag] = toggled
  3176. end
  3177.  
  3178.  
  3179. toggleCallback(false)
  3180.  
  3181.  
  3182. local toggleColorPickerHolder = utility.create("Frame", {
  3183. Size = UDim2.new(1, 0, 0, 16),
  3184. Position = UDim2.new(0, 0, 0, 0),
  3185. BackgroundTransparency = 1,
  3186. Parent = sectionContent
  3187. })
  3188.  
  3189.  
  3190. local colorPicker = utility.create("TextButton", {
  3191. Size = UDim2.new(1, 0, 0, 16),
  3192. BackgroundTransparency = 1,
  3193. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3194. FontSize = Enum.FontSize.Size14,
  3195. TextSize = 14,
  3196. TextColor3 = Color3.fromRGB(0, 0, 0),
  3197. Font = Enum.Font.SourceSans,
  3198. Parent = toggleColorPickerHolder
  3199. })
  3200.  
  3201.  
  3202. local icon = utility.create("Frame", {
  3203. ZIndex = 3,
  3204. Size = UDim2.new(0, 14, 1, -2),
  3205. BorderColor3 = Color3.fromRGB(37, 37, 37),
  3206. Position = UDim2.new(0, 0, 0, 1),
  3207. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3208. Parent = colorPicker
  3209. })
  3210.  
  3211. local iconGradient = utility.create("UIGradient", {
  3212. Rotation = 90,
  3213. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3214. Parent = icon
  3215. })
  3216.  
  3217.  
  3218. local colorPickerIcon = utility.create("TextButton", {
  3219. ZIndex = 3,
  3220. Text = "",
  3221. Size = UDim2.new(0, 22, 0, 14),
  3222. BorderColor3 = Color3.fromRGB(22, 22, 22),
  3223. Position = UDim2.new(1, -22, 0, 1),
  3224. BackgroundColor3 = default,
  3225. Parent = colorPicker
  3226. })
  3227.  
  3228. local colorPickerIconGradient = utility.create("UIGradient", {
  3229. Rotation = 90,
  3230. Color = ColorSequence.new{
  3231. ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 255, 255)),
  3232. ColorSequenceKeypoint.new(1, Color3.fromRGB(105, 105, 105))
  3233. },
  3234. Parent = colorPickerIcon
  3235. })
  3236.  
  3237. local title = utility.create("TextLabel", {
  3238. ZIndex = 3,
  3239. Size = UDim2.new(0, 0, 1, 0),
  3240. BackgroundTransparency = 1,
  3241. Position = UDim2.new(1, 7, 0, 0),
  3242. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3243. FontSize = Enum.FontSize.Size14,
  3244. TextSize = 13,
  3245. TextColor3 = Color3.fromRGB(180, 180, 180),
  3246. Text = name,
  3247. Font = Enum.Font.Gotham,
  3248. TextXAlignment = Enum.TextXAlignment.Left,
  3249. Parent = icon
  3250. })
  3251.  
  3252. local picker = utility.create("Frame", {
  3253. ZIndex = 12,
  3254. Visible = false,
  3255. Size = UDim2.new(1, -8, 0, 183),
  3256. ClipsDescendants = true,
  3257. BorderColor3 = Color3.fromRGB(22, 22, 22),
  3258. Position = UDim2.new(0, 12, 1, 3),
  3259. BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  3260. Parent = colorPicker
  3261. })
  3262.  
  3263. local saturationFrame = utility.create("ImageLabel", {
  3264. ZIndex = 13,
  3265. Size = UDim2.new(1, -29, 0, 130),
  3266. BorderColor3 = Color3.fromRGB(22, 22, 22),
  3267. Position = UDim2.new(0, 5, 0, 5),
  3268. BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  3269. Image = "http://www.roblox.com/asset/?id=8630797271",
  3270. Parent = picker
  3271. })
  3272.  
  3273. local saturationPicker = utility.create("Frame", {
  3274. ZIndex = 15,
  3275. Size = UDim2.new(0, 4, 0, 4),
  3276. Position = UDim2.new(0, 5, 0, 5),
  3277. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3278. BorderColor3 = Color3.fromRGB(0, 0, 0),
  3279. BorderSizePixel = 1,
  3280. Parent = saturationFrame
  3281. })
  3282.  
  3283. local hueFrame = utility.create("ImageLabel", {
  3284. ZIndex = 13,
  3285. Size = UDim2.new(0, 14, 0, 130),
  3286. ClipsDescendants = true,
  3287. BorderColor3 = Color3.fromRGB(22, 22, 22),
  3288. BackgroundTransparency = 1,
  3289. Position = UDim2.new(1, -19, 0, 5),
  3290. BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  3291. ScaleType = Enum.ScaleType.Crop,
  3292. Image = "http://www.roblox.com/asset/?id=8630799159",
  3293. Parent = picker
  3294. })
  3295.  
  3296. local huePicker = utility.create("Frame", {
  3297. ZIndex = 15,
  3298. Size = UDim2.new(1, 0, 0, 2),
  3299. Position = UDim2.new(0, 0, 0, 10),
  3300. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3301. BorderColor3 = Color3.fromRGB(0, 0, 0),
  3302. BorderSizePixel = 1,
  3303. Parent = hueFrame
  3304. })
  3305.  
  3306. local rgb = utility.create("TextBox", {
  3307. ZIndex = 14,
  3308. Size = UDim2.new(1, -10, 0, 16),
  3309. BackgroundTransparency = 1,
  3310. Position = UDim2.new(0, 5, 1, -42),
  3311. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  3312. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  3313. FontSize = Enum.FontSize.Size12,
  3314. TextSize = 12,
  3315. TextColor3 = Color3.fromRGB(255, 255, 255),
  3316. Text = table.concat({utility.get_rgb(default)}, ", "),
  3317. ClearTextOnFocus = false,
  3318. Font = Enum.Font.Gotham,
  3319. PlaceholderText = "R, G, B",
  3320. Parent = picker
  3321. })
  3322.  
  3323. local bg = utility.create("Frame", {
  3324. ZIndex = 13,
  3325. Size = UDim2.new(1, 0, 1, 0),
  3326. BorderColor3 = Color3.fromRGB(22, 22, 22),
  3327. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3328. Parent = rgb
  3329. })
  3330.  
  3331. utility.create("UIGradient", {
  3332. Rotation = 90,
  3333. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3334. Parent = bg
  3335. })
  3336.  
  3337. local hex = utility.create("TextBox", {
  3338. ZIndex = 14,
  3339. Size = UDim2.new(1, -10, 0, 16),
  3340. BackgroundTransparency = 1,
  3341. Position = UDim2.new(0, 5, 1, -21),
  3342. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  3343. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  3344. FontSize = Enum.FontSize.Size12,
  3345. TextSize = 12,
  3346. TextColor3 = Color3.fromRGB(255, 255, 255),
  3347. Text = utility.rgb_to_hex(default),
  3348. ClearTextOnFocus = false,
  3349. Font = Enum.Font.Gotham,
  3350. PlaceholderText = utility.rgb_to_hex(default),
  3351. Parent = picker
  3352. })
  3353.  
  3354. local bg = utility.create("Frame", {
  3355. ZIndex = 13,
  3356. Size = UDim2.new(1, 0, 1, 0),
  3357. BorderColor3 = Color3.fromRGB(22, 22, 22),
  3358. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  3359. Parent = hex
  3360. })
  3361.  
  3362. utility.create("UIGradient", {
  3363. Rotation = 90,
  3364. Color = ColorSequence.new(Color3.fromRGB(32, 32, 32), Color3.fromRGB(17, 17, 17)),
  3365. Parent = bg
  3366. })
  3367.  
  3368.  
  3369. local function toggleToggle()
  3370. toggled = not toggled
  3371.  
  3372.  
  3373. if toggled then
  3374. table.insert(coloredGradients, iconGradient)
  3375. else
  3376. table.remove(coloredGradients, table.find(coloredGradients, iconGradient))
  3377. end
  3378.  
  3379.  
  3380. local textColor = toggled and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
  3381. local gradientColor
  3382. if toggled then
  3383. gradientColor = ColorSequence.new{
  3384. ColorSequenceKeypoint.new(0, library.color),
  3385. ColorSequenceKeypoint.new(1, utility.change_color(library.color, -47))
  3386. }
  3387. else
  3388. gradientColor = ColorSequence.new{
  3389. ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 32, 32)),
  3390. ColorSequenceKeypoint.new(1, Color3.fromRGB(17, 17, 17))
  3391. }
  3392. end
  3393.  
  3394.  
  3395. iconGradient.Color = gradientColor
  3396. title.TextColor3 = textColor
  3397.  
  3398.  
  3399. if toggleFlag then
  3400. library.flags[toggleFlag] = toggled
  3401. end
  3402.  
  3403.  
  3404. toggleCallback(toggled)
  3405. end
  3406.  
  3407.  
  3408. colorPicker.MouseButton1Click:Connect(toggleToggle)
  3409.  
  3410.  
  3411. local function openPicker()
  3412. open = not open
  3413. picker.Visible = open
  3414. toggleColorPickerHolder.Size = UDim2.new(1, 0, 0, open and colorPicker.AbsoluteSize.Y + picker.AbsoluteSize.Y + 3 or 16)
  3415. end
  3416.  
  3417. colorPickerIcon.MouseButton1Click:connect(openPicker)
  3418.  
  3419. local function updateHue(input)
  3420. local sizeY = 1 - math.clamp((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y, 0, 1)
  3421. local posY = math.clamp(((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 2)
  3422. huePicker.Position = UDim2.new(0, 0, 0, posY)
  3423.  
  3424. hue = sizeY
  3425.  
  3426. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3427. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3428.  
  3429. hsv = Color3.fromHSV(hue, sat, val)
  3430. saturationFrame.BackgroundColor3 = hsv
  3431. colorPickerIcon.BackgroundColor3 = hsv
  3432.  
  3433. if colorPickerFlag then
  3434. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3435. end
  3436.  
  3437. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3438. end
  3439.  
  3440. hueFrame.InputBegan:Connect(function(input)
  3441. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3442. slidingHue = true
  3443. updateHue(input)
  3444. end
  3445. end)
  3446.  
  3447. hueFrame.InputEnded:Connect(function(input)
  3448. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3449. slidingHue = false
  3450. end
  3451. end)
  3452.  
  3453. inputService.InputChanged:Connect(function(input)
  3454. if input.UserInputType == Enum.UserInputType.MouseMovement then
  3455. if slidingHue then
  3456. updateHue(input)
  3457. end
  3458. end
  3459. end)
  3460.  
  3461. local function updateSatVal(input)
  3462. local sizeX = math.clamp((input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X, 0, 1)
  3463. local sizeY = 1 - math.clamp((input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y, 0, 1)
  3464. local posY = math.clamp(((input.Position.Y - saturationFrame.AbsolutePosition.Y) / saturationFrame.AbsoluteSize.Y) * saturationFrame.AbsoluteSize.Y, 0, saturationFrame.AbsoluteSize.Y - 4)
  3465. local posX = math.clamp(((input.Position.X - saturationFrame.AbsolutePosition.X) / saturationFrame.AbsoluteSize.X) * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)
  3466.  
  3467. saturationPicker.Position = UDim2.new(0, posX, 0, posY)
  3468.  
  3469. sat = sizeX
  3470. val = sizeY
  3471.  
  3472. hsv = Color3.fromHSV(hue, sat, val)
  3473.  
  3474. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3475. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3476.  
  3477. saturationFrame.BackgroundColor3 = hsv
  3478. colorPickerIcon.BackgroundColor3 = hsv
  3479.  
  3480. if colorPickerFlag then
  3481. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3482. end
  3483.  
  3484. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3485. end
  3486.  
  3487. saturationFrame.InputBegan:Connect(function(input)
  3488. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3489. slidingSaturation = true
  3490. updateSatVal(input)
  3491. end
  3492. end)
  3493.  
  3494. saturationFrame.InputEnded:Connect(function(input)
  3495. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  3496. slidingSaturation = false
  3497. end
  3498. end)
  3499.  
  3500. inputService.InputChanged:Connect(function(input)
  3501. if input.UserInputType == Enum.UserInputType.MouseMovement then
  3502. if slidingSaturation then
  3503. updateSatVal(input)
  3504. end
  3505. end
  3506. end)
  3507.  
  3508. local toggleColorPickerTypes = utility.table()
  3509.  
  3510. function toggleColorPickerTypes:Show()
  3511. toggleColorPickerHolder.Visible = true
  3512. end
  3513.  
  3514. function toggleColorPickerTypes:Hide()
  3515. toggleColorPickerHolder.Visible = false
  3516. end
  3517.  
  3518. function toggleColorPickerTypes:SetName(str)
  3519. title.Text = str
  3520. end
  3521.  
  3522.  
  3523. function toggleColorPickerTypes:Toggle(bool)
  3524. if toggled ~= bool then
  3525. toggleToggle()
  3526. end
  3527. end
  3528.  
  3529. function toggleColorPickerTypes:SetRGB(color)
  3530. hue, sat, val = color:ToHSV()
  3531. hsv = Color3.fromHSV(hue, sat, val)
  3532.  
  3533. saturationFrame.BackgroundColor3 = hsv
  3534. colorPickerIcon.BackgroundColor3 = hsv
  3535. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturationFrame.AbsoluteSize.Y, 0, saturationFrame.AbsoluteSize.Y - 4)))
  3536. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  3537.  
  3538. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3539. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3540.  
  3541. if colorPickerFlag then
  3542. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3543. end
  3544.  
  3545. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3546. end
  3547.  
  3548. function toggleColorPickerTypes:SetHex(hexValue)
  3549. color = utility.hex_to_rgb(hexValue)
  3550.  
  3551. hue, sat, val = color:ToHSV()
  3552. hsv = Color3.fromHSV(hue, sat, val)
  3553.  
  3554. saturationFrame.BackgroundColor3 = hsv
  3555. colorPickerIcon.BackgroundColor3 = hsv
  3556. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturationFrame.AbsoluteSize.X, 0, saturationFrame.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturationFrame.AbsoluteSize.Y, 0, saturationFrame.AbsoluteSize.Y - 4)))
  3557. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  3558.  
  3559. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3560. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3561.  
  3562. if colorPickerFlag then
  3563. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  3564. end
  3565.  
  3566. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3567. end
  3568.  
  3569. rgb.FocusLost:Connect(function()
  3570. local _, amount = rgb.Text:gsub(", ", "")
  3571. if amount == 2 then
  3572. local values = rgb.Text:split(", ")
  3573. local r, g, b = math.clamp(values[1], 0, 255), math.clamp(values[2], 0, 255), math.clamp(values[3], 0, 255)
  3574. toggleColorPickerTypes:SetRGB(Color3.fromRGB(r, g, b))
  3575. else
  3576. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  3577. end
  3578. end)
  3579.  
  3580. hex.FocusLost:Connect(function()
  3581. if hex.Text:find("#") and hex.Text:len() == 7 then
  3582. toggleColorPickerTypes:SetHex(hex.Text)
  3583. else
  3584. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  3585. end
  3586. end)
  3587.  
  3588. hex:GetPropertyChangedSignal("Text"):Connect(function()
  3589. if hex.Text == "" then
  3590. hex.Text = "#"
  3591. end
  3592. end)
  3593.  
  3594. if colorPickerFlag then
  3595. flags.colorpickers[colorPickerFlag] = function(color)
  3596. toggleColorPickerTypes:SetRGB(color)
  3597. end
  3598. end
  3599.  
  3600.  
  3601. if toggleFlag then
  3602. flags.toggles[toggleFlag] = function(bool)
  3603. toggleColorPickerTypes:Toggle(bool)
  3604. end
  3605. end
  3606.  
  3607. return toggleColorPickerTypes
  3608. end
  3609.  
  3610.  
  3611. return sectionTypes
  3612. end
  3613.  
  3614.  
  3615. return tabTypes
  3616. end
  3617.  
  3618.  
  3619. return windowTypes
  3620. end
  3621.  
  3622.  
  3623. return library
  3624. end
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement