Messi33536086

Untitled

Mar 1st, 2026
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.19 KB | None | 0 0
  1. local Library = {}
  2. local TweenService = game:GetService("TweenService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local RunService = game:GetService("RunService")
  5. local Players = game:GetService("Players")
  6.  
  7. local LocalPlayer = Players.LocalPlayer
  8. local Mouse = LocalPlayer:GetMouse()
  9.  
  10. local function CreateTween(instance, properties, duration, style, direction)
  11. local info = TweenInfo.new(duration or 0.3, style or Enum.EasingStyle.Quart, direction or Enum.EasingDirection.Out)
  12. return TweenService:Create(instance, info, properties)
  13. end
  14.  
  15. local function MakeDraggable(frame, dragHandle)
  16. local dragging = false
  17. local dragStart, startPos
  18.  
  19. dragHandle.InputBegan:Connect(function(input)
  20. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  21. dragging = true
  22. dragStart = input.Position
  23. startPos = frame.Position
  24. end
  25. end)
  26.  
  27. UserInputService.InputChanged:Connect(function(input)
  28. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  29. local delta = input.Position - dragStart
  30. frame.Position = UDim2.new(
  31. startPos.X.Scale,
  32. startPos.X.Offset + delta.X,
  33. startPos.Y.Scale,
  34. startPos.Y.Offset + delta.Y
  35. )
  36. end
  37. end)
  38.  
  39. UserInputService.InputEnded:Connect(function(input)
  40. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  41. dragging = false
  42. end
  43. end)
  44. end
  45.  
  46. local function CreateInstance(class, properties, parent)
  47. local inst = Instance.new(class)
  48. for k, v in pairs(properties) do
  49. inst[k] = v
  50. end
  51. if parent then inst.Parent = parent end
  52. return inst
  53. end
  54.  
  55. local function Round(frame, radius)
  56. local corner = Instance.new("UICorner")
  57. corner.CornerRadius = UDim.new(0, radius or 8)
  58. corner.Parent = frame
  59. return corner
  60. end
  61.  
  62. local function Stroke(frame, color, thickness)
  63. local stroke = Instance.new("UIStroke")
  64. stroke.Color = color or Color3.fromRGB(60, 60, 70)
  65. stroke.Thickness = thickness or 1
  66. stroke.Parent = frame
  67. return stroke
  68. end
  69.  
  70. local COLORS = {
  71. Background = Color3.fromRGB(10, 10, 14),
  72. Surface = Color3.fromRGB(16, 16, 22),
  73. Elevated = Color3.fromRGB(22, 22, 30),
  74. Border = Color3.fromRGB(40, 40, 55),
  75. Accent = Color3.fromRGB(110, 86, 255),
  76. AccentDim = Color3.fromRGB(70, 52, 180),
  77. Text = Color3.fromRGB(240, 240, 255),
  78. TextDim = Color3.fromRGB(140, 140, 165),
  79. TextMuted = Color3.fromRGB(80, 80, 100),
  80. Success = Color3.fromRGB(72, 200, 140),
  81. Danger = Color3.fromRGB(255, 80, 100),
  82. }
  83.  
  84. function Library.Create(config)
  85. config = config or {}
  86.  
  87. local ScreenGui = CreateInstance("ScreenGui", {
  88. Name = "LibraryUI",
  89. ResetOnSpawn = false,
  90. ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
  91. })
  92.  
  93. local success = pcall(function()
  94. ScreenGui.Parent = game:GetService("CoreGui")
  95. end)
  96. if not success then
  97. ScreenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
  98. end
  99.  
  100. local LoaderActive = false
  101. local LoaderFrame, LoaderLeft, LoaderRight, LoaderText, LoaderSub
  102.  
  103. if config.Loader then
  104. LoaderActive = true
  105.  
  106. local Overlay = CreateInstance("Frame", {
  107. Name = "LoaderOverlay",
  108. Size = UDim2.new(1, 0, 1, 0),
  109. Position = UDim2.new(0, 0, 0, 0),
  110. BackgroundColor3 = COLORS.Background,
  111. BorderSizePixel = 0,
  112. ZIndex = 100,
  113. }, ScreenGui)
  114.  
  115. LoaderLeft = CreateInstance("Frame", {
  116. Name = "LoaderLeft",
  117. Size = UDim2.new(0.5, 0, 1, 0),
  118. Position = UDim2.new(0, 0, 0, 0),
  119. BackgroundColor3 = COLORS.Background,
  120. BorderSizePixel = 0,
  121. ZIndex = 101,
  122. }, Overlay)
  123.  
  124. LoaderRight = CreateInstance("Frame", {
  125. Name = "LoaderRight",
  126. Size = UDim2.new(0.5, 0, 1, 0),
  127. Position = UDim2.new(0.5, 0, 0, 0),
  128. BackgroundColor3 = COLORS.Background,
  129. BorderSizePixel = 0,
  130. ZIndex = 101,
  131. }, Overlay)
  132.  
  133. local Center = CreateInstance("Frame", {
  134. Size = UDim2.new(0, 400, 0, 120),
  135. Position = UDim2.new(0.5, -200, 0.5, -60),
  136. BackgroundTransparency = 1,
  137. ZIndex = 102,
  138. }, Overlay)
  139.  
  140. LoaderText = CreateInstance("TextLabel", {
  141. Size = UDim2.new(1, 0, 0, 40),
  142. Position = UDim2.new(0, 0, 0, 0),
  143. BackgroundTransparency = 1,
  144. Text = config.Title or "Loading",
  145. TextColor3 = COLORS.Text,
  146. Font = Enum.Font.GothamBold,
  147. TextSize = 26,
  148. ZIndex = 103,
  149. }, Center)
  150.  
  151. LoaderSub = CreateInstance("TextLabel", {
  152. Size = UDim2.new(1, 0, 0, 24),
  153. Position = UDim2.new(0, 0, 0, 46),
  154. BackgroundTransparency = 1,
  155. Text = "Initializing...",
  156. TextColor3 = COLORS.TextDim,
  157. Font = Enum.Font.Gotham,
  158. TextSize = 14,
  159. ZIndex = 103,
  160. }, Center)
  161.  
  162. local BarBg = CreateInstance("Frame", {
  163. Size = UDim2.new(1, 0, 0, 3),
  164. Position = UDim2.new(0, 0, 0, 90),
  165. BackgroundColor3 = COLORS.Border,
  166. BorderSizePixel = 0,
  167. ZIndex = 103,
  168. }, Center)
  169. Round(BarBg, 2)
  170.  
  171. local BarFill = CreateInstance("Frame", {
  172. Size = UDim2.new(0, 0, 1, 0),
  173. Position = UDim2.new(0, 0, 0, 0),
  174. BackgroundColor3 = COLORS.Accent,
  175. BorderSizePixel = 0,
  176. ZIndex = 104,
  177. }, BarBg)
  178. Round(BarFill, 2)
  179.  
  180. local barTween = CreateTween(BarFill, {Size = UDim2.new(0.7, 0, 1, 0)}, 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
  181. barTween:Play()
  182.  
  183. local Loader = {}
  184.  
  185. function Loader:Start()
  186. LoaderActive = true
  187. end
  188.  
  189. function Loader:SetText(text)
  190. if LoaderSub then
  191. LoaderSub.Text = text
  192. local fade = CreateTween(LoaderSub, {TextTransparency = 0}, 0.2)
  193. fade:Play()
  194. end
  195. end
  196.  
  197. function Loader:End()
  198. LoaderActive = false
  199.  
  200. CreateTween(BarFill, {Size = UDim2.new(1, 0, 1, 0)}, 0.4, Enum.EasingStyle.Quart):Play()
  201.  
  202. task.wait(0.5)
  203.  
  204. local fadeText = CreateTween(LoaderText, {TextTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
  205. local fadeSub = CreateTween(LoaderSub, {TextTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
  206. local fadeBar = CreateTween(BarBg, {BackgroundTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
  207. local fadeBarFill = CreateTween(BarFill, {BackgroundTransparency = 1}, 0.35, Enum.EasingStyle.Quad)
  208.  
  209. fadeText:Play()
  210. fadeSub:Play()
  211. fadeBar:Play()
  212. fadeBarFill:Play()
  213.  
  214. task.wait(0.4)
  215.  
  216. local splitLeft = CreateTween(LoaderLeft, {Position = UDim2.new(-0.5, 0, 0, 0)}, 0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
  217. local splitRight = CreateTween(LoaderRight, {Position = UDim2.new(1, 0, 0, 0)}, 0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.In)
  218.  
  219. splitLeft:Play()
  220. splitRight:Play()
  221.  
  222. task.wait(0.75)
  223. Overlay:Destroy()
  224. end
  225.  
  226. config._Loader = Loader
  227. end
  228.  
  229. local WindowLib = {}
  230.  
  231. local MainFrame = CreateInstance("Frame", {
  232. Name = "MainWindow",
  233. Size = UDim2.new(0, 620, 0, 460),
  234. Position = UDim2.new(0.5, -310, 0.5, -230),
  235. BackgroundColor3 = COLORS.Background,
  236. BorderSizePixel = 0,
  237. ClipsDescendants = false,
  238. }, ScreenGui)
  239. Round(MainFrame, 12)
  240. Stroke(MainFrame, COLORS.Border, 1)
  241.  
  242. MainFrame.BackgroundTransparency = 1
  243. CreateTween(MainFrame, {BackgroundTransparency = 0}, 0.4, Enum.EasingStyle.Quart):Play()
  244.  
  245. local Shadow = CreateInstance("ImageLabel", {
  246. Size = UDim2.new(1, 40, 1, 40),
  247. Position = UDim2.new(0, -20, 0, -20),
  248. BackgroundTransparency = 1,
  249. Image = "rbxassetid://5028857084",
  250. ImageColor3 = Color3.fromRGB(0, 0, 0),
  251. ImageTransparency = 0.6,
  252. ScaleType = Enum.ScaleType.Slice,
  253. SliceCenter = Rect.new(24, 24, 276, 276),
  254. ZIndex = 0,
  255. }, MainFrame)
  256.  
  257. local TitleBar = CreateInstance("Frame", {
  258. Name = "TitleBar",
  259. Size = UDim2.new(1, 0, 0, 46),
  260. Position = UDim2.new(0, 0, 0, 0),
  261. BackgroundColor3 = COLORS.Surface,
  262. BorderSizePixel = 0,
  263. ZIndex = 2,
  264. }, MainFrame)
  265. Round(TitleBar, 12)
  266.  
  267. local TitleBarFix = CreateInstance("Frame", {
  268. Size = UDim2.new(1, 0, 0, 12),
  269. Position = UDim2.new(0, 0, 1, -12),
  270. BackgroundColor3 = COLORS.Surface,
  271. BorderSizePixel = 0,
  272. ZIndex = 2,
  273. }, TitleBar)
  274.  
  275. local AccentLine = CreateInstance("Frame", {
  276. Size = UDim2.new(0, 3, 0, 22),
  277. Position = UDim2.new(0, 14, 0, 12),
  278. BackgroundColor3 = COLORS.Accent,
  279. BorderSizePixel = 0,
  280. ZIndex = 3,
  281. }, TitleBar)
  282. Round(AccentLine, 2)
  283.  
  284. local TitleLabel = CreateInstance("TextLabel", {
  285. Size = UDim2.new(0, 300, 0, 46),
  286. Position = UDim2.new(0, 26, 0, 0),
  287. BackgroundTransparency = 1,
  288. Text = config.Title or "Library",
  289. TextColor3 = COLORS.Text,
  290. Font = Enum.Font.GothamBold,
  291. TextSize = 15,
  292. TextXAlignment = Enum.TextXAlignment.Left,
  293. ZIndex = 3,
  294. }, TitleBar)
  295.  
  296. local SubLabel = CreateInstance("TextLabel", {
  297. Size = UDim2.new(0, 300, 0, 46),
  298. Position = UDim2.new(0, 26, 0, 18),
  299. BackgroundTransparency = 1,
  300. Text = (config.SubTitle or "") .. (config.Version and (" v" .. config.Version) or ""),
  301. TextColor3 = COLORS.TextMuted,
  302. Font = Enum.Font.Gotham,
  303. TextSize = 11,
  304. TextXAlignment = Enum.TextXAlignment.Left,
  305. ZIndex = 3,
  306. }, TitleBar)
  307.  
  308. local ControlsFrame = CreateInstance("Frame", {
  309. Size = UDim2.new(0, 60, 0, 46),
  310. Position = UDim2.new(1, -66, 0, 0),
  311. BackgroundTransparency = 1,
  312. ZIndex = 3,
  313. }, TitleBar)
  314.  
  315. local function MakeControlBtn(label, color, xPos)
  316. local Btn = CreateInstance("TextButton", {
  317. Size = UDim2.new(0, 16, 0, 16),
  318. Position = UDim2.new(0, xPos, 0.5, -8),
  319. BackgroundColor3 = color,
  320. Text = "",
  321. BorderSizePixel = 0,
  322. ZIndex = 4,
  323. }, ControlsFrame)
  324. Round(Btn, 8)
  325.  
  326. local Dot = CreateInstance("TextLabel", {
  327. Size = UDim2.new(1, 0, 1, 0),
  328. BackgroundTransparency = 1,
  329. Text = label,
  330. TextColor3 = Color3.fromRGB(0, 0, 0),
  331. Font = Enum.Font.GothamBold,
  332. TextSize = 9,
  333. TextTransparency = 1,
  334. ZIndex = 5,
  335. }, Btn)
  336.  
  337. Btn.MouseEnter:Connect(function()
  338. CreateTween(Dot, {TextTransparency = 0}, 0.15):Play()
  339. CreateTween(Btn, {BackgroundColor3 = color:lerp(Color3.fromRGB(255,255,255), 0.2)}, 0.15):Play()
  340. end)
  341. Btn.MouseLeave:Connect(function()
  342. CreateTween(Dot, {TextTransparency = 1}, 0.15):Play()
  343. CreateTween(Btn, {BackgroundColor3 = color}, 0.15):Play()
  344. end)
  345.  
  346. return Btn
  347. end
  348.  
  349. local MinBtn = MakeControlBtn("—", Color3.fromRGB(255, 190, 50), 0)
  350. local CloseBtn = MakeControlBtn("✕", Color3.fromRGB(255, 75, 75), 26)
  351.  
  352. local minimized = false
  353. local ContentFrame
  354.  
  355. CloseBtn.MouseButton1Click:Connect(function()
  356. CreateTween(MainFrame, {Size = UDim2.new(0, 620, 0, 0), Position = UDim2.new(0.5, -310, 0.5, 0)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.In):Play()
  357. task.wait(0.32)
  358. ScreenGui:Destroy()
  359. end)
  360.  
  361. MinBtn.MouseButton1Click:Connect(function()
  362. minimized = not minimized
  363. if minimized then
  364. CreateTween(ContentFrame, {Size = UDim2.new(1, 0, 0, 0)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
  365. CreateTween(MainFrame, {Size = UDim2.new(0, 620, 0, 46)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
  366. else
  367. CreateTween(MainFrame, {Size = UDim2.new(0, 620, 0, 460)}, 0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
  368. task.wait(0.1)
  369. CreateTween(ContentFrame, {Size = UDim2.new(1, 0, 1, -46)}, 0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out):Play()
  370. end
  371. end)
  372.  
  373. MakeDraggable(MainFrame, TitleBar)
  374.  
  375. ContentFrame = CreateInstance("Frame", {
  376. Name = "Content",
  377. Size = UDim2.new(1, 0, 1, -46),
  378. Position = UDim2.new(0, 0, 0, 46),
  379. BackgroundTransparency = 1,
  380. ClipsDescendants = true,
  381. ZIndex = 2,
  382. }, MainFrame)
  383.  
  384. local TabBar = CreateInstance("Frame", {
  385. Name = "TabBar",
  386. Size = UDim2.new(0, 140, 1, 0),
  387. Position = UDim2.new(0, 0, 0, 0),
  388. BackgroundColor3 = COLORS.Surface,
  389. BorderSizePixel = 0,
  390. ZIndex = 2,
  391. }, ContentFrame)
  392.  
  393. local TabBarFix = CreateInstance("Frame", {
  394. Size = UDim2.new(0, 4, 1, 0),
  395. Position = UDim2.new(1, -4, 0, 0),
  396. BackgroundColor3 = COLORS.Surface,
  397. BorderSizePixel = 0,
  398. ZIndex = 2,
  399. }, TabBar)
  400.  
  401. local TabList = CreateInstance("ScrollingFrame", {
  402. Size = UDim2.new(1, 0, 1, -10),
  403. Position = UDim2.new(0, 0, 0, 8),
  404. BackgroundTransparency = 1,
  405. BorderSizePixel = 0,
  406. ScrollBarThickness = 0,
  407. ZIndex = 3,
  408. }, TabBar)
  409.  
  410. local TabListLayout = CreateInstance("UIListLayout", {
  411. SortOrder = Enum.SortOrder.LayoutOrder,
  412. Padding = UDim.new(0, 4),
  413. }, TabList)
  414.  
  415. local TabListPad = CreateInstance("UIPadding", {
  416. PaddingLeft = UDim.new(0, 8),
  417. PaddingRight = UDim.new(0, 8),
  418. }, TabList)
  419.  
  420. local TabDivider = CreateInstance("Frame", {
  421. Size = UDim2.new(0, 1, 1, 0),
  422. Position = UDim2.new(1, 0, 0, 0),
  423. BackgroundColor3 = COLORS.Border,
  424. BorderSizePixel = 0,
  425. ZIndex = 3,
  426. }, TabBar)
  427.  
  428. local PageContainer = CreateInstance("Frame", {
  429. Name = "Pages",
  430. Size = UDim2.new(1, -140, 1, 0),
  431. Position = UDim2.new(0, 140, 0, 0),
  432. BackgroundTransparency = 1,
  433. ClipsDescendants = true,
  434. ZIndex = 2,
  435. }, ContentFrame)
  436.  
  437. local activeTab = nil
  438. local tabs = {}
  439.  
  440. MainFrame.Size = UDim2.new(0, 0, 0, 0)
  441. MainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
  442. CreateTween(MainFrame, {
  443. Size = UDim2.new(0, 620, 0, 460),
  444. Position = UDim2.new(0.5, -310, 0.5, -230),
  445. }, 0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out):Play()
  446.  
  447. local Window = {}
  448. Window._ScreenGui = ScreenGui
  449. Window._Loader = config._Loader
  450.  
  451. if config.Loader and config._Loader then
  452. Window.Loader = config._Loader
  453. end
  454.  
  455. function Window:Tab(tabConfig)
  456. tabConfig = tabConfig or {}
  457. local tabName = tabConfig.Name or "Tab"
  458. local tabIcon = tabConfig.Icon or ""
  459.  
  460. local TabBtn = CreateInstance("TextButton", {
  461. Size = UDim2.new(1, 0, 0, 34),
  462. BackgroundColor3 = COLORS.Elevated,
  463. BackgroundTransparency = 1,
  464. Text = "",
  465. BorderSizePixel = 0,
  466. AutoButtonColor = false,
  467. ZIndex = 4,
  468. }, TabList)
  469. Round(TabBtn, 8)
  470.  
  471. local TabIcon = CreateInstance("TextLabel", {
  472. Size = UDim2.new(0, 28, 1, 0),
  473. Position = UDim2.new(0, 8, 0, 0),
  474. BackgroundTransparency = 1,
  475. Text = tabIcon,
  476. TextColor3 = COLORS.TextMuted,
  477. Font = Enum.Font.GothamBold,
  478. TextSize = 14,
  479. ZIndex = 5,
  480. }, TabBtn)
  481.  
  482. local TabLabel = CreateInstance("TextLabel", {
  483. Size = UDim2.new(1, -40, 1, 0),
  484. Position = UDim2.new(0, 36, 0, 0),
  485. BackgroundTransparency = 1,
  486. Text = tabName,
  487. TextColor3 = COLORS.TextDim,
  488. Font = Enum.Font.Gotham,
  489. TextSize = 13,
  490. TextXAlignment = Enum.TextXAlignment.Left,
  491. ZIndex = 5,
  492. }, TabBtn)
  493.  
  494. local ActiveBar = CreateInstance("Frame", {
  495. Size = UDim2.new(0, 3, 0, 16),
  496. Position = UDim2.new(0, 0, 0.5, -8),
  497. BackgroundColor3 = COLORS.Accent,
  498. BorderSizePixel = 0,
  499. BackgroundTransparency = 1,
  500. ZIndex = 5,
  501. }, TabBtn)
  502. Round(ActiveBar, 2)
  503.  
  504. local Page = CreateInstance("ScrollingFrame", {
  505. Size = UDim2.new(1, 0, 1, 0),
  506. BackgroundTransparency = 1,
  507. BorderSizePixel = 0,
  508. ScrollBarThickness = 3,
  509. ScrollBarImageColor3 = COLORS.Accent,
  510. Visible = false,
  511. ZIndex = 3,
  512. }, PageContainer)
  513.  
  514. local PageLayout = CreateInstance("UIListLayout", {
  515. SortOrder = Enum.SortOrder.LayoutOrder,
  516. Padding = UDim.new(0, 0),
  517. }, Page)
  518.  
  519. local PagePad = CreateInstance("UIPadding", {
  520. PaddingTop = UDim.new(0, 10),
  521. PaddingLeft = UDim.new(0, 12),
  522. PaddingRight = UDim.new(0, 14),
  523. PaddingBottom = UDim.new(0, 12),
  524. }, Page)
  525.  
  526. PageLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
  527. Page.CanvasSize = UDim2.new(0, 0, 0, PageLayout.AbsoluteContentSize.Y + 22)
  528. end)
  529.  
  530. local tab = {_Page = Page, _TabBtn = TabBtn}
  531.  
  532. local function Activate()
  533. if activeTab and activeTab ~= tab then
  534. local prev = activeTab
  535. prev._Page.Visible = false
  536. CreateTween(prev._TabBtn, {BackgroundTransparency = 1}, 0.2):Play()
  537. local prevLabel = prev._TabBtn:FindFirstChildWhichIsA("TextLabel")
  538. local prevIcon = prev._TabBtn:FindFirstChild("TextLabel")
  539. for _, v in pairs(prev._TabBtn:GetChildren()) do
  540. if v:IsA("TextLabel") then
  541. CreateTween(v, {TextColor3 = COLORS.TextDim}, 0.2):Play()
  542. end
  543. if v.Name == "Frame" then
  544. CreateTween(v, {BackgroundTransparency = 1}, 0.2):Play()
  545. end
  546. end
  547. CreateTween(ActiveBar, {BackgroundTransparency = 1}, 0.2):Play()
  548. end
  549.  
  550. activeTab = tab
  551. Page.Visible = true
  552. CreateTween(TabBtn, {BackgroundTransparency = 0}, 0.2):Play()
  553. CreateTween(TabLabel, {TextColor3 = COLORS.Text, Font = Enum.Font.GothamBold}, 0.2):Play()
  554. CreateTween(TabIcon, {TextColor3 = COLORS.Accent}, 0.2):Play()
  555. CreateTween(ActiveBar, {BackgroundTransparency = 0}, 0.2):Play()
  556. end
  557.  
  558. TabBtn.MouseButton1Click:Connect(Activate)
  559. TabBtn.MouseEnter:Connect(function()
  560. if activeTab ~= tab then
  561. CreateTween(TabBtn, {BackgroundTransparency = 0.7}, 0.15):Play()
  562. end
  563. end)
  564. TabBtn.MouseLeave:Connect(function()
  565. if activeTab ~= tab then
  566. CreateTween(TabBtn, {BackgroundTransparency = 1}, 0.15):Play()
  567. end
  568. end)
  569.  
  570. if #tabs == 0 then
  571. Activate()
  572. end
  573.  
  574. table.insert(tabs, tab)
  575.  
  576. function tab:Section(sectionConfig)
  577. sectionConfig = sectionConfig or {}
  578. local sectionName = sectionConfig.Name or "Section"
  579.  
  580. local SectionWrap = CreateInstance("Frame", {
  581. Size = UDim2.new(1, 0, 0, 0),
  582. BackgroundTransparency = 1,
  583. AutomaticSize = Enum.AutomaticSize.Y,
  584. ZIndex = 4,
  585. }, Page)
  586.  
  587. local SectionHeader = CreateInstance("TextLabel", {
  588. Size = UDim2.new(1, 0, 0, 22),
  589. BackgroundTransparency = 1,
  590. Text = sectionName,
  591. TextColor3 = COLORS.TextMuted,
  592. Font = Enum.Font.GothamBold,
  593. TextSize = 11,
  594. TextXAlignment = Enum.TextXAlignment.Left,
  595. ZIndex = 5,
  596. }, SectionWrap)
  597.  
  598. local Divider = CreateInstance("Frame", {
  599. Size = UDim2.new(1, 0, 0, 1),
  600. Position = UDim2.new(0, 0, 0, 22),
  601. BackgroundColor3 = COLORS.Border,
  602. BorderSizePixel = 0,
  603. ZIndex = 5,
  604. }, SectionWrap)
  605.  
  606. local ItemList = CreateInstance("Frame", {
  607. Size = UDim2.new(1, 0, 0, 0),
  608. Position = UDim2.new(0, 0, 0, 28),
  609. BackgroundTransparency = 1,
  610. AutomaticSize = Enum.AutomaticSize.Y,
  611. ZIndex = 4,
  612. }, SectionWrap)
  613.  
  614. local ItemLayout = CreateInstance("UIListLayout", {
  615. SortOrder = Enum.SortOrder.LayoutOrder,
  616. Padding = UDim.new(0, 4),
  617. }, ItemList)
  618.  
  619. local BottomPad = CreateInstance("Frame", {
  620. Size = UDim2.new(1, 0, 0, 12),
  621. BackgroundTransparency = 1,
  622. ZIndex = 4,
  623. LayoutOrder = 999,
  624. }, ItemList)
  625.  
  626. local section = {_List = ItemList}
  627.  
  628. local function MakeItem(height)
  629. local item = CreateInstance("Frame", {
  630. Size = UDim2.new(1, 0, 0, height or 36),
  631. BackgroundColor3 = COLORS.Elevated,
  632. BorderSizePixel = 0,
  633. ZIndex = 5,
  634. }, ItemList)
  635. Round(item, 7)
  636. return item
  637. end
  638.  
  639. function section:Button(btnConfig)
  640. btnConfig = btnConfig or {}
  641. local item = MakeItem(36)
  642.  
  643. local Btn = CreateInstance("TextButton", {
  644. Size = UDim2.new(1, 0, 1, 0),
  645. BackgroundTransparency = 1,
  646. Text = "",
  647. ZIndex = 6,
  648. }, item)
  649.  
  650. local Label = CreateInstance("TextLabel", {
  651. Size = UDim2.new(1, -16, 1, 0),
  652. Position = UDim2.new(0, 12, 0, 0),
  653. BackgroundTransparency = 1,
  654. Text = btnConfig.Name or "Button",
  655. TextColor3 = COLORS.Text,
  656. Font = Enum.Font.Gotham,
  657. TextSize = 13,
  658. TextXAlignment = Enum.TextXAlignment.Left,
  659. ZIndex = 6,
  660. }, item)
  661.  
  662. local Arrow = CreateInstance("TextLabel", {
  663. Size = UDim2.new(0, 20, 1, 0),
  664. Position = UDim2.new(1, -28, 0, 0),
  665. BackgroundTransparency = 1,
  666. Text = "›",
  667. TextColor3 = COLORS.TextMuted,
  668. Font = Enum.Font.GothamBold,
  669. TextSize = 16,
  670. ZIndex = 6,
  671. }, item)
  672.  
  673. Btn.MouseEnter:Connect(function()
  674. CreateTween(item, {BackgroundColor3 = COLORS.Accent:lerp(COLORS.Elevated, 0.85)}, 0.15):Play()
  675. CreateTween(Label, {TextColor3 = COLORS.Accent}, 0.15):Play()
  676. end)
  677. Btn.MouseLeave:Connect(function()
  678. CreateTween(item, {BackgroundColor3 = COLORS.Elevated}, 0.15):Play()
  679. CreateTween(Label, {TextColor3 = COLORS.Text}, 0.15):Play()
  680. end)
  681. Btn.MouseButton1Click:Connect(function()
  682. CreateTween(item, {BackgroundColor3 = COLORS.Accent:lerp(COLORS.Elevated, 0.6)}, 0.08):Play()
  683. task.wait(0.1)
  684. CreateTween(item, {BackgroundColor3 = COLORS.Elevated}, 0.2):Play()
  685. if btnConfig.Callback then btnConfig.Callback() end
  686. end)
  687. end
  688.  
  689. function section:Toggle(toggleConfig)
  690. toggleConfig = toggleConfig or {}
  691. local item = MakeItem(36)
  692. local state = toggleConfig.Default or false
  693.  
  694. local Label = CreateInstance("TextLabel", {
  695. Size = UDim2.new(1, -60, 1, 0),
  696. Position = UDim2.new(0, 12, 0, 0),
  697. BackgroundTransparency = 1,
  698. Text = toggleConfig.Name or "Toggle",
  699. TextColor3 = COLORS.Text,
  700. Font = Enum.Font.Gotham,
  701. TextSize = 13,
  702. TextXAlignment = Enum.TextXAlignment.Left,
  703. ZIndex = 6,
  704. }, item)
  705.  
  706. local TrackBg = CreateInstance("Frame", {
  707. Size = UDim2.new(0, 36, 0, 18),
  708. Position = UDim2.new(1, -46, 0.5, -9),
  709. BackgroundColor3 = state and COLORS.Accent or COLORS.Border,
  710. BorderSizePixel = 0,
  711. ZIndex = 6,
  712. }, item)
  713. Round(TrackBg, 9)
  714.  
  715. local Knob = CreateInstance("Frame", {
  716. Size = UDim2.new(0, 14, 0, 14),
  717. Position = state and UDim2.new(0, 20, 0.5, -7) or UDim2.new(0, 2, 0.5, -7),
  718. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  719. BorderSizePixel = 0,
  720. ZIndex = 7,
  721. }, TrackBg)
  722. Round(Knob, 7)
  723.  
  724. local Btn = CreateInstance("TextButton", {
  725. Size = UDim2.new(1, 0, 1, 0),
  726. BackgroundTransparency = 1,
  727. Text = "",
  728. ZIndex = 8,
  729. }, item)
  730.  
  731. Btn.MouseButton1Click:Connect(function()
  732. state = not state
  733. CreateTween(TrackBg, {BackgroundColor3 = state and COLORS.Accent or COLORS.Border}, 0.2):Play()
  734. CreateTween(Knob, {Position = state and UDim2.new(0, 20, 0.5, -7) or UDim2.new(0, 2, 0.5, -7)}, 0.2, Enum.EasingStyle.Quart):Play()
  735. if toggleConfig.Callback then toggleConfig.Callback(state) end
  736. end)
  737. end
  738.  
  739. function section:Dropdown(ddConfig)
  740. ddConfig = ddConfig or {}
  741. local options = ddConfig.Options or {}
  742. local selected = ddConfig.Default or options[1] or "Select..."
  743. local open = false
  744.  
  745. local item = CreateInstance("Frame", {
  746. Size = UDim2.new(1, 0, 0, 36),
  747. BackgroundColor3 = COLORS.Elevated,
  748. BorderSizePixel = 0,
  749. ZIndex = 5,
  750. ClipsDescendants = false,
  751. }, ItemList)
  752. Round(item, 7)
  753.  
  754. local Label = CreateInstance("TextLabel", {
  755. Size = UDim2.new(1, -16, 0, 36),
  756. Position = UDim2.new(0, 12, 0, 0),
  757. BackgroundTransparency = 1,
  758. Text = ddConfig.Name or "Dropdown",
  759. TextColor3 = COLORS.Text,
  760. Font = Enum.Font.Gotham,
  761. TextSize = 13,
  762. TextXAlignment = Enum.TextXAlignment.Left,
  763. ZIndex = 6,
  764. }, item)
  765.  
  766. local SelLabel = CreateInstance("TextLabel", {
  767. Size = UDim2.new(0, 120, 0, 36),
  768. Position = UDim2.new(1, -136, 0, 0),
  769. BackgroundTransparency = 1,
  770. Text = selected,
  771. TextColor3 = COLORS.TextMuted,
  772. Font = Enum.Font.Gotham,
  773. TextSize = 12,
  774. TextXAlignment = Enum.TextXAlignment.Right,
  775. ZIndex = 6,
  776. }, item)
  777.  
  778. local Arrow = CreateInstance("TextLabel", {
  779. Size = UDim2.new(0, 20, 0, 36),
  780. Position = UDim2.new(1, -24, 0, 0),
  781. BackgroundTransparency = 1,
  782. Text = "▾",
  783. TextColor3 = COLORS.TextMuted,
  784. Font = Enum.Font.GothamBold,
  785. TextSize = 12,
  786. ZIndex = 6,
  787. }, item)
  788.  
  789. local Dropdown = CreateInstance("Frame", {
  790. Size = UDim2.new(1, 0, 0, 0),
  791. Position = UDim2.new(0, 0, 1, 4),
  792. BackgroundColor3 = COLORS.Surface,
  793. BorderSizePixel = 0,
  794. ClipsDescendants = true,
  795. ZIndex = 20,
  796. }, item)
  797. Round(Dropdown, 7)
  798. Stroke(Dropdown, COLORS.Border, 1)
  799.  
  800. local DdLayout = CreateInstance("UIListLayout", {
  801. SortOrder = Enum.SortOrder.LayoutOrder,
  802. Padding = UDim.new(0, 2),
  803. }, Dropdown)
  804. local DdPad = CreateInstance("UIPadding", {
  805. PaddingTop = UDim.new(0, 4),
  806. PaddingBottom = UDim.new(0, 4),
  807. PaddingLeft = UDim.new(0, 4),
  808. PaddingRight = UDim.new(0, 4),
  809. }, Dropdown)
  810.  
  811. local totalHeight = #options * 30 + 10
  812.  
  813. for _, opt in ipairs(options) do
  814. local OptBtn = CreateInstance("TextButton", {
  815. Size = UDim2.new(1, 0, 0, 28),
  816. BackgroundColor3 = COLORS.Elevated,
  817. BackgroundTransparency = 1,
  818. Text = opt,
  819. TextColor3 = COLORS.TextDim,
  820. Font = Enum.Font.Gotham,
  821. TextSize = 12,
  822. ZIndex = 21,
  823. }, Dropdown)
  824. Round(OptBtn, 6)
  825.  
  826. OptBtn.MouseEnter:Connect(function()
  827. CreateTween(OptBtn, {BackgroundTransparency = 0, TextColor3 = COLORS.Text}, 0.15):Play()
  828. end)
  829. OptBtn.MouseLeave:Connect(function()
  830. CreateTween(OptBtn, {BackgroundTransparency = 1, TextColor3 = COLORS.TextDim}, 0.15):Play()
  831. end)
  832. OptBtn.MouseButton1Click:Connect(function()
  833. selected = opt
  834. SelLabel.Text = opt
  835. open = false
  836. CreateTween(Dropdown, {Size = UDim2.new(1, 0, 0, 0)}, 0.2, Enum.EasingStyle.Quart):Play()
  837. CreateTween(Arrow, {Rotation = 0}, 0.2):Play()
  838. if ddConfig.Callback then ddConfig.Callback(opt) end
  839. end)
  840. end
  841.  
  842. local MainBtn = CreateInstance("TextButton", {
  843. Size = UDim2.new(1, 0, 0, 36),
  844. BackgroundTransparency = 1,
  845. Text = "",
  846. ZIndex = 7,
  847. }, item)
  848.  
  849. MainBtn.MouseButton1Click:Connect(function()
  850. open = not open
  851. if open then
  852. CreateTween(Dropdown, {Size = UDim2.new(1, 0, 0, totalHeight)}, 0.25, Enum.EasingStyle.Quart):Play()
  853. CreateTween(Arrow, {Rotation = 180}, 0.2):Play()
  854. else
  855. CreateTween(Dropdown, {Size = UDim2.new(1, 0, 0, 0)}, 0.2, Enum.EasingStyle.Quart):Play()
  856. CreateTween(Arrow, {Rotation = 0}, 0.2):Play()
  857. end
  858. end)
  859. end
  860.  
  861. function section:Input(inputConfig)
  862. inputConfig = inputConfig or {}
  863. local item = MakeItem(36)
  864.  
  865. local Label = CreateInstance("TextLabel", {
  866. Size = UDim2.new(0.45, 0, 1, 0),
  867. Position = UDim2.new(0, 12, 0, 0),
  868. BackgroundTransparency = 1,
  869. Text = inputConfig.Name or "Input",
  870. TextColor3 = COLORS.Text,
  871. Font = Enum.Font.Gotham,
  872. TextSize = 13,
  873. TextXAlignment = Enum.TextXAlignment.Left,
  874. ZIndex = 6,
  875. }, item)
  876.  
  877. local InputBg = CreateInstance("Frame", {
  878. Size = UDim2.new(0.5, -8, 0, 24),
  879. Position = UDim2.new(0.5, 0, 0.5, -12),
  880. BackgroundColor3 = COLORS.Background,
  881. BorderSizePixel = 0,
  882. ZIndex = 6,
  883. }, item)
  884. Round(InputBg, 6)
  885. Stroke(InputBg, COLORS.Border, 1)
  886.  
  887. local TextBox = CreateInstance("TextBox", {
  888. Size = UDim2.new(1, -16, 1, 0),
  889. Position = UDim2.new(0, 8, 0, 0),
  890. BackgroundTransparency = 1,
  891. Text = inputConfig.Default or "",
  892. PlaceholderText = inputConfig.Placeholder or "Type here...",
  893. PlaceholderColor3 = COLORS.TextMuted,
  894. TextColor3 = COLORS.Text,
  895. Font = Enum.Font.Gotham,
  896. TextSize = 12,
  897. TextXAlignment = Enum.TextXAlignment.Left,
  898. ClearTextOnFocus = false,
  899. ZIndex = 7,
  900. }, InputBg)
  901.  
  902. TextBox.Focused:Connect(function()
  903. CreateTween(InputBg, {BackgroundColor3 = COLORS.Elevated}, 0.15):Play()
  904. end)
  905. TextBox.FocusLost:Connect(function(enter)
  906. CreateTween(InputBg, {BackgroundColor3 = COLORS.Background}, 0.15):Play()
  907. if inputConfig.Callback then inputConfig.Callback(TextBox.Text, enter) end
  908. end)
  909. end
  910.  
  911. function section:Slider(sliderConfig)
  912. sliderConfig = sliderConfig or {}
  913. local min = sliderConfig.Min or 0
  914. local max = sliderConfig.Max or 100
  915. local val = sliderConfig.Default or min
  916. local item = MakeItem(46)
  917.  
  918. local Label = CreateInstance("TextLabel", {
  919. Size = UDim2.new(0.7, 0, 0, 22),
  920. Position = UDim2.new(0, 12, 0, 4),
  921. BackgroundTransparency = 1,
  922. Text = sliderConfig.Name or "Slider",
  923. TextColor3 = COLORS.Text,
  924. Font = Enum.Font.Gotham,
  925. TextSize = 13,
  926. TextXAlignment = Enum.TextXAlignment.Left,
  927. ZIndex = 6,
  928. }, item)
  929.  
  930. local ValLabel = CreateInstance("TextLabel", {
  931. Size = UDim2.new(0.3, -12, 0, 22),
  932. Position = UDim2.new(0.7, 0, 0, 4),
  933. BackgroundTransparency = 1,
  934. Text = tostring(val),
  935. TextColor3 = COLORS.Accent,
  936. Font = Enum.Font.GothamBold,
  937. TextSize = 12,
  938. TextXAlignment = Enum.TextXAlignment.Right,
  939. ZIndex = 6,
  940. }, item)
  941.  
  942. local TrackBg = CreateInstance("Frame", {
  943. Size = UDim2.new(1, -24, 0, 4),
  944. Position = UDim2.new(0, 12, 0, 34),
  945. BackgroundColor3 = COLORS.Border,
  946. BorderSizePixel = 0,
  947. ZIndex = 6,
  948. }, item)
  949. Round(TrackBg, 2)
  950.  
  951. local Fill = CreateInstance("Frame", {
  952. Size = UDim2.new((val - min) / (max - min), 0, 1, 0),
  953. BackgroundColor3 = COLORS.Accent,
  954. BorderSizePixel = 0,
  955. ZIndex = 7,
  956. }, TrackBg)
  957. Round(Fill, 2)
  958.  
  959. local Knob = CreateInstance("Frame", {
  960. Size = UDim2.new(0, 12, 0, 12),
  961. Position = UDim2.new((val - min) / (max - min), -6, 0.5, -6),
  962. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  963. BorderSizePixel = 0,
  964. ZIndex = 8,
  965. }, TrackBg)
  966. Round(Knob, 6)
  967.  
  968. local draggingSlider = false
  969.  
  970. local SliderBtn = CreateInstance("TextButton", {
  971. Size = UDim2.new(1, 0, 0, 20),
  972. Position = UDim2.new(0, 0, 0, -8),
  973. BackgroundTransparency = 1,
  974. Text = "",
  975. ZIndex = 9,
  976. }, TrackBg)
  977.  
  978. local function UpdateSlider(inputPos)
  979. local abs = TrackBg.AbsolutePosition
  980. local size = TrackBg.AbsoluteSize
  981. local rel = math.clamp((inputPos.X - abs.X) / size.X, 0, 1)
  982. val = math.floor(min + rel * (max - min))
  983. ValLabel.Text = tostring(val)
  984. CreateTween(Fill, {Size = UDim2.new(rel, 0, 1, 0)}, 0.05):Play()
  985. CreateTween(Knob, {Position = UDim2.new(rel, -6, 0.5, -6)}, 0.05):Play()
  986. if sliderConfig.Callback then sliderConfig.Callback(val) end
  987. end
  988.  
  989. SliderBtn.MouseButton1Down:Connect(function()
  990. draggingSlider = true
  991. UpdateSlider(UserInputService:GetMouseLocation())
  992. end)
  993.  
  994. UserInputService.InputChanged:Connect(function(input)
  995. if draggingSlider and input.UserInputType == Enum.UserInputType.MouseMovement then
  996. UpdateSlider(UserInputService:GetMouseLocation())
  997. end
  998. end)
  999.  
  1000. UserInputService.InputEnded:Connect(function(input)
  1001. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1002. draggingSlider = false
  1003. end
  1004. end)
  1005. end
  1006.  
  1007. function section:Paragraph(paraConfig)
  1008. paraConfig = paraConfig or {}
  1009. local item = CreateInstance("Frame", {
  1010. Size = UDim2.new(1, 0, 0, 0),
  1011. AutomaticSize = Enum.AutomaticSize.Y,
  1012. BackgroundColor3 = COLORS.Elevated,
  1013. BorderSizePixel = 0,
  1014. ZIndex = 5,
  1015. }, ItemList)
  1016. Round(item, 7)
  1017.  
  1018. local TitleLbl = CreateInstance("TextLabel", {
  1019. Size = UDim2.new(1, -24, 0, 0),
  1020. AutomaticSize = Enum.AutomaticSize.Y,
  1021. Position = UDim2.new(0, 12, 0, 10),
  1022. BackgroundTransparency = 1,
  1023. Text = paraConfig.Title or "",
  1024. TextColor3 = COLORS.Text,
  1025. Font = Enum.Font.GothamBold,
  1026. TextSize = 13,
  1027. TextXAlignment = Enum.TextXAlignment.Left,
  1028. TextWrapped = true,
  1029. ZIndex = 6,
  1030. }, item)
  1031.  
  1032. local ContentLbl = CreateInstance("TextLabel", {
  1033. Size = UDim2.new(1, -24, 0, 0),
  1034. AutomaticSize = Enum.AutomaticSize.Y,
  1035. Position = UDim2.new(0, 12, 0, 28),
  1036. BackgroundTransparency = 1,
  1037. Text = paraConfig.Content or "",
  1038. TextColor3 = COLORS.TextDim,
  1039. Font = Enum.Font.Gotham,
  1040. TextSize = 12,
  1041. TextXAlignment = Enum.TextXAlignment.Left,
  1042. TextWrapped = true,
  1043. ZIndex = 6,
  1044. }, item)
  1045.  
  1046. local PadBot = CreateInstance("Frame", {
  1047. Size = UDim2.new(1, 0, 0, 10),
  1048. Position = UDim2.new(0, 0, 1, 0),
  1049. BackgroundTransparency = 1,
  1050. ZIndex = 5,
  1051. }, item)
  1052. end
  1053.  
  1054. return section
  1055. end
  1056.  
  1057. function tab:Button(btnConfig)
  1058. local tempSection = self:Section({Name = ""})
  1059. tempSection:Button(btnConfig)
  1060. end
  1061.  
  1062. function tab:Toggle(toggleConfig)
  1063. local tempSection = self:Section({Name = ""})
  1064. tempSection:Toggle(toggleConfig)
  1065. end
  1066.  
  1067. function tab:Dropdown(ddConfig)
  1068. local tempSection = self:Section({Name = ""})
  1069. tempSection:Dropdown(ddConfig)
  1070. end
  1071.  
  1072. function tab:Input(inputConfig)
  1073. local tempSection = self:Section({Name = ""})
  1074. tempSection:Input(inputConfig)
  1075. end
  1076.  
  1077. function tab:Slider(sliderConfig)
  1078. local tempSection = self:Section({Name = ""})
  1079. tempSection:Slider(sliderConfig)
  1080. end
  1081.  
  1082. function tab:Paragraph(paraConfig)
  1083. local tempSection = self:Section({Name = ""})
  1084. tempSection:Paragraph(paraConfig)
  1085. end
  1086.  
  1087. return tab
  1088. end
  1089.  
  1090. return Window
  1091. end
  1092.  
  1093. return Library
  1094.  
Advertisement
Add Comment
Please, Sign In to add comment