Advertisement
Fe_Scripts_

Untitled

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