Advertisement
kooggy

Vynixius

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