Advertisement
Shutupdevs1

LIB

Mar 23rd, 2023 (edited)
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 114.74 KB | None | 0 0
  1. local inputService = game:GetService("UserInputService")
  2. local tweenService = game:GetService("TweenService")
  3. local runService = game:GetService("RunService")
  4. local coreGui = game:GetService("CoreGui")
  5.  
  6. local library = {flags = {}, toggled = true, keybind = Enum.KeyCode.LeftControl, dragSpeed = 0.1, message = "- Exoify | [LEFTCONTROL] To Close Menu"}
  7.  
  8. local themes = {
  9. Dark = {
  10. TextColor = Color3.fromRGB(255, 255, 255),
  11. MainFrame = Color3.fromRGB(30, 30, 30),
  12. TabBackground = Color3.fromRGB(20, 20, 20),
  13. Tab = Color3.fromRGB(30, 30, 30),
  14. EnabledText = Color3.fromRGB(255, 255, 255),
  15. DisabledText = Color3.fromRGB(180, 180, 180),
  16. TabToggleEnabled = Color3.fromRGB(30, 30, 30),
  17. TabToggleDisabled = Color3.fromRGB(5, 5, 5),
  18. TabToggleDisabledMouseOver = Color3.fromRGB(20, 20, 20),
  19. Section = Color3.fromRGB(20, 20, 20),
  20. Button = Color3.fromRGB(30, 30, 30),
  21. ButtonMouseOver = Color3.fromRGB(40, 40, 40),
  22. ToggleEnabled = Color3.fromRGB(0, 255, 1),
  23. ToggleEnabledMouseOver = Color3.fromRGB(27, 255, 28),
  24. ToggleDisabled = Color3.fromRGB(30, 30, 30),
  25. ToggleDisabledMouseOver = Color3.fromRGB(40, 40, 40),
  26. Box = Color3.fromRGB(30, 30, 30),
  27. BoxFocused = Color3.fromRGB(40, 40, 40),
  28. Slider = Color3.fromRGB(30, 30, 30),
  29. SliderMouseOver = Color3.fromRGB(40, 40, 40),
  30. SliderFill = Color3.fromRGB(0, 198, 1),
  31. SliderFillSliding = Color3.fromRGB(0, 255, 1), -- 0, 255, 1
  32. Dropdown = Color3.fromRGB(30, 30, 30),
  33. DropdownMouseOver = Color3.fromRGB(40, 40, 40),
  34. DropdownContent = Color3.fromRGB(20, 20, 20),
  35. ColorPicker = Color3.fromRGB(20, 20, 20),
  36. ColorPickerBoxes = Color3.fromRGB(30, 30, 30)
  37. },
  38. Light = {
  39. TextColor = Color3.fromRGB(40, 40, 40),
  40. Tab = Color3.fromRGB(225, 225, 225),
  41. DropdownContent = Color3.fromRGB(235, 235, 235),
  42. EnabledText = Color3.fromRGB(40, 40, 40),
  43. BoxFocused = Color3.fromRGB(215, 215, 215),
  44. SliderFill = Color3.fromRGB(179, 129, 148),
  45. Box = Color3.fromRGB(225, 225, 225),
  46. ButtonMouseOver = Color3.fromRGB(215, 215, 215),
  47. Section = Color3.fromRGB(235, 235, 235),
  48. Button = Color3.fromRGB(225, 225, 225),
  49. ToggleDisabledMouseOver = Color3.fromRGB(215, 215, 215),
  50. TabToggleDisabledMouseOver = Color3.fromRGB(235, 235, 235),
  51. ColorPicker = Color3.fromRGB(235, 235, 235),
  52. ToggleEnabled = Color3.fromRGB(179, 129, 148),
  53. DisabledText = Color3.fromRGB(75, 75, 75),
  54. ToggleDisabled = Color3.fromRGB(225, 225, 225),
  55. TabToggleDisabled = Color3.fromRGB(250, 250, 250),
  56. SliderFillSliding = Color3.fromRGB(209, 159, 178),
  57. MainFrame = Color3.fromRGB(225, 225, 225),
  58. SliderMouseOver = Color3.fromRGB(215, 215, 215),
  59. Dropdown = Color3.fromRGB(225, 225, 225),
  60. DropdownMouseOver = Color3.fromRGB(215, 215, 215),
  61. ToggleEnabledMouseOver = Color3.fromRGB(209, 159, 178),
  62. ColorPickerBoxes = Color3.fromRGB(225, 225, 225),
  63. TabBackground = Color3.fromRGB(235, 235, 235),
  64. TabToggleEnabled = Color3.fromRGB(225, 225, 225),
  65. Slider = Color3.fromRGB(225, 225, 225)
  66. }
  67. }
  68.  
  69. local themeObjects = {}
  70. for i, v in next, themes.Dark do
  71. themeObjects[i] = {}
  72. end
  73.  
  74. local utility = {version = "v0.0.1"}
  75.  
  76. function utility.starts_with(str, start)
  77. return str:sub(1, string.len(start)) == start
  78. end
  79.  
  80. function randomString(length)
  81. length = length or 10
  82. local charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
  83. local randomString = ""
  84. for i = 1, length do
  85. local randomIndex = math.random(1, #charset)
  86. randomString = randomString .. string.sub(charset, randomIndex, randomIndex)
  87. end
  88. return randomString
  89. end
  90.  
  91. function utility.create(class, properties)
  92. local obj = Instance.new(class)
  93.  
  94. local forcedProperties = {
  95. BorderSizePixel = 0,
  96. AutoButtonColor = false
  97. }
  98.  
  99. obj.Name = utility.version.."_"..randomString()
  100.  
  101.  
  102. for prop, v in next, properties do
  103. obj[prop] = v
  104. end
  105.  
  106. for prop, v in next, forcedProperties do
  107. pcall(function()
  108. obj[prop] = v
  109. end)
  110. end
  111.  
  112. return obj
  113. end
  114.  
  115. function utility.tween(obj, info, properties, callback)
  116. local anim = tweenService:Create(obj, TweenInfo.new(unpack(info)), properties)
  117. anim:Play()
  118.  
  119. if callback then
  120. anim.Completed:Connect(callback)
  121. end
  122. end
  123.  
  124. function utility.ripple(obj)
  125. local ripple = Instance.new("Frame")
  126. Instance.new("UICorner", ripple).CornerRadius = UDim.new(0, 256)
  127.  
  128. ripple.ZIndex = obj.ZIndex + 1
  129. ripple.Parent = obj
  130. ripple.Position = UDim2.new(0.5, 0, 0.5, 0)
  131. ripple.BackgroundTransparency = 0.4
  132.  
  133. utility.tween(ripple, {0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out}, {BackgroundTransparency = 1, Size = UDim2.new(0, obj.AbsoluteSize.X, 0, obj.AbsoluteSize.X), Position = UDim2.new(0.5, -obj.AbsoluteSize.X / 2, 0.5, -obj.AbsoluteSize.X / 2)}, function() ripple:Destroy() end)
  134. end
  135.  
  136. function utility.drag(obj)
  137. local start, objPosition, dragging
  138.  
  139. obj.InputBegan:Connect(function(input)
  140. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  141. dragging = true
  142. start = input.Position
  143. objPosition = obj.Position
  144. end
  145. end)
  146.  
  147. obj.InputEnded:Connect(function(input )
  148. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  149. dragging = false
  150. end
  151. end)
  152.  
  153. inputService.InputChanged:Connect(function(input)
  154. if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
  155. utility.tween(obj, {library.dragSpeed}, {Position = UDim2.new(objPosition.X.Scale, objPosition.X.Offset + (input.Position - start).X, objPosition.Y.Scale, objPosition.Y.Offset + (input.Position - start).Y)})
  156. end
  157. end)
  158. end
  159.  
  160. function utility.get_center(sizeX, sizeY)
  161. return UDim2.new(0.5, -(sizeX / 2), 0.5, -(sizeY / 2))
  162. end
  163.  
  164. function utility.hex_to_rgb(hex)
  165. return Color3.fromRGB(tonumber("0x" .. hex:sub(2, 3)), tonumber("0x" .. hex:sub(4, 5)), tonumber("0x"..hex:sub(6, 7)))
  166. end
  167.  
  168. function utility.rgb_to_hex(color)
  169. 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))
  170. end
  171.  
  172. function utility.format_table(tbl)
  173. if tbl then
  174. local oldtbl = tbl
  175. local newtbl = {}
  176. local formattedtbl = {}
  177.  
  178. for option, v in next, oldtbl do
  179. newtbl[option:lower()] = v
  180. end
  181.  
  182. setmetatable(formattedtbl, {
  183. __newindex = function(t, k, v)
  184. rawset(newtbl, k:lower(), v)
  185. end,
  186. __index = function(t, k, v)
  187. return newtbl[k:lower()]
  188. end
  189. })
  190.  
  191. return formattedtbl
  192. else
  193. return {}
  194. end
  195. end
  196.  
  197. for _,v in pairs(coreGui:getChildren()) do
  198. if v.Name:find(utility.version) then v:Destroy() end
  199. end
  200.  
  201. local venuslib = utility.create("ScreenGui", {})
  202.  
  203. -- if syn and syn.protect_gui then
  204. -- syn.protect_gui(venuslib)
  205. -- end
  206.  
  207. venuslib.Parent = coreGui
  208.  
  209. library = utility.format_table(library)
  210.  
  211. inputService.InputBegan:Connect(function(input)
  212. if input.KeyCode == library.keybind then
  213. library.toggled = not library.toggled
  214. venuslib.Enabled = library.toggled
  215. end
  216. end)
  217.  
  218. function library:Load(opts)
  219. local options = utility.format_table(opts)
  220. local name = options.name
  221. local sizeX = options.sizeX or 440
  222. local sizeY = options.sizeY or 480
  223. local theme = themes[options.theme] or themes.Dark
  224. local colorOverrides = options.colorOverrides or {}
  225.  
  226. for i, v in next, colorOverrides do
  227. if theme[i] then
  228. theme[i] = v
  229. end
  230. end
  231.  
  232. local holder = utility.create("Frame", {
  233. Size = UDim2.new(0, sizeX, 0, 26),
  234. BackgroundTransparency = 1,
  235. Position = utility.get_center(sizeX, sizeY),
  236. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  237. Parent = venuslib
  238. })
  239.  
  240. utility.create("TextLabel", {
  241. Size = UDim2.new(0, 1, 1, 0),
  242. BackgroundTransparency = 1,
  243. Position = UDim2.new(0, 8, 0, 0),
  244. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  245. FontSize = Enum.FontSize.Size14,
  246. TextSize = 14,
  247. TextColor3 = theme.TextColor,
  248. Text = name,
  249. Font = Enum.Font.Gotham,
  250. TextXAlignment = Enum.TextXAlignment.Left,
  251. ZIndex = 2,
  252. Parent = holder
  253. })
  254.  
  255. utility.drag(holder)
  256.  
  257. local main = utility.create("Frame", {
  258. Size = UDim2.new(1, 0, 0, sizeY),
  259. BackgroundColor3 = theme.MainFrame,
  260. Parent = holder
  261. })
  262.  
  263. utility.create("UICorner", {
  264. CornerRadius = UDim.new(0, 12),
  265. Parent = main
  266. })
  267.  
  268. local tabs = utility.create("Frame", {
  269. ZIndex = 2,
  270. Size = UDim2.new(1, -16, 1, -34),
  271. Position = UDim2.new(0, 8, 0, 26),
  272. BackgroundColor3 = theme.TabBackground,
  273. Parent = main
  274. })
  275.  
  276.  
  277. utility.create("UICorner", {
  278. CornerRadius = UDim.new(0, 12),
  279. Parent = tabs
  280. })
  281.  
  282. local tabToggles = utility.create("Frame", {
  283. Size = UDim2.new(1, -12, 0, 18),
  284. BackgroundTransparency = 1,
  285. Position = UDim2.new(0, 6, 0, 6),
  286. Parent = tabs
  287. })
  288.  
  289. local tabFrames = utility.create("Frame", {
  290. ZIndex = 4,
  291. Size = UDim2.new(1, -12, 1, -29),
  292. Position = UDim2.new(0, 6, 0, 24),
  293. BackgroundColor3 = theme.Tab,
  294. Parent = tabs
  295. })
  296.  
  297. utility.create("UICorner", {
  298. Parent = tabFrames
  299. })
  300.  
  301. local tabFrameHolder = utility.create("Frame", {
  302. Size = UDim2.new(1, -12, 1, -12),
  303. BackgroundTransparency = 1,
  304. Position = UDim2.new(0, 6, 0, 6),
  305. BackgroundColor3 = Color3.fromRGB(20, 20, 20),
  306. Parent = tabFrames
  307. })
  308.  
  309. utility.create("UIListLayout", {
  310. FillDirection = Enum.FillDirection.Horizontal,
  311. SortOrder = Enum.SortOrder.LayoutOrder,
  312. Padding = UDim.new(0, 4),
  313. Parent = tabToggles
  314. })
  315.  
  316. local windowTypes = {count = 0}
  317. windowTypes = utility.format_table(windowTypes)
  318.  
  319. function windowTypes:Tab(name)
  320. windowTypes.count = windowTypes.count + 1
  321. local toggled = windowTypes.count == 1
  322.  
  323. local tabToggle = utility.create("TextButton", {
  324. ZIndex = 4,
  325. BackgroundColor3 = toggled and theme.TabToggleEnabled or theme.TabToggleDisabled,
  326. Size = UDim2.new(0, 52, 1, 0),
  327. FontSize = Enum.FontSize.Size12,
  328. TextSize = 12,
  329. TextColor3 = toggled and theme.EnabledText or theme.DisabledText,
  330. Text = name,
  331. Font = Enum.Font.Gotham,
  332. Parent = tabToggles
  333. })
  334.  
  335. if tabToggle.TextBounds.X + 16 > 52 then
  336. tabToggle.Size = UDim2.new(0, tabToggle.TextBounds.X + 16, 1, 0)
  337. end
  338.  
  339. local noround = utility.create("Frame", {
  340. ZIndex = 3,
  341. Size = UDim2.new(1, 0, 1, 5),
  342. Position = UDim2.new(0, 0, 1, -10),
  343. BackgroundColor3 = toggled and theme.TabToggleEnabled or theme.TabToggleDisabled,
  344. Parent = tabToggle
  345. })
  346.  
  347. tabToggle:GetPropertyChangedSignal("BackgroundColor3"):Connect(function()
  348. noround.BackgroundColor3 = tabToggle.BackgroundColor3
  349. end)
  350.  
  351. utility.create("UICorner", {
  352. CornerRadius = UDim.new(0, 8),
  353. Parent = tabToggle
  354. })
  355.  
  356. local tab = utility.create("Frame", {
  357. Size = UDim2.new(1, 0, 1, 0),
  358. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  359. Visible = toggled,
  360. Parent = tabFrameHolder
  361. })
  362.  
  363. utility.create("UIListLayout", {
  364. FillDirection = Enum.FillDirection.Horizontal,
  365. SortOrder = Enum.SortOrder.LayoutOrder,
  366. Padding = UDim.new(0, 6),
  367. Parent = tab
  368. })
  369.  
  370. local column1 = utility.create("ScrollingFrame", {
  371. Size = UDim2.new(0.5, -3, 1, 0),
  372. BackgroundTransparency = 1,
  373. Active = true,
  374. ScrollBarThickness = 0,
  375. CanvasSize = UDim2.new(0, 0, 0, 0),
  376. Parent = tab
  377. })
  378.  
  379. local column1list = utility.create("UIListLayout", {
  380. SortOrder = Enum.SortOrder.LayoutOrder,
  381. Padding = UDim.new(0, 6),
  382. Parent = column1
  383. })
  384.  
  385. column1list:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  386. column1.CanvasSize = UDim2.new(0, 0, 0, column1list.AbsoluteContentSize.Y)
  387. end)
  388.  
  389. local column2 = utility.create("ScrollingFrame", {
  390. Size = UDim2.new(0.5, -3, 1, 0),
  391. BackgroundTransparency = 1,
  392. Active = true,
  393. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  394. ScrollBarThickness = 0,
  395. CanvasSize = UDim2.new(0, 0, 0, 0),
  396. Parent = tab
  397. })
  398.  
  399. local column2list = utility.create("UIListLayout", {
  400. SortOrder = Enum.SortOrder.LayoutOrder,
  401. Padding = UDim.new(0, 6),
  402. Parent = column2
  403. })
  404.  
  405. column2list:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  406. column2.CanvasSize = UDim2.new(0, 0, 0, column2list.AbsoluteContentSize.Y)
  407. end)
  408.  
  409. local function toggleTab()
  410. for i, v in next, tabFrameHolder:GetChildren() do
  411. if v ~= tab then
  412. v.Visible = false
  413. end
  414. end
  415.  
  416. tab.Visible = true
  417.  
  418. for i, v in next, tabToggles:GetChildren() do
  419. if v:IsA("TextButton") then
  420. if v ~= tabToggle then
  421. utility.tween(v, {0.2}, {TextColor3 = theme.DisabledText, BackgroundColor3 = theme.TabToggleDisabled})
  422. end
  423. end
  424. end
  425.  
  426. utility.tween(tabToggle, {0.2}, {TextColor3 = theme.EnabledText, BackgroundColor3 = theme.TabToggleEnabled})
  427. end
  428.  
  429. tabToggle.MouseButton1Click:Connect(toggleTab)
  430.  
  431. tabToggle.MouseEnter:Connect(function()
  432. if not tab.Visible then
  433. utility.tween(tabToggle, {0.2}, {BackgroundColor3 = theme.TabToggleDisabledMouseOver})
  434. end
  435. end)
  436.  
  437. tabToggle.MouseLeave:Connect(function()
  438. if not tab.Visible then
  439. utility.tween(tabToggle, {0.2}, {BackgroundColor3 = theme.TabToggleDisabled})
  440. end
  441. end)
  442.  
  443. local tabTypes = {}
  444. tabTypes = utility.format_table(tabTypes)
  445.  
  446. function tabTypes:Open()
  447. toggleTab()
  448. end
  449.  
  450. function tabTypes:Section(opts)
  451. local options = utility.format_table(opts)
  452. local name = options.name
  453. local column = options.column or 1
  454. column = column == 1 and column1 or column == 2 and column2
  455.  
  456. local section = utility.create("Frame", {
  457. ZIndex = 5,
  458. Size = UDim2.new(1, 0, 0, 24),
  459. BackgroundColor3 = theme.Section,
  460. Parent = column
  461. })
  462.  
  463. utility.create("UICorner", {
  464. Parent = section
  465. })
  466.  
  467. utility.create("TextLabel", {
  468. ZIndex = 6,
  469. Size = UDim2.new(0, 1, 0, 16),
  470. BackgroundTransparency = 1,
  471. Position = UDim2.new(0, 8, 0, 4),
  472. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  473. FontSize = Enum.FontSize.Size12,
  474. TextSize = 12,
  475. TextColor3 = theme.TextColor,
  476. Text = name,
  477. Font = Enum.Font.Gotham,
  478. TextXAlignment = Enum.TextXAlignment.Left,
  479. Parent = section
  480. })
  481.  
  482. local sectionContent = utility.create("Frame", {
  483. Size = UDim2.new(1, -10, 1, -24),
  484. Position = UDim2.new(0, 5, 0, 22),
  485. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  486. Parent = section
  487. })
  488.  
  489. local sectionContentList = utility.create("UIListLayout", {
  490. SortOrder = Enum.SortOrder.LayoutOrder,
  491. Padding = UDim.new(0, 6),
  492. Parent = sectionContent
  493. })
  494.  
  495. sectionContentList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  496. section.Size = UDim2.new(1, 0, 0, sectionContentList.AbsoluteContentSize.Y + 27)
  497. end)
  498.  
  499. local sectionTypes = {}
  500. sectionTypes = utility.format_table(sectionTypes)
  501.  
  502. function sectionTypes:Hide()
  503. section.Visible = false
  504. end
  505.  
  506. function sectionTypes:Show()
  507. section.Visible = true
  508. end
  509.  
  510. function sectionTypes:Label(text)
  511. local label = utility.create("TextLabel", {
  512. ZIndex = 6,
  513. Size = UDim2.new(1, 0, 0, 10),
  514. BackgroundTransparency = 1,
  515. Position = UDim2.new(1, 5, 0, 0),
  516. FontSize = Enum.FontSize.Size12,
  517. TextSize = 12,
  518. Text = text,
  519. TextColor3 = theme.TextColor,
  520. Font = Enum.Font.Gotham,
  521. TextXAlignment = Enum.TextXAlignment.Left,
  522. Parent = sectionContent
  523. })
  524.  
  525. local labelTypes = {}
  526. labelTypes = utility.format_table(labelTypes)
  527.  
  528. function labelTypes:Hide()
  529. label.Visible = false
  530. end
  531.  
  532. function labelTypes:Show()
  533. label.Visible = true
  534. end
  535.  
  536. return labelTypes
  537. end
  538.  
  539. function sectionTypes:Button(opts)
  540. local options = utility.format_table(opts)
  541. local name = options.name
  542. local callback = options.callback
  543.  
  544. local button = utility.create("TextButton", {
  545. ZIndex = 6,
  546. Size = UDim2.new(1, 0, 0, 16),
  547. BackgroundColor3 = theme.Button,
  548. FontSize = Enum.FontSize.Size12,
  549. TextSize = 12,
  550. Text = name,
  551. TextColor3 = theme.TextColor,
  552. Font = Enum.Font.Gotham,
  553. ClipsDescendants = true,
  554. Parent = sectionContent
  555. })
  556.  
  557. utility.create("UICorner", {
  558. CornerRadius = UDim.new(0, 6),
  559. Parent = button
  560. })
  561.  
  562. button.MouseButton1Click:Connect(function()
  563. callback()
  564. utility.ripple(button)
  565. end)
  566.  
  567. button.MouseEnter:Connect(function()
  568. utility.tween(button, {0.2}, {BackgroundColor3 = theme.ButtonMouseOver})
  569. end)
  570.  
  571. button.MouseLeave:Connect(function()
  572. utility.tween(button, {0.2}, {BackgroundColor3 = theme.Button})
  573. end)
  574.  
  575. local buttonTypes = {}
  576. buttonTypes = utility.format_table(buttonTypes)
  577.  
  578. function buttonTypes:Hide()
  579. button.Visible = false
  580. end
  581.  
  582. function buttonTypes:Show()
  583. button.Visible = true
  584. end
  585.  
  586. return buttonTypes
  587. end
  588.  
  589. function sectionTypes:Toggle(opts)
  590. local options = utility.format_table(opts)
  591. local name = options.name
  592. local flag = options.flag or nil
  593. local callback = options.callback or function() end
  594.  
  595. local toggled = false
  596. local mouseOver = false
  597.  
  598. local toggle = utility.create("TextButton", {
  599. Size = UDim2.new(1, 0, 0, 10),
  600. BackgroundTransparency = 1,
  601. FontSize = Enum.FontSize.Size14,
  602. TextSize = 14,
  603. Text = "",
  604. Font = Enum.Font.SourceSans,
  605. Parent = sectionContent
  606. })
  607.  
  608. local icon = utility.create("Frame", {
  609. ZIndex = 6,
  610. Size = UDim2.new(0, 10, 0, 10),
  611. BackgroundColor3 = theme.ToggleDisabled,
  612. Parent = toggle
  613. })
  614.  
  615. utility.create("UICorner", {
  616. CornerRadius = UDim.new(0, 12),
  617. Parent = icon
  618. })
  619.  
  620. local title = utility.create("TextLabel", {
  621. ZIndex = 6,
  622. Size = UDim2.new(0, 1, 0, 10),
  623. BackgroundTransparency = 1,
  624. Position = UDim2.new(1, 5, 0, 0),
  625. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  626. FontSize = Enum.FontSize.Size12,
  627. TextSize = 12,
  628. TextColor3 = theme.DisabledText,
  629. Text = name,
  630. Font = Enum.Font.Gotham,
  631. TextXAlignment = Enum.TextXAlignment.Left,
  632. Parent = icon
  633. })
  634.  
  635. local function toggleToggle()
  636. toggled = not toggled
  637.  
  638. utility.tween(title, {0.2}, {TextColor3 = toggled and theme.EnabledText or theme.DisabledText})
  639.  
  640. if not mouseOver then
  641. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabled or theme.ToggleDisabled})
  642. else
  643. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabledMouseOver or theme.ToggleDisabledMouseOver})
  644. end
  645.  
  646. callback(toggled)
  647. if flag then
  648. library.flags[flag] = toggled
  649. end
  650. end
  651.  
  652. toggle.MouseButton1Click:connect(toggleToggle)
  653.  
  654. toggle.MouseEnter:Connect(function()
  655. mouseOver = true
  656. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabledMouseOver or theme.ToggleDisabledMouseOver})
  657. end)
  658.  
  659. toggle.MouseLeave:Connect(function()
  660. mouseOver = false
  661. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabled or theme.ToggleDisabled})
  662. end)
  663.  
  664. local toggleTypes = {}
  665. toggleTypes = utility.format_table(toggleTypes)
  666.  
  667. function toggleTypes:Toggle(bool)
  668. if toggled ~= bool then
  669. toggleToggle()
  670. end
  671. end
  672.  
  673. function toggleTypes:Hide()
  674. toggle.Visible = false
  675. end
  676.  
  677. function toggleTypes:Show()
  678. toggle.Visible = true
  679. end
  680.  
  681. return toggleTypes
  682. end
  683.  
  684. function sectionTypes:Box(opts)
  685. local options = utility.format_table(opts)
  686. local placeholder = options.name or options.placeholder
  687. local default = options.default or ""
  688. local flag = options.flag or nil
  689. local callback = options.callback or nil
  690.  
  691. local mouseOver = false
  692. local focused = false
  693.  
  694. local box = utility.create("TextBox", {
  695. ZIndex = 6,
  696. Size = UDim2.new(1, 0, 0, 16),
  697. BackgroundColor3 = theme.Box,
  698. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  699. FontSize = Enum.FontSize.Size12,
  700. TextSize = 12,
  701. TextColor3 = theme.TextColor,
  702. Text = "",
  703. Font = Enum.Font.Gotham,
  704. PlaceholderText = placeholder,
  705. Parent = sectionContent
  706. })
  707.  
  708. utility.create("UICorner", {
  709. CornerRadius = UDim.new(0, 6),
  710. Parent = box
  711. })
  712.  
  713. local function boxFinished()
  714. focused = false
  715.  
  716. if not mouseOver then
  717. utility.tween(box, {0.2}, {BackgroundColor3 = theme.Box})
  718. end
  719.  
  720. if flag then
  721. library.flags[flag] = box.Text
  722. end
  723.  
  724. callback(box.Text)
  725. end
  726.  
  727. box.Focused:Connect(function()
  728. focused = true
  729. utility.tween(box, {0.2}, {BackgroundColor3 = theme.BoxFocused})
  730. end)
  731.  
  732. box.MouseEnter:Connect(function()
  733. mouseOver = true
  734. utility.tween(box, {0.2}, {BackgroundColor3 = theme.BoxFocused})
  735. end)
  736.  
  737. box.MouseLeave:Connect(function()
  738. mouseOver = false
  739. if not focused then
  740. utility.tween(box, {0.2}, {BackgroundColor3 = theme.Box})
  741. end
  742. end)
  743.  
  744. box.FocusLost:Connect(boxFinished)
  745.  
  746. local boxTypes = {}
  747. boxTypes = utility.format_table(boxTypes)
  748.  
  749. function boxTypes:Set(text)
  750. box.Text = text
  751. boxFinished()
  752. end
  753.  
  754. function boxTypes:Hide()
  755. box.Visible = false
  756. end
  757.  
  758. function boxTypes:Show()
  759. box.Visible = true
  760. end
  761.  
  762. return boxTypes
  763. end
  764.  
  765. function sectionTypes:Slider(opts)
  766. local options = utility.format_table(opts)
  767. local name = options.name
  768. local min = options.min or 1
  769. local max = options.max or 100
  770. local decimals = options.decimals or 0.1
  771. local default = options.default and math.clamp(options.default, min, max) or min
  772. local valueType = options.valueType or "/" .. tostring(max)
  773. local flag = options.flag or nil
  774. local callback = options.callback or function() end
  775.  
  776. local mouseOver = false
  777. local sliding = false
  778.  
  779. local slider = utility.create("Frame", {
  780. ZIndex = 6,
  781. Size = UDim2.new(1, 0, 0, 16),
  782. ClipsDescendants = true,
  783. BackgroundColor3 = theme.Slider,
  784. Parent = sectionContent
  785. })
  786.  
  787. utility.create("UICorner", {
  788. CornerRadius = UDim.new(0, 6),
  789. Parent = slider
  790. })
  791.  
  792. local fill = utility.create("Frame", {
  793. ZIndex = 7,
  794. Size = UDim2.new((default - min) / (max - min), 0, 1, 0),
  795. BackgroundColor3 = theme.SliderFill,
  796. Parent = slider
  797. })
  798.  
  799. utility.create("UICorner", {
  800. CornerRadius = UDim.new(0, 6),
  801. Parent = fill
  802. })
  803.  
  804. local title = utility.create("TextLabel", {
  805. ZIndex = 8,
  806. Size = UDim2.new(1, 0, 1, 0),
  807. BackgroundTransparency = 1,
  808. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  809. FontSize = Enum.FontSize.Size12,
  810. TextSize = 12,
  811. TextColor3 = theme.TextColor,
  812. Text = name .. ": " .. default .. valueType,
  813. Font = Enum.Font.Gotham,
  814. Parent = slider
  815. })
  816.  
  817. local function slide(input)
  818. local sizeX = math.clamp((input.Position.X - slider.AbsolutePosition.X) / slider.AbsoluteSize.X, 0, 1)
  819. utility.tween(fill, {0.3}, {Size = UDim2.new(sizeX, 0, 1, 0)})
  820.  
  821. local value = math.floor((((max - min) * sizeX) + min) * (decimals * 10)) / (decimals * 10)
  822. title.Text = name .. ": " .. value .. valueType
  823.  
  824. if flag then
  825. library.flags[flag] = value
  826. end
  827.  
  828. callback(value)
  829. end
  830.  
  831. slider.InputBegan:Connect(function(input)
  832. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  833. sliding = true
  834. utility.tween(fill, {0.2}, {BackgroundColor3 = theme.SliderFillSliding})
  835. slide(input)
  836. end
  837. end)
  838.  
  839. slider.InputEnded:Connect(function(input)
  840. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  841. utility.tween(fill, {0.2}, {BackgroundColor3 = theme.SliderFill})
  842. sliding = false
  843. if not mouseOver then
  844. utility.tween(slider, {0.2}, {BackgroundColor3 = theme.Slider})
  845. end
  846. end
  847. end)
  848.  
  849. slider.MouseEnter:Connect(function()
  850. mouseOver = true
  851. utility.tween(slider, {0.2}, {BackgroundColor3 = theme.SliderMouseOver})
  852. end)
  853.  
  854. slider.MouseLeave:Connect(function()
  855. mouseOver = false
  856. if not sliding then
  857. utility.tween(slider, {0.2}, {BackgroundColor3 = theme.Slider})
  858. end
  859. end)
  860.  
  861. inputService.InputChanged:Connect(function(input)
  862. if input.UserInputType == Enum.UserInputType.MouseMovement then
  863. if sliding then
  864. slide(input)
  865. end
  866. end
  867. end)
  868.  
  869. local sliderTypes = {}
  870. sliderTypes = utility.format_table(sliderTypes)
  871.  
  872. function sliderTypes:Set(value)
  873. value = math.floor(value * (decimals * 10)) / (decimals * 10)
  874. value = math.clamp(value, min, max)
  875.  
  876. fill.Size = UDim2.new((value - min) / (max - min), 0, 1, 0)
  877. title.Text = name .. ": " .. value .. valueType
  878. end
  879.  
  880. function sliderTypes:Hide()
  881. slider.Visible = false
  882. end
  883.  
  884. function sliderTypes:Show()
  885. slider.Visible = true
  886. end
  887.  
  888. return sliderTypes
  889. end
  890.  
  891. function sectionTypes:Dropdown(opts)
  892. local options = utility.format_table(opts)
  893. local default = options.default or nil
  894. local contentTable = options.content or {}
  895. local multiChoice = options.multiChoice or false
  896. local flag = options.flag or nil
  897. local callback = options.callback or function() end
  898.  
  899. local chosen = {}
  900. local curValue = default
  901. local open = false
  902. local optionInstances = {}
  903.  
  904. local defaultInContent = false
  905.  
  906. for i, v in next, contentTable do
  907. if v == default then
  908. defaultInContent = true
  909. end
  910. end
  911.  
  912. default = defaultInContent and default or nil
  913.  
  914. local dropdown = utility.create("TextButton", {
  915. ZIndex = 6,
  916. Size = UDim2.new(1, 0, 0, 16),
  917. BackgroundColor3 = theme.Dropdown,
  918. FontSize = Enum.FontSize.Size12,
  919. TextSize = 12,
  920. TextColor3 = theme.TextColor,
  921. Text = "",
  922. Font = Enum.Font.Gotham,
  923. Parent = sectionContent
  924. })
  925.  
  926. utility.create("UICorner", {
  927. CornerRadius = UDim.new(0, 6),
  928. Parent = dropdown
  929. })
  930.  
  931. local value = utility.create("TextLabel", {
  932. ZIndex = 7,
  933. Size = UDim2.new(0, 0, 1, 0),
  934. BackgroundTransparency = 1,
  935. Position = UDim2.new(0, 5, 0, 0),
  936. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  937. FontSize = Enum.FontSize.Size12,
  938. TextSize = 12,
  939. TextColor3 = default and theme.EnabledText or theme.DisabledText,
  940. Text = default or "NONE",
  941. Font = Enum.Font.Gotham,
  942. TextXAlignment = Enum.TextXAlignment.Left,
  943. Parent = dropdown
  944. })
  945.  
  946. local icon = utility.create("ImageLabel", {
  947. ZIndex = 7,
  948. Size = UDim2.new(0, 10, 0, 11),
  949. Rotation = 180,
  950. BackgroundTransparency = 1,
  951. Position = UDim2.new(1, -16, 0, 3),
  952. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  953. Image = "http://www.roblox.com/asset/?id=8233647312",
  954. Parent = dropdown
  955. })
  956.  
  957. local content = utility.create("Frame", {
  958. ZIndex = 10,
  959. Visible = false,
  960. Size = UDim2.new(1, 0, 0, 0),
  961. ClipsDescendants = true,
  962. Position = UDim2.new(0, 0, 1, 6),
  963. BackgroundColor3 = theme.DropdownContent,
  964. Parent = dropdown
  965. })
  966.  
  967. utility.create("UICorner", {
  968. CornerRadius = UDim.new(0, 6),
  969. Parent = content
  970. })
  971.  
  972. local contentHolder = utility.create("Frame", {
  973. Size = UDim2.new(1, -6, 1, 0),
  974. Position = UDim2.new(0, 6, 0, 0),
  975. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  976. Parent = content
  977. })
  978.  
  979. local contentList = utility.create("UIListLayout", {
  980. SortOrder = Enum.SortOrder.LayoutOrder,
  981. Parent = contentHolder
  982. })
  983.  
  984. local function toggleDropdown()
  985. open = not open
  986. local sizeX = UDim2.new(1, 0, 0, open and contentList.AbsoluteContentSize.Y or 0)
  987. local rotation = open and 0 or 180
  988.  
  989. if open then
  990. content.Visible = open
  991. end
  992.  
  993. utility.tween(content, {#contentTable * 0.1}, {Size = sizeX}, function() content.Visible = open end)
  994. utility.tween(icon, {0.2}, {Rotation = rotation})
  995. end
  996.  
  997. dropdown.MouseButton1Click:connect(toggleDropdown)
  998.  
  999. dropdown.MouseEnter:Connect(function()
  1000. utility.tween(dropdown, {0.2}, {BackgroundColor3 = theme.DropdownMouseOver})
  1001. end)
  1002.  
  1003. dropdown.MouseLeave:Connect(function()
  1004. utility.tween(dropdown, {0.2}, {BackgroundColor3 = theme.Dropdown})
  1005. end)
  1006.  
  1007. for i, v in next, contentTable do
  1008. local option = utility.create("TextButton", {
  1009. ZIndex = 11,
  1010. Size = UDim2.new(1, 0, 0, 16),
  1011. BackgroundTransparency = 1,
  1012. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1013. FontSize = Enum.FontSize.Size12,
  1014. TextSize = 12,
  1015. TextColor3 = v == default and theme.EnabledText or theme.DisabledText,
  1016. Text = v,
  1017. Font = Enum.Font.Gotham,
  1018. TextXAlignment = Enum.TextXAlignment.Left,
  1019. Parent = contentHolder
  1020. })
  1021.  
  1022. optionInstances[v] = option
  1023.  
  1024. if v == default then
  1025. if not multiChoice then
  1026. if flag then
  1027. library.flags[flag] = v
  1028. end
  1029.  
  1030. callback(v)
  1031. else
  1032. table.insert(chosen, v)
  1033.  
  1034. if flag then
  1035. library.flags[flag] = chosen
  1036. end
  1037.  
  1038. callback(chosen)
  1039. end
  1040. end
  1041.  
  1042. option.MouseButton1Click:connect(function()
  1043. if not multiChoice then
  1044. if curValue ~= v then
  1045. curValue = v
  1046.  
  1047. for i2, v2 in next, contentHolder:GetChildren() do
  1048. if v2:IsA("TextButton") then
  1049. utility.tween(v2, {0.2}, {TextColor3 = theme.DisabledText})
  1050. end
  1051. end
  1052.  
  1053. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1054.  
  1055. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1056. value.TextColor3 = theme.EnabledText
  1057. value.Text = v
  1058. utility.tween(value, {0.2}, {TextTransparency = 0})
  1059. end)
  1060.  
  1061. if flag then
  1062. library.flags[flag] = v
  1063. end
  1064. callback(v)
  1065. else
  1066. curValue = nil
  1067. utility.tween(option, {0.2}, {TextColor3 = theme.DisabledText})
  1068.  
  1069. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1070. value.TextColor3 = theme.DisabledText
  1071. value.Text = "NONE"
  1072. utility.tween(value, {0.2}, {TextTransparency = 0})
  1073. end)
  1074.  
  1075. if flag then
  1076. library.flags[flag] = nil
  1077. end
  1078.  
  1079. callback(nil)
  1080. end
  1081. else
  1082. if table.find(chosen, v) then
  1083. for i, v2 in next, chosen do
  1084. if v2 == v then
  1085. table.remove(chosen, i)
  1086. end
  1087. end
  1088.  
  1089. utility.tween(option, {0.2}, {TextColor3 = theme.DisabledText})
  1090.  
  1091. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1092. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1093. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1094. utility.tween(value, {0.2}, {TextTransparency = 0})
  1095. end)
  1096.  
  1097. if flag then
  1098. library.flags[flag] = chosen
  1099. end
  1100.  
  1101. callback(chosen)
  1102. else
  1103. table.insert(chosen, v)
  1104.  
  1105. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1106.  
  1107. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1108. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1109. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1110. utility.tween(value, {0.2}, {TextTransparency = 0})
  1111. end)
  1112.  
  1113. if flag then
  1114. library.flags[flag] = chosen
  1115. end
  1116.  
  1117. callback(chosen)
  1118. end
  1119. end
  1120. end)
  1121. end
  1122.  
  1123. local dropdownTypes = {}
  1124. dropdownTypes = utility.format_table(dropdownTypes)
  1125.  
  1126. function dropdownTypes:Set(opt)
  1127. if opt ~= nil then
  1128. if not multiChoice then
  1129. local optionExists = false
  1130.  
  1131. for i, v in next, contentTable do
  1132. if v == opt then
  1133. optionExists = true
  1134. end
  1135. end
  1136.  
  1137. local option = optionInstances[opt]
  1138.  
  1139. if optionExists then
  1140. curValue = opt
  1141.  
  1142. for i2, v2 in next, contentHolder:GetChildren() do
  1143. if v2:IsA("TextButton") then
  1144. v2.TextColor3 = theme.DisabledText
  1145. end
  1146. end
  1147.  
  1148. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1149.  
  1150. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1151. value.TextColor3 = theme.EnabledText
  1152. value.Text = opt
  1153. utility.tween(value, {0.2}, {TextTransparency = 0})
  1154. end)
  1155.  
  1156. if flag then
  1157. library.flags[flag] = opt
  1158. end
  1159.  
  1160. callback(opt)
  1161. end
  1162. else
  1163. if typeof(opt) == "table" then
  1164. chosen = opt
  1165.  
  1166. for i,v in next, chosen do
  1167. utility.tween(optionInstances[v], {0.2}, {TextColor3 = theme.EnabledText})
  1168. end
  1169. else
  1170. if not table.find(chosen, opt) then
  1171. table.insert(chosen, opt)
  1172.  
  1173. utility.tween(optionInstances[opt], {0.2}, {TextColor3 = theme.EnabledText})
  1174. end
  1175. end
  1176.  
  1177. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1178. value.TextColor3 = theme.EnabledText
  1179. value.Text = table.concat(chosen, ", ")
  1180. utility.tween(value, {0.2}, {TextTransparency = 0})
  1181. end)
  1182.  
  1183. if flag then
  1184. library.flags[flag] = chosen
  1185. end
  1186.  
  1187. callback(chosen)
  1188. end
  1189. else
  1190. if not multiChoice then
  1191. curValue = nil
  1192. for i2, v2 in next, contentHolder:GetChildren() do
  1193. if v2:IsA("TextButton") then
  1194. utility.tween(v2, {0.2}, {TextColor3 = theme.DisabledText})
  1195. end
  1196. end
  1197.  
  1198. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1199. value.TextColor3 = theme.DisabledText
  1200. value.Text = "NONE"
  1201. utility.tween(value, {0.2}, {TextTransparency = 0})
  1202. end)
  1203.  
  1204. if flag then
  1205. library.flags[flag] = nil
  1206. end
  1207.  
  1208. callback(nil)
  1209. else
  1210. chosen = {}
  1211.  
  1212. for i2, v2 in next, contentHolder:GetChildren() do
  1213. if v2:IsA("TextButton") then
  1214. v2.TextColor3 = theme.DisabledText
  1215. end
  1216. end
  1217.  
  1218. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1219. value.TextColor3 = theme.DisabledText
  1220. value.Text = "NONE"
  1221. utility.tween(value, {0.2}, {TextTransparency = 0})
  1222. end)
  1223.  
  1224. if flag then
  1225. library.flags[flag] = chosen
  1226. end
  1227.  
  1228. callback(chosen)
  1229. end
  1230. end
  1231. end
  1232.  
  1233. function dropdownTypes:Add(opt)
  1234. table.insert(contentTable, opt)
  1235.  
  1236. local option = utility.create("TextButton", {
  1237. ZIndex = 11,
  1238. Size = UDim2.new(1, 0, 0, 16),
  1239. BackgroundTransparency = 1,
  1240. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1241. FontSize = Enum.FontSize.Size12,
  1242. TextSize = 12,
  1243. TextColor3 = theme.DisabledText,
  1244. Text = opt,
  1245. Font = Enum.Font.Gotham,
  1246. TextXAlignment = Enum.TextXAlignment.Left,
  1247. Parent = contentHolder
  1248. })
  1249.  
  1250. optionInstances[opt] = option
  1251.  
  1252. option.MouseButton1Click:connect(function()
  1253. if not multiChoice then
  1254. if curValue ~= opt then
  1255. curValue = opt
  1256.  
  1257. for i, v in next, contentHolder:GetChildren() do
  1258. if v:IsA("TextButton") then
  1259. utility.tween(v, {0.2}, {TextColor3 = theme.DisabledText})
  1260. end
  1261. end
  1262.  
  1263. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1264.  
  1265. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1266. value.TextColor3 = theme.EnabledText
  1267. value.Text = opt
  1268. utility.tween(value, {0.2}, {TextTransparency = 0})
  1269. end)
  1270.  
  1271. if flag then
  1272. library.flags[flag] = opt
  1273. end
  1274. callback(opt)
  1275. else
  1276. curValue = nil
  1277. utility.tween(option, {0.2}, {TextColor3 = theme.DisabledText})
  1278.  
  1279. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1280. value.TextColor3 = theme.DisabledText
  1281. value.Text = "NONE"
  1282. utility.tween(value, {0.2}, {TextTransparency = 0})
  1283. end)
  1284.  
  1285. if flag then
  1286. library.flags[flag] = nil
  1287. end
  1288.  
  1289. callback(nil)
  1290. end
  1291. else
  1292. if table.find(chosen, opt) then
  1293. for i, v in next, chosen do
  1294. if v == opt then
  1295. table.remove(chosen, i)
  1296. end
  1297. end
  1298.  
  1299. utility.tween(option, {0.2}, {TextColor3 = theme.DisabledText})
  1300.  
  1301. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1302. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1303. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1304. utility.tween(value, {0.2}, {TextTransparency = 0})
  1305. end)
  1306.  
  1307. if flag then
  1308. library.flags[flag] = chosen
  1309. end
  1310.  
  1311. callback(chosen)
  1312. else
  1313. table.insert(chosen, opt)
  1314.  
  1315. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1316.  
  1317. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1318. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1319. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1320. utility.tween(value, {0.2}, {TextTransparency = 0})
  1321. end)
  1322.  
  1323. if flag then
  1324. library.flags[flag] = chosen
  1325. end
  1326.  
  1327. callback(chosen)
  1328. end
  1329. end
  1330. end)
  1331.  
  1332. if content.Visible then
  1333. local sizeX = UDim2.new(1, 0, 0, contentList.AbsoluteContentSize.Y)
  1334. utility.tween(content, {#contentTable * 0.1}, {Size = sizeX})
  1335. end
  1336. end
  1337.  
  1338. function dropdownTypes:Remove(opt)
  1339. if table.find(contentTable, opt) then
  1340. utility.tween(optionInstances[opt], {0.2}, {TextTransparency = 1}, function()
  1341. table.remove(contentTable, table.find(contentTable, opt))
  1342. optionInstances[opt]:Destroy()
  1343. table.remove(optionInstances, table.find(optionInstances, opt))
  1344. end)
  1345.  
  1346. table.remove(contentTable, table.find(contentTable, opt))
  1347.  
  1348. if content.Visible then
  1349. local sizeX = UDim2.new(1, 0, 0, contentList.AbsoluteContentSize.Y - 16)
  1350. utility.tween(content, {#contentTable * 0.1}, {Size = sizeX})
  1351. end
  1352.  
  1353. if not multiChoice then
  1354. if curValue == opt then
  1355. curValue = nil
  1356. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1357. value.TextColor3 = theme.DisabledText
  1358. value.Text = "NONE"
  1359. utility.tween(value, {0.2}, {TextTransparency = 0})
  1360. end)
  1361.  
  1362. if flag then
  1363. library.flags[flag] = nil
  1364. end
  1365.  
  1366. callback(nil)
  1367. end
  1368. else
  1369. if table.find(chosen, opt) then
  1370. table.remove(chosen, table.find(chosen, opt))
  1371.  
  1372. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1373. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1374. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1375. utility.tween(value, {0.2}, {TextTransparency = 0})
  1376. end)
  1377. end
  1378. end
  1379. end
  1380. end
  1381.  
  1382. function dropdownTypes:Refresh(tbl)
  1383. contentTable = tbl
  1384.  
  1385. for i, v in next, optionInstances do
  1386. v:Destroy()
  1387. end
  1388.  
  1389. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1390. value.TextColor3 = theme.DisabledText
  1391. value.Text = "NONE"
  1392. utility.tween(value, {0.2}, {TextTransparency = 0})
  1393. end)
  1394.  
  1395. for i, v in next, contentTable do
  1396. local option = utility.create("TextButton", {
  1397. ZIndex = 11,
  1398. Size = UDim2.new(1, 0, 0, 16),
  1399. BackgroundTransparency = 1,
  1400. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1401. FontSize = Enum.FontSize.Size12,
  1402. TextSize = 12,
  1403. TextColor3 = v == default and theme.EnabledText or theme.DisabledText,
  1404. Text = v,
  1405. Font = Enum.Font.Gotham,
  1406. TextXAlignment = Enum.TextXAlignment.Left,
  1407. Parent = contentHolder
  1408. })
  1409.  
  1410. optionInstances[v] = option
  1411.  
  1412. if v == default then
  1413. if not multiChoice then
  1414. if flag then
  1415. library.flags[flag] = v
  1416. end
  1417.  
  1418. callback(v)
  1419. else
  1420. table.insert(chosen, v)
  1421.  
  1422. if flag then
  1423. library.flags[flag] = chosen
  1424. end
  1425.  
  1426. callback(chosen)
  1427. end
  1428. end
  1429.  
  1430. option.MouseButton1Click:connect(function()
  1431. if not multiChoice then
  1432. if curValue ~= v then
  1433. curValue = v
  1434.  
  1435. for i2, v2 in next, contentHolder:GetChildren() do
  1436. if v2:IsA("TextButton") then
  1437. utility.tween(v2, {0.2}, {TextColor3 = theme.DisabledText})
  1438. end
  1439. end
  1440.  
  1441. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1442.  
  1443. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1444. value.TextColor3 = theme.EnabledText
  1445. value.Text = v
  1446. utility.tween(value, {0.2}, {TextTransparency = 0})
  1447. end)
  1448.  
  1449. if flag then
  1450. library.flags[flag] = v
  1451. end
  1452. callback(v)
  1453. else
  1454. curValue = nil
  1455. utility.tween(option, {0.2}, {TextColor3 = theme.DisabledText})
  1456.  
  1457. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1458. value.TextColor3 = theme.DisabledText
  1459. value.Text = "NONE"
  1460. utility.tween(value, {0.2}, {TextTransparency = 0})
  1461. end)
  1462.  
  1463. if flag then
  1464. library.flags[flag] = nil
  1465. end
  1466.  
  1467. callback(nil)
  1468. end
  1469. else
  1470. if table.find(chosen, v) then
  1471. for i, v2 in next, chosen do
  1472. if v2 == v then
  1473. table.remove(chosen, i)
  1474. end
  1475. end
  1476.  
  1477. utility.tween(option, {0.2}, {TextColor3 = theme.DisabledText})
  1478.  
  1479. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1480. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1481. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1482. utility.tween(value, {0.2}, {TextTransparency = 0})
  1483. end)
  1484.  
  1485. if flag then
  1486. library.flags[flag] = chosen
  1487. end
  1488.  
  1489. callback(chosen)
  1490. else
  1491. table.insert(chosen, v)
  1492.  
  1493. utility.tween(option, {0.2}, {TextColor3 = theme.EnabledText})
  1494.  
  1495. utility.tween(value, {0.2}, {TextTransparency = 1}, function()
  1496. value.TextColor3 = table.concat(chosen) ~= "" and theme.EnabledText or theme.DisabledText
  1497. value.Text = table.concat(chosen) ~= "" and table.concat(chosen, ", ") or "NONE"
  1498. utility.tween(value, {0.2}, {TextTransparency = 0})
  1499. end)
  1500.  
  1501. if flag then
  1502. library.flags[flag] = chosen
  1503. end
  1504.  
  1505. callback(chosen)
  1506. end
  1507. end
  1508. end)
  1509. end
  1510.  
  1511. if content.Visible then
  1512. local sizeX = UDim2.new(1, 0, 0, contentList.AbsoluteContentSize.Y)
  1513. utility.tween(content, {#contentTable * 0.1}, {Size = sizeX})
  1514. end
  1515. end
  1516.  
  1517. function dropdownTypes:Hide()
  1518. dropdown.Visible = false
  1519. end
  1520.  
  1521. function dropdownTypes:Show()
  1522. dropdown.Visible = true
  1523. end
  1524.  
  1525. return dropdownTypes
  1526. end
  1527.  
  1528. function sectionTypes:Keybind(opts)
  1529. local options = utility.format_table(opts)
  1530. local name = options.name
  1531. local default = options.default
  1532. local flag = options.flag or nil
  1533. local callback = options.callback or function() end
  1534.  
  1535. local keyChosen = default
  1536.  
  1537. if flag then
  1538. library.flags[flag] = default
  1539. end
  1540.  
  1541. local keys = {
  1542. [Enum.KeyCode.LeftShift] = "L-SHIFT";
  1543. [Enum.KeyCode.RightShift] = "R-SHIFT";
  1544. [Enum.KeyCode.LeftControl] = "L-CTRL";
  1545. [Enum.KeyCode.RightControl] = "R-CTRL";
  1546. [Enum.KeyCode.LeftAlt] = "L-ALT";
  1547. [Enum.KeyCode.RightAlt] = "R-ALT";
  1548. [Enum.KeyCode.CapsLock] = "CAPSLOCK";
  1549. [Enum.KeyCode.One] = "1";
  1550. [Enum.KeyCode.Two] = "2";
  1551. [Enum.KeyCode.Three] = "3";
  1552. [Enum.KeyCode.Four] = "4";
  1553. [Enum.KeyCode.Five] = "5";
  1554. [Enum.KeyCode.Six] = "6";
  1555. [Enum.KeyCode.Seven] = "7";
  1556. [Enum.KeyCode.Eight] = "8";
  1557. [Enum.KeyCode.Nine] = "9";
  1558. [Enum.KeyCode.Zero] = "0";
  1559. [Enum.KeyCode.KeypadOne] = "NUM-1";
  1560. [Enum.KeyCode.KeypadTwo] = "NUM-2";
  1561. [Enum.KeyCode.KeypadThree] = "NUM-3";
  1562. [Enum.KeyCode.KeypadFour] = "NUM-4";
  1563. [Enum.KeyCode.KeypadFive] = "NUM-5";
  1564. [Enum.KeyCode.KeypadSix] = "NUM-6";
  1565. [Enum.KeyCode.KeypadSeven] = "NUM-7";
  1566. [Enum.KeyCode.KeypadEight] = "NUM-8";
  1567. [Enum.KeyCode.KeypadNine] = "NUM-9";
  1568. [Enum.KeyCode.KeypadZero] = "NUM-0";
  1569. [Enum.KeyCode.Minus] = "-";
  1570. [Enum.KeyCode.Equals] = "=";
  1571. [Enum.KeyCode.Tilde] = "~";
  1572. [Enum.KeyCode.LeftBracket] = "[";
  1573. [Enum.KeyCode.RightBracket] = "]";
  1574. [Enum.KeyCode.RightParenthesis] = ")";
  1575. [Enum.KeyCode.LeftParenthesis] = "(";
  1576. [Enum.KeyCode.Semicolon] = ";";
  1577. [Enum.KeyCode.Quote] = "'";
  1578. [Enum.KeyCode.BackSlash] = "\\";
  1579. [Enum.KeyCode.Comma] = ";";
  1580. [Enum.KeyCode.Period] = ".";
  1581. [Enum.KeyCode.Slash] = "/";
  1582. [Enum.KeyCode.Asterisk] = "*";
  1583. [Enum.KeyCode.Plus] = "+";
  1584. [Enum.KeyCode.Period] = ".";
  1585. [Enum.KeyCode.Backquote] = "`";
  1586. [Enum.UserInputType.MouseButton1] = "MOUSE-1";
  1587. [Enum.UserInputType.MouseButton2] = "MOUSE-2";
  1588. [Enum.UserInputType.MouseButton3] = "MOUSE-3"
  1589. }
  1590.  
  1591. local keybind = utility.create("TextButton", {
  1592. ZIndex = 6,
  1593. Size = UDim2.new(1, 0, 0, 10),
  1594. BackgroundTransparency = 1,
  1595. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1596. FontSize = Enum.FontSize.Size12,
  1597. TextSize = 12,
  1598. TextColor3 = theme.TextColor,
  1599. Text = "Keybind",
  1600. Font = Enum.Font.Gotham,
  1601. TextXAlignment = Enum.TextXAlignment.Left,
  1602. Parent = sectionContent
  1603. })
  1604.  
  1605. local value = utility.create("TextLabel", {
  1606. ZIndex = 6,
  1607. Size = UDim2.new(0, 1, 0, 10),
  1608. BackgroundTransparency = 1,
  1609. Position = UDim2.new(1, -1, 0, 0),
  1610. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1611. FontSize = Enum.FontSize.Size12,
  1612. TextSize = 12,
  1613. TextColor3 = default and theme.EnabledText or theme.DisabledText,
  1614. Text = default and (keys[default] or tostring(default):gsub("Enum.KeyCode.", "")) or "NONE",
  1615. Font = Enum.Font.Gotham,
  1616. TextXAlignment = Enum.TextXAlignment.Right,
  1617. Parent = keybind
  1618. })
  1619.  
  1620. keybind.MouseButton1Click:Connect(function()
  1621. value.Text = "..."
  1622. utility.tween(value, {0.2}, {TextColor3 = theme.DisabledText})
  1623.  
  1624. local binding
  1625. binding = inputService.InputBegan:Connect(function(input)
  1626. local key = keys[input.KeyCode] or keys[input.UserInputType]
  1627. value.Text = (keys[key] or tostring(input.KeyCode):gsub("Enum.KeyCode.", ""))
  1628. utility.tween(value, {0.2}, {TextColor3 = theme.EnabledText})
  1629.  
  1630. if input.UserInputType == Enum.UserInputType.Keyboard then
  1631. keyChosen = input.KeyCode
  1632.  
  1633. if flag then
  1634. library.flags[flag] = input.KeyCode
  1635. end
  1636.  
  1637. callback(input.KeyCode)
  1638. binding:Disconnect()
  1639. else
  1640. keyChosen = input.UserInputType
  1641.  
  1642. if flag then
  1643. library.flags[flag] = input.UserInputType
  1644. end
  1645.  
  1646. callback(input.UserInputType)
  1647. binding:Disconnect()
  1648. end
  1649. end)
  1650. end)
  1651.  
  1652. inputService.InputBegan:Connect(function(input)
  1653. if input.UserInputType == Enum.UserInputType.Keyboard then
  1654. if input.KeyCode == keyChosen then
  1655. callback(keyChosen)
  1656. end
  1657. else
  1658. if input.UserInputType == keyChosen then
  1659. callback(keyChosen)
  1660. end
  1661. end
  1662. end)
  1663.  
  1664. local keybindTypes = {}
  1665. keybindTypes = utility.format_table(keybindTypes)
  1666.  
  1667. function keybindTypes:Set(newKey)
  1668. local key = keys[newKey]
  1669. value.Text = (keys[key] or tostring(newKey):gsub("Enum.KeyCode.", ""))
  1670. utility.tween(value, {0.2}, {TextColor3 = theme.EnabledText})
  1671.  
  1672. keyChosen = newKey
  1673.  
  1674. if flag then
  1675. library.flags[flag] = newKey
  1676. end
  1677.  
  1678. callback(newKey)
  1679. end
  1680.  
  1681. function keybindTypes:Hide()
  1682. keybind.Visible = false
  1683. end
  1684.  
  1685. function keybindTypes:Show()
  1686. keybind.Visible = true
  1687. end
  1688.  
  1689. return keybindTypes
  1690. end
  1691.  
  1692. function sectionTypes:ToggleKeybind(opts)
  1693. local options = utility.format_table(opts)
  1694. local name = options.name
  1695. local default = options.default
  1696. local keybindFlag = options.keybindFlag or nil
  1697. local toggleFlag = options.toggleFlag or nil
  1698. local keybindCallback = options.keybindCallback or function() end
  1699. local toggleCallback = options.toggleCallback or function() end
  1700.  
  1701. local keyChosen = default
  1702. local mouseOver = false
  1703. local toggled = false
  1704.  
  1705. if keybindFlag then
  1706. library.flags[keybindFlag] = default
  1707. end
  1708.  
  1709. local keys = {
  1710. [Enum.KeyCode.LeftShift] = "L-SHIFT";
  1711. [Enum.KeyCode.RightShift] = "R-SHIFT";
  1712. [Enum.KeyCode.LeftControl] = "L-CTRL";
  1713. [Enum.KeyCode.RightControl] = "R-CTRL";
  1714. [Enum.KeyCode.LeftAlt] = "L-ALT";
  1715. [Enum.KeyCode.RightAlt] = "R-ALT";
  1716. [Enum.KeyCode.CapsLock] = "CAPSLOCK";
  1717. [Enum.KeyCode.One] = "1";
  1718. [Enum.KeyCode.Two] = "2";
  1719. [Enum.KeyCode.Three] = "3";
  1720. [Enum.KeyCode.Four] = "4";
  1721. [Enum.KeyCode.Five] = "5";
  1722. [Enum.KeyCode.Six] = "6";
  1723. [Enum.KeyCode.Seven] = "7";
  1724. [Enum.KeyCode.Eight] = "8";
  1725. [Enum.KeyCode.Nine] = "9";
  1726. [Enum.KeyCode.Zero] = "0";
  1727. [Enum.KeyCode.KeypadOne] = "NUM-1";
  1728. [Enum.KeyCode.KeypadTwo] = "NUM-2";
  1729. [Enum.KeyCode.KeypadThree] = "NUM-3";
  1730. [Enum.KeyCode.KeypadFour] = "NUM-4";
  1731. [Enum.KeyCode.KeypadFive] = "NUM-5";
  1732. [Enum.KeyCode.KeypadSix] = "NUM-6";
  1733. [Enum.KeyCode.KeypadSeven] = "NUM-7";
  1734. [Enum.KeyCode.KeypadEight] = "NUM-8";
  1735. [Enum.KeyCode.KeypadNine] = "NUM-9";
  1736. [Enum.KeyCode.KeypadZero] = "NUM-0";
  1737. [Enum.KeyCode.Minus] = "-";
  1738. [Enum.KeyCode.Equals] = "=";
  1739. [Enum.KeyCode.Tilde] = "~";
  1740. [Enum.KeyCode.LeftBracket] = "[";
  1741. [Enum.KeyCode.RightBracket] = "]";
  1742. [Enum.KeyCode.RightParenthesis] = ")";
  1743. [Enum.KeyCode.LeftParenthesis] = "(";
  1744. [Enum.KeyCode.Semicolon] = ";";
  1745. [Enum.KeyCode.Quote] = "'";
  1746. [Enum.KeyCode.BackSlash] = "\\";
  1747. [Enum.KeyCode.Comma] = ";";
  1748. [Enum.KeyCode.Period] = ".";
  1749. [Enum.KeyCode.Slash] = "/";
  1750. [Enum.KeyCode.Asterisk] = "*";
  1751. [Enum.KeyCode.Plus] = "+";
  1752. [Enum.KeyCode.Period] = ".";
  1753. [Enum.KeyCode.Backquote] = "`";
  1754. [Enum.UserInputType.MouseButton1] = "MOUSE-1";
  1755. [Enum.UserInputType.MouseButton2] = "MOUSE-2";
  1756. [Enum.UserInputType.MouseButton3] = "MOUSE-3"
  1757. }
  1758.  
  1759. local toggleKeybind = utility.create("TextButton", {
  1760. Size = UDim2.new(1, 0, 0, 10),
  1761. BackgroundTransparency = 1,
  1762. Parent = sectionContent
  1763. })
  1764.  
  1765. local icon = utility.create("Frame", {
  1766. ZIndex = 6,
  1767. Size = UDim2.new(0, 10, 0, 10),
  1768. BackgroundColor3 = theme.ToggleDisabled,
  1769. Parent = toggleKeybind
  1770. })
  1771.  
  1772. utility.create("UICorner", {
  1773. CornerRadius = UDim.new(0, 12),
  1774. Parent = icon
  1775. })
  1776.  
  1777. local title = utility.create("TextLabel", {
  1778. ZIndex = 6,
  1779. Size = UDim2.new(0, 1, 0, 10),
  1780. BackgroundTransparency = 1,
  1781. Position = UDim2.new(1, 5, 0, 0),
  1782. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1783. FontSize = Enum.FontSize.Size12,
  1784. TextSize = 12,
  1785. TextColor3 = theme.DisabledText,
  1786. Text = name,
  1787. Font = Enum.Font.Gotham,
  1788. TextXAlignment = Enum.TextXAlignment.Left,
  1789. Parent = icon
  1790. })
  1791.  
  1792. local value = utility.create("TextButton", {
  1793. ZIndex = 6,
  1794. Size = UDim2.new(0, 1, 0, 10),
  1795. BackgroundTransparency = 1,
  1796. Position = UDim2.new(1, -1, 0, 0),
  1797. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1798. FontSize = Enum.FontSize.Size12,
  1799. TextSize = 12,
  1800. TextColor3 = default and theme.EnabledText or theme.DisabledText,
  1801. Text = default and (keys[default] or tostring(default):gsub("Enum.KeyCode.", "")) or "NONE",
  1802. Font = Enum.Font.Gotham,
  1803. TextXAlignment = Enum.TextXAlignment.Right,
  1804. Parent = toggleKeybind
  1805. })
  1806.  
  1807. value.Size = UDim2.new(0, value.TextBounds.X, 0, 10)
  1808. value.Position = UDim2.new(1, -(value.TextBounds.X), 0, 0)
  1809.  
  1810. local function toggleToggle()
  1811. toggled = not toggled
  1812.  
  1813. utility.tween(title, {0.2}, {TextColor3 = toggled and theme.EnabledText or theme.DisabledText})
  1814.  
  1815. if not mouseOver then
  1816. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabled or theme.ToggleDisabled})
  1817. else
  1818. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabledMouseOver or theme.ToggleDisabledMouseOver})
  1819. end
  1820.  
  1821. toggleCallback(toggled)
  1822. if toggleFlag then
  1823. library.flags[toggleFlag] = toggled
  1824. end
  1825. end
  1826.  
  1827. toggleKeybind.MouseButton1Click:connect(toggleToggle)
  1828.  
  1829. toggleKeybind.MouseEnter:Connect(function()
  1830. mouseOver = true
  1831. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabledMouseOver or theme.ToggleDisabledMouseOver})
  1832. end)
  1833.  
  1834. toggleKeybind.MouseLeave:Connect(function()
  1835. mouseOver = false
  1836. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabled or theme.ToggleDisabled})
  1837. end)
  1838.  
  1839. value.MouseButton1Click:Connect(function()
  1840. value.Text = "..."
  1841. utility.tween(value, {0.2}, {TextColor3 = theme.DisabledText})
  1842.  
  1843. local binding
  1844. binding = inputService.InputBegan:Connect(function(input)
  1845. local key = keys[input.KeyCode] or keys[input.UserInputType]
  1846. value.Text = key or (tostring(input.KeyCode):gsub("Enum.KeyCode.", ""))
  1847. value.Size = UDim2.new(0, value.TextBounds.X, 0, 10)
  1848. value.Position = UDim2.new(1, -(value.TextBounds.X), 0, 0)
  1849. utility.tween(value, {0.2}, {TextColor3 = theme.EnabledText})
  1850.  
  1851. if input.UserInputType == Enum.UserInputType.Keyboard then
  1852. keyChosen = input.KeyCode
  1853.  
  1854. if keybindFlag then
  1855. library.flags[keybindFlag] = input.KeyCode
  1856. end
  1857.  
  1858. keybindCallback(input.KeyCode)
  1859. binding:Disconnect()
  1860. else
  1861. keyChosen = input.UserInputType
  1862.  
  1863. if keybindFlag then
  1864. library.flags[keybindFlag] = input.UserInputType
  1865. end
  1866.  
  1867. keybindCallback(input.UserInputType)
  1868. binding:Disconnect()
  1869. end
  1870. end)
  1871. end)
  1872.  
  1873. inputService.InputBegan:Connect(function(input)
  1874. if input.UserInputType == Enum.UserInputType.Keyboard then
  1875. if input.KeyCode == keyChosen then
  1876. toggleToggle()
  1877. keybindCallback(keyChosen)
  1878. end
  1879. else
  1880. if input.UserInputType == keyChosen then
  1881. toggleToggle()
  1882. keybindCallback(keyChosen)
  1883. end
  1884. end
  1885. end)
  1886.  
  1887. local toggleKeybindTypes = {}
  1888. toggleKeybindTypes = utility.format_table(toggleKeybindTypes)
  1889.  
  1890. function toggleKeybindTypes:Toggle(bool)
  1891. if toggled ~= bool then
  1892. toggleToggle()
  1893. end
  1894. end
  1895.  
  1896. function toggleKeybindTypes:Set(newKey)
  1897. local key = keys[newKey]
  1898. value.Text = (keys[key] or tostring(newKey):gsub("Enum.KeyCode.", ""))
  1899. utility.tween(value, {0.2}, {TextColor3 = theme.EnabledText})
  1900.  
  1901. keyChosen = newKey
  1902.  
  1903. if keybindFlag then
  1904. library.flags[keybindFlag] = newKey
  1905. end
  1906.  
  1907. keybindCallback(newKey)
  1908. end
  1909.  
  1910. function toggleKeybindTypes:Hide()
  1911. toggleKeybind.Visible = false
  1912. end
  1913.  
  1914. function toggleKeybindTypes:Show()
  1915. toggleKeybind.Visible = true
  1916. end
  1917.  
  1918. return toggleKeybindTypes
  1919. end
  1920.  
  1921. function sectionTypes:ColorPicker(opts)
  1922. local options = utility.format_table(opts)
  1923. local name = options.name
  1924. local default = options.default
  1925. local flag = options.flag or nil
  1926. local callback = options.callback or function() end
  1927.  
  1928. local open = false
  1929. local hue, sat, val = default:ToHSV()
  1930.  
  1931. local slidingHue
  1932. local slidingSaturation
  1933.  
  1934. local hsv = Color3.fromHSV(hue, sat, val)
  1935.  
  1936. if flag then
  1937. library.flags[flag] = default
  1938. end
  1939.  
  1940. local colorPicker = utility.create("TextButton", {
  1941. ZIndex = 6,
  1942. Size = UDim2.new(1, 0, 0, 10),
  1943. BackgroundTransparency = 1,
  1944. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1945. FontSize = Enum.FontSize.Size12,
  1946. TextSize = 12,
  1947. TextColor3 = theme.TextColor,
  1948. Text = name,
  1949. Font = Enum.Font.Gotham,
  1950. TextXAlignment = Enum.TextXAlignment.Left,
  1951. Parent = sectionContent
  1952. })
  1953.  
  1954. local icon = utility.create("Frame", {
  1955. ZIndex = 6,
  1956. Size = UDim2.new(0, 10, 0, 10),
  1957. Position = UDim2.new(1, -10, 0, 0),
  1958. BackgroundColor3 = default,
  1959. Parent = colorPicker
  1960. })
  1961.  
  1962. utility.create("UICorner", {
  1963. CornerRadius = UDim.new(0, 12),
  1964. Parent = icon
  1965. })
  1966.  
  1967. local picker = utility.create("Frame", {
  1968. ZIndex = 12,
  1969. Size = UDim2.new(1, -8, 0, 0),
  1970. ClipsDescendants = true,
  1971. Visible = false,
  1972. Position = UDim2.new(0, 12, 1, 6),
  1973. BackgroundColor3 = theme.ColorPicker,
  1974. Parent = colorPicker
  1975. })
  1976.  
  1977. picker.Size = UDim2.new(1, -8, 0, picker.AbsoluteSize.X + 24)
  1978.  
  1979. utility.create("UICorner", {
  1980. CornerRadius = UDim.new(0, 6),
  1981. Parent = picker
  1982. })
  1983.  
  1984. local saturation = utility.create("ImageLabel", {
  1985. ZIndex = 13,
  1986. Size = UDim2.new(1, -29, 0, picker.AbsoluteSize.X - 29),
  1987. Position = UDim2.new(0, 5, 0, 5),
  1988. BackgroundColor3 = Color3.fromHSV(hue, sat, val),
  1989. Image = "http://www.roblox.com/asset/?id=8630797271",
  1990. Parent = picker
  1991. })
  1992.  
  1993. utility.create("UICorner", {
  1994. CornerRadius = UDim.new(0, 6),
  1995. Parent = saturation
  1996. })
  1997.  
  1998. local saturationPicker = utility.create("Frame", {
  1999. ZIndex = 15,
  2000. Size = UDim2.new(0, 4, 0, 4),
  2001. Position = UDim2.new(0, (math.clamp(sat * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4))),
  2002. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2003. Parent = saturation
  2004. })
  2005.  
  2006. utility.create("UICorner", {
  2007. CornerRadius = UDim.new(0, 6),
  2008. Parent = saturationPicker
  2009. })
  2010.  
  2011. local outline = utility.create("Frame", {
  2012. ZIndex = 14,
  2013. Size = UDim2.new(1, 2, 1, 2),
  2014. Position = UDim2.new(0, -1, 0, -1),
  2015. BackgroundColor3 = Color3.fromRGB(0, 0, 0),
  2016. Parent = saturationPicker
  2017. })
  2018.  
  2019. utility.create("UICorner", {
  2020. CornerRadius = UDim.new(0, 6),
  2021. Parent = outline
  2022. })
  2023.  
  2024. local hueFrame = utility.create("ImageLabel", {
  2025. ZIndex = 13,
  2026. Size = UDim2.new(0, 14, 0, picker.AbsoluteSize.X - 29),
  2027. ClipsDescendants = true,
  2028. BackgroundTransparency = 1,
  2029. Position = UDim2.new(1, -19, 0, 5),
  2030. BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  2031. ScaleType = Enum.ScaleType.Crop,
  2032. Image = "http://www.roblox.com/asset/?id=8630799159",
  2033. Parent = picker
  2034. })
  2035.  
  2036. utility.create("UICorner", {
  2037. CornerRadius = UDim.new(0, 4),
  2038. Parent = hueFrame
  2039. })
  2040.  
  2041. local huePicker = utility.create("Frame", {
  2042. ZIndex = 15,
  2043. Size = UDim2.new(1, 0, 0, 2),
  2044. Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4)),
  2045. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2046. Parent = hueFrame
  2047. })
  2048.  
  2049. local outline = utility.create("Frame", {
  2050. ZIndex = 14,
  2051. Size = UDim2.new(1, 2, 1, 2),
  2052. Position = UDim2.new(0, -1, 0, -1),
  2053. BackgroundColor3 = Color3.fromRGB(0, 0, 0),
  2054. Parent = huePicker
  2055. })
  2056.  
  2057. utility.create("UICorner", {
  2058. CornerRadius = UDim.new(0, 6),
  2059. Parent = outline
  2060. })
  2061.  
  2062. local rgb = utility.create("TextBox", {
  2063. ZIndex = 14,
  2064. Size = UDim2.new(1, -10, 0, 16),
  2065. Position = UDim2.new(0, 5, 0, picker.AbsoluteSize.Y - 42),
  2066. BackgroundColor3 = theme.ColorPickerBoxes,
  2067. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  2068. FontSize = Enum.FontSize.Size12,
  2069. TextSize = 12,
  2070. TextColor3 = theme.TextColor,
  2071. Text = tostring(math.floor(default.R * 255)) .. ", " .. tostring(math.floor(default.G * 255)) .. ", " .. tostring(math.floor(default.B * 255)),
  2072. ClearTextOnFocus = false,
  2073. Font = Enum.Font.Gotham,
  2074. PlaceholderText = "R, G, B",
  2075. Parent = picker
  2076. })
  2077.  
  2078. utility.create("UICorner", {
  2079. CornerRadius = UDim.new(0, 6),
  2080. Parent = rgb
  2081. })
  2082.  
  2083. local hex = utility.create("TextBox", {
  2084. ZIndex = 14,
  2085. Size = UDim2.new(1, -10, 0, 16),
  2086. Position = UDim2.new(0, 5, 0, picker.AbsoluteSize.Y - 21),
  2087. BackgroundColor3 = theme.ColorPickerBoxes,
  2088. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  2089. FontSize = Enum.FontSize.Size12,
  2090. TextSize = 12,
  2091. TextColor3 = theme.TextColor,
  2092. Text = utility.rgb_to_hex(default),
  2093. ClearTextOnFocus = false,
  2094. Font = Enum.Font.Gotham,
  2095. PlaceholderText = "#FFFFFF",
  2096. Parent = picker
  2097. })
  2098.  
  2099. picker.Size = UDim2.new(1, -8, 0, 0)
  2100.  
  2101. utility.create("UICorner", {
  2102. CornerRadius = UDim.new(0, 6),
  2103. Parent = hex
  2104. })
  2105.  
  2106. local function openPicker()
  2107. open = not open
  2108.  
  2109. if open then
  2110. picker.Visible = open
  2111. end
  2112.  
  2113. utility.tween(picker, {0.5}, {Size = open and UDim2.new(1, -8, 0, picker.AbsoluteSize.X + 24) or UDim2.new(1, -8, 0, 0)}, function() picker.Visible = open end)
  2114. end
  2115.  
  2116. colorPicker.MouseButton1Click:connect(openPicker)
  2117.  
  2118. local function updateHue(input)
  2119. local sizeY = 1 - math.clamp((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y, 0, 1)
  2120. local posY = math.clamp(((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 2)
  2121. utility.tween(huePicker, {0.1}, {Position = UDim2.new(0, 0, 0, posY)})
  2122.  
  2123. hue = sizeY
  2124.  
  2125. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2126. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2127.  
  2128. hsv = Color3.fromHSV(hue, sat, val)
  2129. saturation.BackgroundColor3 = hsv
  2130. icon.BackgroundColor3 = hsv
  2131.  
  2132. if flag then
  2133. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2134. end
  2135.  
  2136. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2137. end
  2138.  
  2139. hueFrame.InputBegan:Connect(function(input)
  2140. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2141. slidingHue = true
  2142. updateHue(input)
  2143. end
  2144. end)
  2145.  
  2146. hueFrame.InputEnded:Connect(function(input)
  2147. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2148. slidingHue = false
  2149. end
  2150. end)
  2151.  
  2152. inputService.InputChanged:Connect(function(input)
  2153. if input.UserInputType == Enum.UserInputType.MouseMovement then
  2154. if slidingHue then
  2155. updateHue(input)
  2156. end
  2157. end
  2158. end)
  2159.  
  2160. local function updateSatVal(input)
  2161. local sizeX = math.clamp((input.Position.X - saturation.AbsolutePosition.X) / saturation.AbsoluteSize.X, 0, 1)
  2162. local sizeY = 1 - math.clamp((input.Position.Y - saturation.AbsolutePosition.Y) / saturation.AbsoluteSize.Y, 0, 1)
  2163. local posY = math.clamp(((input.Position.Y - saturation.AbsolutePosition.Y) / saturation.AbsoluteSize.Y) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4)
  2164. local posX = math.clamp(((input.Position.X - saturation.AbsolutePosition.X) / saturation.AbsoluteSize.X) * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)
  2165.  
  2166. utility.tween(saturationPicker, {0.1}, {Position = UDim2.new(0, posX, 0, posY)})
  2167.  
  2168. sat = sizeX
  2169. val = sizeY
  2170.  
  2171. hsv = Color3.fromHSV(hue, sat, val)
  2172.  
  2173. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2174. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2175.  
  2176. saturation.BackgroundColor3 = hsv
  2177. icon.BackgroundColor3 = hsv
  2178.  
  2179. if flag then
  2180. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2181. end
  2182.  
  2183. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2184. end
  2185.  
  2186. saturation.InputBegan:Connect(function(input)
  2187. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2188. slidingSaturation = true
  2189. updateSatVal(input)
  2190. end
  2191. end)
  2192.  
  2193. saturation.InputEnded:Connect(function(input)
  2194. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2195. slidingSaturation = false
  2196. end
  2197. end)
  2198.  
  2199. inputService.InputChanged:Connect(function(input)
  2200. if input.UserInputType == Enum.UserInputType.MouseMovement then
  2201. if slidingSaturation then
  2202. updateSatVal(input)
  2203. end
  2204. end
  2205. end)
  2206.  
  2207. local colorPickerTypes = {}
  2208. colorPickerTypes = utility.format_table(colorPickerTypes)
  2209.  
  2210. function colorPickerTypes:SetRGB(color)
  2211. hue, sat, val = color:ToHSV()
  2212. hsv = Color3.fromHSV(hue, sat, val)
  2213.  
  2214. saturation.BackgroundColor3 = hsv
  2215. icon.BackgroundColor3 = hsv
  2216. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4)))
  2217. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  2218.  
  2219. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2220. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2221.  
  2222. if flag then
  2223. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2224. end
  2225.  
  2226. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2227. end
  2228.  
  2229. function colorPickerTypes:SetHex(hex)
  2230. color = utility.hex_to_rgb(hex)
  2231.  
  2232. hue, sat, val = color:ToHSV()
  2233. hsv = Color3.fromHSV(hue, sat, val)
  2234.  
  2235. saturation.BackgroundColor3 = hsv
  2236. icon.BackgroundColor3 = hsv
  2237. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4)))
  2238. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  2239.  
  2240. if flag then
  2241. library.flags[flag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2242. end
  2243.  
  2244. callback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2245. end
  2246.  
  2247. rgb.FocusLost:Connect(function()
  2248. local _, amount = rgb.Text:gsub(", ", "")
  2249. if amount == 2 then
  2250. local values = rgb.Text:split(", ")
  2251. local r, g, b = math.clamp(values[1], 0, 255), math.clamp(values[2], 0, 255), math.clamp(values[3], 0, 255)
  2252. colorPickerTypes:SetRGB(Color3.fromRGB(r, g, b))
  2253. else
  2254. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2255. end
  2256. end)
  2257.  
  2258. hex.FocusLost:Connect(function()
  2259. if hex.Text:find("#") and hex.Text:len() == 7 then
  2260. colorPickerTypes:SetHex(hex.Text)
  2261. else
  2262. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2263. end
  2264. end)
  2265.  
  2266. hex:GetPropertyChangedSignal("Text"):Connect(function()
  2267. if hex.Text == "" then
  2268. hex.Text = "#"
  2269. end
  2270. end)
  2271.  
  2272. function colorPickerTypes:Hide()
  2273. colorPicker.Visible = false
  2274. end
  2275.  
  2276. function colorPickerTypes:Show()
  2277. colorPicker.Visible = true
  2278. end
  2279.  
  2280. return colorPickerTypes
  2281. end
  2282.  
  2283. function sectionTypes:ToggleColorPicker(opts)
  2284. local options = utility.format_table(opts)
  2285. local name = options.name
  2286. local default = options.default
  2287. local colorPickerFlag = options.colorPickerFlag or nil
  2288. local toggleFlag = options.toggleFlag or nil
  2289. local colorPickerCallback = options.colorPickerCallback or function() end
  2290. local toggleCallback = options.toggleCallback or function() end
  2291.  
  2292. local open = false
  2293. local hue, sat, val = default:ToHSV()
  2294.  
  2295. local slidingHue
  2296. local slidingSaturation
  2297.  
  2298. local hsv = Color3.fromHSV(hue, sat, val)
  2299.  
  2300. if colorPickerFlag then
  2301. library.flags[colorPickerFlag] = default
  2302. end
  2303.  
  2304. local toggled = false
  2305. local mouseOver = false
  2306.  
  2307. local toggleColorPicker = utility.create("TextButton", {
  2308. Size = UDim2.new(1, 0, 0, 10),
  2309. BackgroundTransparency = 1,
  2310. FontSize = Enum.FontSize.Size14,
  2311. TextSize = 14,
  2312. Text = "",
  2313. Font = Enum.Font.SourceSans,
  2314. Parent = sectionContent
  2315. })
  2316.  
  2317. local icon = utility.create("Frame", {
  2318. ZIndex = 6,
  2319. Size = UDim2.new(0, 10, 0, 10),
  2320. BackgroundColor3 = theme.ToggleDisabled,
  2321. Parent = toggleColorPicker
  2322. })
  2323.  
  2324. utility.create("UICorner", {
  2325. CornerRadius = UDim.new(0, 12),
  2326. Parent = icon
  2327. })
  2328.  
  2329. local title = utility.create("TextLabel", {
  2330. ZIndex = 6,
  2331. Size = UDim2.new(0, 1, 0, 10),
  2332. BackgroundTransparency = 1,
  2333. Position = UDim2.new(1, 5, 0, 0),
  2334. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2335. FontSize = Enum.FontSize.Size12,
  2336. TextSize = 12,
  2337. TextColor3 = theme.DisabledText,
  2338. Text = name,
  2339. Font = Enum.Font.Gotham,
  2340. TextXAlignment = Enum.TextXAlignment.Left,
  2341. Parent = icon
  2342. })
  2343.  
  2344. local function toggleToggle()
  2345. toggled = not toggled
  2346.  
  2347. utility.tween(title, {0.2}, {TextColor3 = toggled and theme.EnabledText or theme.DisabledText})
  2348.  
  2349. if not mouseOver then
  2350. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabled or theme.ToggleDisabled})
  2351. else
  2352. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabledMouseOver or theme.ToggleDisabledMouseOver})
  2353. end
  2354.  
  2355. toggleCallback(toggled)
  2356. if toggleFlag then
  2357. library.flags[toggleFlag] = toggled
  2358. end
  2359. end
  2360.  
  2361. toggleColorPicker.MouseButton1Click:connect(toggleToggle)
  2362.  
  2363. toggleColorPicker.MouseEnter:Connect(function()
  2364. mouseOver = true
  2365. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabledMouseOver or theme.ToggleDisabledMouseOver})
  2366. end)
  2367.  
  2368. toggleColorPicker.MouseLeave:Connect(function()
  2369. mouseOver = false
  2370. utility.tween(icon, {0.2}, {BackgroundColor3 = toggled and theme.ToggleEnabled or theme.ToggleDisabled})
  2371. end)
  2372.  
  2373. local colorPickerIcon = utility.create("TextButton", {
  2374. ZIndex = 6,
  2375. Size = UDim2.new(0, 10, 0, 10),
  2376. Position = UDim2.new(1, -10, 0, 0),
  2377. BackgroundColor3 = default,
  2378. Text = "",
  2379. Parent = toggleColorPicker
  2380. })
  2381.  
  2382. utility.create("UICorner", {
  2383. CornerRadius = UDim.new(0, 12),
  2384. Parent = colorPickerIcon
  2385. })
  2386.  
  2387. local picker = utility.create("Frame", {
  2388. ZIndex = 12,
  2389. Size = UDim2.new(1, -8, 0, 0),
  2390. ClipsDescendants = true,
  2391. Visible = false,
  2392. Position = UDim2.new(0, 12, 1, 6),
  2393. BackgroundColor3 = theme.ColorPicker,
  2394. Parent = toggleColorPicker
  2395. })
  2396.  
  2397. picker.Size = UDim2.new(1, -8, 0, picker.AbsoluteSize.X + 24)
  2398.  
  2399. utility.create("UICorner", {
  2400. CornerRadius = UDim.new(0, 6),
  2401. Parent = picker
  2402. })
  2403.  
  2404. local saturation = utility.create("ImageLabel", {
  2405. ZIndex = 13,
  2406. Size = UDim2.new(1, -29, 0, picker.AbsoluteSize.X - 29),
  2407. Position = UDim2.new(0, 5, 0, 5),
  2408. BackgroundColor3 = Color3.fromHSV(hue, sat, val),
  2409. Image = "http://www.roblox.com/asset/?id=8630797271",
  2410. Parent = picker
  2411. })
  2412.  
  2413. utility.create("UICorner", {
  2414. CornerRadius = UDim.new(0, 6),
  2415. Parent = saturation
  2416. })
  2417.  
  2418. local saturationPicker = utility.create("Frame", {
  2419. ZIndex = 15,
  2420. Size = UDim2.new(0, 4, 0, 4),
  2421. Position = UDim2.new(0, (math.clamp(sat * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4))),
  2422. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2423. Parent = saturation
  2424. })
  2425.  
  2426. utility.create("UICorner", {
  2427. CornerRadius = UDim.new(0, 6),
  2428. Parent = saturationPicker
  2429. })
  2430.  
  2431. local outline = utility.create("Frame", {
  2432. ZIndex = 14,
  2433. Size = UDim2.new(1, 2, 1, 2),
  2434. Position = UDim2.new(0, -1, 0, -1),
  2435. BackgroundColor3 = Color3.fromRGB(0, 0, 0),
  2436. Parent = saturationPicker
  2437. })
  2438.  
  2439. utility.create("UICorner", {
  2440. CornerRadius = UDim.new(0, 6),
  2441. Parent = outline
  2442. })
  2443.  
  2444. local hueFrame = utility.create("ImageLabel", {
  2445. ZIndex = 13,
  2446. Size = UDim2.new(0, 14, 0, picker.AbsoluteSize.X - 29),
  2447. ClipsDescendants = true,
  2448. BackgroundTransparency = 1,
  2449. Position = UDim2.new(1, -19, 0, 5),
  2450. BackgroundColor3 = Color3.fromRGB(255, 0, 4),
  2451. ScaleType = Enum.ScaleType.Crop,
  2452. Image = "http://www.roblox.com/asset/?id=8630799159",
  2453. Parent = picker
  2454. })
  2455.  
  2456. utility.create("UICorner", {
  2457. CornerRadius = UDim.new(0, 4),
  2458. Parent = hueFrame
  2459. })
  2460.  
  2461. local huePicker = utility.create("Frame", {
  2462. ZIndex = 15,
  2463. Size = UDim2.new(1, 0, 0, 2),
  2464. Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4)),
  2465. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  2466. Parent = hueFrame
  2467. })
  2468.  
  2469. local outline = utility.create("Frame", {
  2470. ZIndex = 14,
  2471. Size = UDim2.new(1, 2, 1, 2),
  2472. Position = UDim2.new(0, -1, 0, -1),
  2473. BackgroundColor3 = Color3.fromRGB(0, 0, 0),
  2474. Parent = huePicker
  2475. })
  2476.  
  2477. utility.create("UICorner", {
  2478. CornerRadius = UDim.new(0, 6),
  2479. Parent = outline
  2480. })
  2481.  
  2482. local rgb = utility.create("TextBox", {
  2483. ZIndex = 14,
  2484. Size = UDim2.new(1, -10, 0, 16),
  2485. Position = UDim2.new(0, 5, 0, picker.AbsoluteSize.Y - 42),
  2486. BackgroundColor3 = theme.ColorPickerBoxes,
  2487. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  2488. FontSize = Enum.FontSize.Size12,
  2489. TextSize = 12,
  2490. TextColor3 = theme.TextColor,
  2491. Text = tostring(math.floor(default.R * 255)) .. ", " .. tostring(math.floor(default.G * 255)) .. ", " .. tostring(math.floor(default.B * 255)),
  2492. ClearTextOnFocus = false,
  2493. Font = Enum.Font.Gotham,
  2494. PlaceholderText = "R, G, B",
  2495. Parent = picker
  2496. })
  2497.  
  2498. utility.create("UICorner", {
  2499. CornerRadius = UDim.new(0, 6),
  2500. Parent = rgb
  2501. })
  2502.  
  2503. local hex = utility.create("TextBox", {
  2504. ZIndex = 14,
  2505. Size = UDim2.new(1, -10, 0, 16),
  2506. Position = UDim2.new(0, 5, 0, picker.AbsoluteSize.Y - 21),
  2507. BackgroundColor3 = theme.ColorPickerBoxes,
  2508. PlaceholderColor3 = Color3.fromRGB(180, 180, 180),
  2509. FontSize = Enum.FontSize.Size12,
  2510. TextSize = 12,
  2511. TextColor3 = theme.TextColor,
  2512. Text = utility.rgb_to_hex(default),
  2513. ClearTextOnFocus = false,
  2514. Font = Enum.Font.Gotham,
  2515. PlaceholderText = "#FFFFFF",
  2516. Parent = picker
  2517. })
  2518.  
  2519. picker.Size = UDim2.new(1, -8, 0, 0)
  2520.  
  2521. utility.create("UICorner", {
  2522. CornerRadius = UDim.new(0, 6),
  2523. Parent = hex
  2524. })
  2525.  
  2526. local function openPicker()
  2527. open = not open
  2528.  
  2529. if open then
  2530. picker.Visible = open
  2531. end
  2532.  
  2533. utility.tween(picker, {0.5}, {Size = open and UDim2.new(1, -8, 0, picker.AbsoluteSize.X + 24) or UDim2.new(1, -8, 0, 0)}, function() picker.Visible = open end)
  2534. end
  2535.  
  2536. colorPickerIcon.MouseButton1Click:connect(openPicker)
  2537.  
  2538. local function updateHue(input)
  2539. local sizeY = 1 - math.clamp((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y, 0, 1)
  2540. local posY = math.clamp(((input.Position.Y - hueFrame.AbsolutePosition.Y) / hueFrame.AbsoluteSize.Y) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 2)
  2541. utility.tween(huePicker, {0.1}, {Position = UDim2.new(0, 0, 0, posY)})
  2542.  
  2543. hue = sizeY
  2544.  
  2545. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2546. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2547.  
  2548. hsv = Color3.fromHSV(hue, sat, val)
  2549. saturation.BackgroundColor3 = hsv
  2550. colorPickerIcon.BackgroundColor3 = hsv
  2551.  
  2552. if flag then
  2553. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2554. end
  2555.  
  2556. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2557. end
  2558.  
  2559. hueFrame.InputBegan:Connect(function(input)
  2560. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2561. slidingHue = true
  2562. updateHue(input)
  2563. end
  2564. end)
  2565.  
  2566. hueFrame.InputEnded:Connect(function(input)
  2567. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2568. slidingHue = false
  2569. end
  2570. end)
  2571.  
  2572. inputService.InputChanged:Connect(function(input)
  2573. if input.UserInputType == Enum.UserInputType.MouseMovement then
  2574. if slidingHue then
  2575. updateHue(input)
  2576. end
  2577. end
  2578. end)
  2579.  
  2580. local function updateSatVal(input)
  2581. local sizeX = math.clamp((input.Position.X - saturation.AbsolutePosition.X) / saturation.AbsoluteSize.X, 0, 1)
  2582. local sizeY = 1 - math.clamp((input.Position.Y - saturation.AbsolutePosition.Y) / saturation.AbsoluteSize.Y, 0, 1)
  2583. local posY = math.clamp(((input.Position.Y - saturation.AbsolutePosition.Y) / saturation.AbsoluteSize.Y) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4)
  2584. local posX = math.clamp(((input.Position.X - saturation.AbsolutePosition.X) / saturation.AbsoluteSize.X) * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)
  2585.  
  2586. utility.tween(saturationPicker, {0.1}, {Position = UDim2.new(0, posX, 0, posY)})
  2587.  
  2588. sat = sizeX
  2589. val = sizeY
  2590.  
  2591. hsv = Color3.fromHSV(hue, sat, val)
  2592.  
  2593. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2594. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2595.  
  2596. saturation.BackgroundColor3 = hsv
  2597. colorPickerIcon.BackgroundColor3 = hsv
  2598.  
  2599. if flag then
  2600. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2601. end
  2602.  
  2603. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2604. end
  2605.  
  2606. saturation.InputBegan:Connect(function(input)
  2607. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2608. slidingSaturation = true
  2609. updateSatVal(input)
  2610. end
  2611. end)
  2612.  
  2613. saturation.InputEnded:Connect(function(input)
  2614. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  2615. slidingSaturation = false
  2616. end
  2617. end)
  2618.  
  2619. inputService.InputChanged:Connect(function(input)
  2620. if input.UserInputType == Enum.UserInputType.MouseMovement then
  2621. if slidingSaturation then
  2622. updateSatVal(input)
  2623. end
  2624. end
  2625. end)
  2626.  
  2627. local toggleColorPickerTypes = {}
  2628. toggleColorPickerTypes = utility.format_table(toggleColorPickerTypes)
  2629.  
  2630. function toggleColorPickerTypes:Toggle(bool)
  2631. if toggled ~= bool then
  2632. toggleColorPickerTypes()
  2633. end
  2634. end
  2635.  
  2636. function toggleColorPickerTypes:SetRGB(color)
  2637. hue, sat, val = color:ToHSV()
  2638. hsv = Color3.fromHSV(hue, sat, val)
  2639.  
  2640. saturation.BackgroundColor3 = hsv
  2641. colorPickerIcon.BackgroundColor3 = hsv
  2642. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4)))
  2643. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  2644.  
  2645. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2646. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2647.  
  2648. if flag then
  2649. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2650. end
  2651.  
  2652. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2653. end
  2654.  
  2655. function toggleColorPickerTypes:SetHex(hex)
  2656. color = utility.hex_to_rgb(hex)
  2657.  
  2658. hue, sat, val = color:ToHSV()
  2659. hsv = Color3.fromHSV(hue, sat, val)
  2660.  
  2661. saturation.BackgroundColor3 = hsv
  2662. colorPickerIcon.BackgroundColor3 = hsv
  2663. saturationPicker.Position = UDim2.new(0, (math.clamp(sat * saturation.AbsoluteSize.X, 0, saturation.AbsoluteSize.X - 4)), 0, (math.clamp((1 - val) * saturation.AbsoluteSize.Y, 0, saturation.AbsoluteSize.Y - 4)))
  2664. huePicker.Position = UDim2.new(0, 0, 0, math.clamp((1 - hue) * hueFrame.AbsoluteSize.Y, 0, hueFrame.AbsoluteSize.Y - 4))
  2665.  
  2666. if flag then
  2667. library.flags[colorPickerFlag] = Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255)
  2668. end
  2669.  
  2670. colorPickerCallback(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2671. end
  2672.  
  2673. rgb.FocusLost:Connect(function()
  2674. local _, amount = rgb.Text:gsub(", ", "")
  2675. if amount == 2 then
  2676. local values = rgb.Text:split(", ")
  2677. local r, g, b = math.clamp(values[1], 0, 255), math.clamp(values[2], 0, 255), math.clamp(values[3], 0, 255)
  2678. toggleColorPickerTypes:SetRGB(Color3.fromRGB(r, g, b))
  2679. else
  2680. rgb.Text = math.floor((hsv.r * 255) + 0.5) .. ", " .. math.floor((hsv.g * 255) + 0.5) .. ", " .. math.floor((hsv.b * 255) + 0.5)
  2681. end
  2682. end)
  2683.  
  2684. hex.FocusLost:Connect(function()
  2685. if hex.Text:find("#") and hex.Text:len() == 7 then
  2686. toggleColorPickerTypes:SetHex(hex.Text)
  2687. else
  2688. hex.Text = utility.rgb_to_hex(Color3.fromRGB(hsv.r * 255, hsv.g * 255, hsv.b * 255))
  2689. end
  2690. end)
  2691.  
  2692. hex:GetPropertyChangedSignal("Text"):Connect(function()
  2693. if hex.Text == "" then
  2694. hex.Text = "#"
  2695. end
  2696. end)
  2697.  
  2698. function toggleColorPickerTypes:Hide()
  2699. toggleColorPicker.Visible = false
  2700. end
  2701.  
  2702. function toggleColorPickerTypes:Show()
  2703. toggleColorPicker.Visible = true
  2704. end
  2705.  
  2706. return toggleColorPickerTypes
  2707. end
  2708.  
  2709. return sectionTypes
  2710. end
  2711.  
  2712. return tabTypes
  2713. end
  2714.  
  2715. return windowTypes
  2716. end
  2717.  
  2718. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement