Potato228

ФВФВАФВА

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