Advertisement
Jsjdbot

Redzlib

Nov 19th, 2024
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.70 KB | None | 0 0
  1. local MarketplaceService = game:GetService("MarketplaceService")
  2. local UserInputService = game:GetService("UserInputService")
  3. local TweenService = game:GetService("TweenService")
  4. local HttpService = game:GetService("HttpService")
  5. local RunService = game:GetService("RunService")
  6. local CoreGui = game:GetService("CoreGui")
  7. local Players = game:GetService("Players")
  8. local Player = Players.LocalPlayer
  9. local PlayerMouse = Player:GetMouse()
  10.  
  11. local redzlib = {
  12. Themes = {
  13. Darker = {
  14. ["Color Hub 1"] = ColorSequence.new({
  15. ColorSequenceKeypoint.new(0.00, Color3.fromRGB(25, 25, 25)),
  16. ColorSequenceKeypoint.new(0.50, Color3.fromRGB(32.5, 32.5, 32.5)),
  17. ColorSequenceKeypoint.new(1.00, Color3.fromRGB(25, 25, 25))
  18. }),
  19. ["Color Hub 2"] = Color3.fromRGB(30, 30, 30),
  20. ["Color Stroke"] = Color3.fromRGB(40, 40, 40),
  21. ["Color Theme"] = Color3.fromRGB(88, 101, 242),
  22. ["Color Text"] = Color3.fromRGB(243, 243, 243),
  23. ["Color Dark Text"] = Color3.fromRGB(180, 180, 180)
  24. },
  25. Dark = {
  26. ["Color Hub 1"] = ColorSequence.new({
  27. ColorSequenceKeypoint.new(0.00, Color3.fromRGB(40, 40, 40)),
  28. ColorSequenceKeypoint.new(0.50, Color3.fromRGB(47.5, 47.5, 47.5)),
  29. ColorSequenceKeypoint.new(1.00, Color3.fromRGB(40, 40, 40))
  30. }),
  31. ["Color Hub 2"] = Color3.fromRGB(45, 45, 45),
  32. ["Color Stroke"] = Color3.fromRGB(65, 65, 65),
  33. ["Color Theme"] = Color3.fromRGB(65, 150, 255),
  34. ["Color Text"] = Color3.fromRGB(245, 245, 245),
  35. ["Color Dark Text"] = Color3.fromRGB(190, 190, 190)
  36. },
  37. Purple = {
  38. ["Color Hub 1"] = ColorSequence.new({
  39. ColorSequenceKeypoint.new(0.00, Color3.fromRGB(27.5, 25, 30)),
  40. ColorSequenceKeypoint.new(0.50, Color3.fromRGB(32.5, 32.5, 32.5)),
  41. ColorSequenceKeypoint.new(1.00, Color3.fromRGB(27.5, 25, 30))
  42. }),
  43. ["Color Hub 2"] = Color3.fromRGB(30, 30, 30),
  44. ["Color Stroke"] = Color3.fromRGB(40, 40, 40),
  45. ["Color Theme"] = Color3.fromRGB(150, 0, 255),
  46. ["Color Text"] = Color3.fromRGB(240, 240, 240),
  47. ["Color Dark Text"] = Color3.fromRGB(180, 180, 180)
  48. }
  49. },
  50. Info = {
  51. Version = "1.1.0"
  52. },
  53. Save = {
  54. UISize = {550, 380},
  55. TabSize = 160,
  56. Theme = "Darker"
  57. },
  58. Settings = {},
  59. Connection = {},
  60. Instances = {},
  61. Elements = {},
  62. Options = {},
  63. Flags = {},
  64. Tabs = {},
  65. Icons = loadstring(game:HttpGet("https://raw.githubusercontent.com/REDzHUB/RedzLibV5/refs/heads/main/Icons.Lua"))()
  66. }
  67.  
  68. local ViewportSize = workspace.CurrentCamera.ViewportSize
  69. local UIScale = ViewportSize.Y / 450
  70.  
  71. local Settings = redzlib.Settings
  72. local Flags = redzlib.Flags
  73.  
  74. local SetProps, SetChildren, InsertTheme, Create do
  75. InsertTheme = function(Instance, Type)
  76. table.insert(redzlib.Instances, {
  77. Instance = Instance,
  78. Type = Type
  79. })
  80. return Instance
  81. end
  82.  
  83. SetChildren = function(Instance, Children)
  84. if Children then
  85. table.foreach(Children, function(_,Child)
  86. Child.Parent = Instance
  87. end)
  88. end
  89. return Instance
  90. end
  91.  
  92. SetProps = function(Instance, Props)
  93. if Props then
  94. table.foreach(Props, function(prop, value)
  95. Instance[prop] = value
  96. end)
  97. end
  98. return Instance
  99. end
  100.  
  101. Create = function(...)
  102. local args = {...}
  103. if type(args) ~= "table" then return end
  104. local new = Instance.new(args[1])
  105. local Children = {}
  106.  
  107. if type(args[2]) == "table" then
  108. SetProps(new, args[2])
  109. SetChildren(new, args[3])
  110. Children = args[3] or {}
  111. elseif typeof(args[2]) == "Instance" then
  112. new.Parent = args[2]
  113. SetProps(new, args[3])
  114. SetChildren(new, args[4])
  115. Children = args[4] or {}
  116. end
  117. return new
  118. end
  119.  
  120. local function Save(file)
  121. if readfile and isfile and isfile(file) then
  122. local decode = HttpService:JSONDecode(readfile(file))
  123.  
  124. if type(decode) == "table" then
  125. if rawget(decode, "UISize") then redzlib.Save["UISize"] = decode["UISize"] end
  126. if rawget(decode, "TabSize") then redzlib.Save["TabSize"] = decode["TabSize"] end
  127. if rawget(decode, "Theme") and VerifyTheme(decode["Theme"]) then redzlib.Save["Theme"] = decode["Theme"] end
  128. end
  129. end
  130. end
  131.  
  132. pcall(Save, "redz library V5.json")
  133. end
  134.  
  135. local Funcs = {} do
  136. function Funcs:InsertCallback(tab, func)
  137. if type(func) == "function" then
  138. table.insert(tab, func)
  139. end
  140. return func
  141. end
  142.  
  143. function Funcs:FireCallback(tab, ...)
  144. for _,v in ipairs(tab) do
  145. if type(v) == "function" then
  146. task.spawn(v, ...)
  147. end
  148. end
  149. end
  150.  
  151. function Funcs:ToggleVisible(Obj, Bool)
  152. Obj.Visible = Bool ~= nil and Bool or Obj.Visible
  153. end
  154.  
  155. function Funcs:ToggleParent(Obj, Parent)
  156. if Bool ~= nil then
  157. Obj.Parent = Bool
  158. else
  159. Obj.Parent = not Obj.Parent and Parent
  160. end
  161. end
  162.  
  163. function Funcs:GetConnectionFunctions(ConnectedFuncs, func)
  164. local Connected = { Function = func, Connected = true }
  165.  
  166. function Connected:Disconnect()
  167. if self.Connected then
  168. table.remove(ConnectedFuncs, table.find(ConnectedFuncs, self.Function))
  169. self.Connected = false
  170. end
  171. end
  172.  
  173. function Connected:Fire(...)
  174. if self.Connected then
  175. task.spawn(self.Function, ...)
  176. end
  177. end
  178.  
  179. return Connected
  180. end
  181.  
  182. function Funcs:GetCallback(Configs, index)
  183. local func = Configs[index] or Configs.Callback or function()end
  184.  
  185. if type(func) == "table" then
  186. return ({function(Value) func[1][func[2]] = Value end})
  187. end
  188. return {func}
  189. end
  190. end
  191.  
  192. local Connections, Connection = {}, redzlib.Connection do
  193. local function NewConnectionList(List)
  194. if type(List) ~= "table" then return end
  195.  
  196. for _,CoName in ipairs(List) do
  197. local ConnectedFuncs, Connect = {}, {}
  198. Connection[CoName] = Connect
  199. Connections[CoName] = ConnectedFuncs
  200. Connect.Name = CoName
  201.  
  202. function Connect:Connect(func)
  203. if type(func) == "function" then
  204. table.insert(ConnectedFuncs, func)
  205. return Funcs:GetConnectionFunctions(ConnectedFuncs, func)
  206. end
  207. end
  208.  
  209. function Connect:Once(func)
  210. if type(func) == "function" then
  211. local Connected;
  212.  
  213. local _NFunc;_NFunc = function(...)
  214. task.spawn(func, ...)
  215. Connected:Disconnect()
  216. end
  217.  
  218. Connected = Funcs:GetConnectionFunctions(ConnectedFuncs, _NFunc)
  219. return Connected
  220. end
  221. end
  222. end
  223. end
  224.  
  225. function Connection:FireConnection(CoName, ...)
  226. local Connection = type(CoName) == "string" and Connections[CoName] or Connections[CoName.Name]
  227. for _,Func in pairs(Connection) do
  228. task.spawn(Func, ...)
  229. end
  230. end
  231.  
  232. NewConnectionList({"FlagsChanged", "ThemeChanged", "FileSaved", "ThemeChanging", "OptionAdded"})
  233. end
  234.  
  235. local GetFlag, SetFlag, CheckFlag do
  236. CheckFlag = function(Name)
  237. return type(Name) == "string" and Flags[Name] ~= nil
  238. end
  239.  
  240. GetFlag = function(Name)
  241. return type(Name) == "string" and Flags[Name]
  242. end
  243.  
  244. SetFlag = function(Flag, Value)
  245. if Flag and (Value ~= Flags[Flag] or type(Value) == "table") then
  246. Flags[Flag] = Value
  247. Connection:FireConnection("FlagsChanged", Flag, Value)
  248. end
  249. end
  250.  
  251. local db
  252. Connection.FlagsChanged:Connect(function(Flag, Value)
  253. local ScriptFile = Settings.ScriptFile
  254. if not db and ScriptFile and writefile then
  255. db=true;task.wait(0.1);db=false
  256.  
  257. local Success, Encoded = pcall(function()
  258. -- local _Flags = {}
  259. -- for _,Flag in pairs(Flags) do _Flags[_] = Flag.Value end
  260. return HttpService:JSONEncode(Flags)
  261. end)
  262.  
  263. if Success then
  264. local Success = pcall(writefile, ScriptFile, Encoded)
  265. if Success then
  266. Connection:FireConnection("FileSaved", "Script-Flags", ScriptFile, Encoded)
  267. end
  268. end
  269. end
  270. end)
  271. end
  272.  
  273. local ScreenGui = Create("ScreenGui", CoreGui, {
  274. Name = "redz Library V5",
  275. }, {
  276. Create("UIScale", {
  277. Scale = UIScale,
  278. Name = "Scale"
  279. })
  280. })
  281.  
  282. local ScreenFind = CoreGui:FindFirstChild(ScreenGui.Name)
  283. if ScreenFind and ScreenFind ~= ScreenGui then
  284. ScreenFind:Destroy()
  285. end
  286.  
  287. local function GetStr(val)
  288. if type(val) == "function" then
  289. return val()
  290. end
  291. return val
  292. end
  293.  
  294. local function ConnectSave(Instance, func)
  295. Instance.InputBegan:Connect(function(Input)
  296. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  297. while UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do task.wait()
  298. end
  299. end
  300. func()
  301. end)
  302. end
  303.  
  304. local function CreateTween(Configs)
  305. local Instance = Configs[1] or Configs.Instance
  306. local Prop = Configs[2] or Configs.Prop
  307. local NewVal = Configs[3] or Configs.NewVal
  308. local Time = Configs[4] or Configs.Time or 0.5
  309. local TweenWait = Configs[5] or Configs.wait or false
  310. local TweenInfo = TweenInfo.new(Time, Enum.EasingStyle.Quint)
  311.  
  312. local Tween = TweenService:Create(Instance, TweenInfo, {[Prop] = NewVal})
  313. Tween:Play()
  314. if TweenWait then
  315. Tween.Completed:Wait()
  316. end
  317. return Tween
  318. end
  319.  
  320. local function MakeDrag(Instance)
  321. task.spawn(function()
  322. SetProps(Instance, {
  323. Active = true,
  324. AutoButtonColor = false
  325. })
  326.  
  327. local DragStart, StartPos, InputOn
  328.  
  329. local function Update(Input)
  330. local delta = Input.Position - DragStart
  331. local Position = UDim2.new(StartPos.X.Scale, StartPos.X.Offset + delta.X / UIScale, StartPos.Y.Scale, StartPos.Y.Offset + delta.Y / UIScale)
  332. -- Instance.Position = Position
  333. CreateTween({Instance, "Position", Position, 0.35})
  334. end
  335.  
  336. Instance.MouseButton1Down:Connect(function()
  337. InputOn = true
  338. end)
  339.  
  340. Instance.InputBegan:Connect(function(Input)
  341. if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then
  342. StartPos = Instance.Position
  343. DragStart = Input.Position
  344.  
  345. while UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do RunService.Heartbeat:Wait()
  346. if InputOn then
  347. Update(Input)
  348. end
  349. end
  350. InputOn = false
  351. end
  352. end)
  353. end)
  354. return Instance
  355. end
  356.  
  357. local function VerifyTheme(Theme)
  358. for name,_ in pairs(redzlib.Themes) do
  359. if name == Theme then
  360. return true
  361. end
  362. end
  363. end
  364.  
  365. local function SaveJson(FileName, save)
  366. if writefile then
  367. local json = HttpService:JSONEncode(save)
  368. writefile(FileName, json)
  369. end
  370. end
  371.  
  372. local Theme = redzlib.Themes[redzlib.Save.Theme]
  373.  
  374. local function AddEle(Name, Func)
  375. redzlib.Elements[Name] = Func
  376. end
  377.  
  378. local function Make(Ele, Instance, props, ...)
  379. local Element = redzlib.Elements[Ele](Instance, props, ...)
  380. return Element
  381. end
  382.  
  383. AddEle("Corner", function(parent, CornerRadius)
  384. local New = SetProps(Create("UICorner", parent, {
  385. CornerRadius = CornerRadius or UDim.new(0, 7)
  386. }), props)
  387. return New
  388. end)
  389.  
  390. AddEle("Stroke", function(parent, props, ...)
  391. local args = {...}
  392. local New = InsertTheme(SetProps(Create("UIStroke", parent, {
  393. Color = args[1] or Theme["Color Stroke"],
  394. Thickness = args[2] or 1,
  395. ApplyStrokeMode = "Border"
  396. }), props), "Stroke")
  397. return New
  398. end)
  399.  
  400. AddEle("Button", function(parent, props, ...)
  401. local args = {...}
  402. local New = InsertTheme(SetProps(Create("TextButton", parent, {
  403. Text = "",
  404. Size = UDim2.fromScale(1, 1),
  405. BackgroundColor3 = Theme["Color Hub 2"],
  406. AutoButtonColor = false
  407. }), props), "Frame")
  408.  
  409. New.MouseEnter:Connect(function()
  410. New.BackgroundTransparency = 0.4
  411. end)
  412. New.MouseLeave:Connect(function()
  413. New.BackgroundTransparency = 0
  414. end)
  415. if args[1] then
  416. New.Activated:Connect(args[1])
  417. end
  418. return New
  419. end)
  420.  
  421. AddEle("Gradient", function(parent, props, ...)
  422. local args = {...}
  423. local New = InsertTheme(SetProps(Create("UIGradient", parent, {
  424. Color = Theme["Color Hub 1"]
  425. }), props), "Gradient")
  426. return New
  427. end)
  428.  
  429. local function ButtonFrame(Instance, Title, Description, HolderSize)
  430. local TitleL = InsertTheme(Create("TextLabel", {
  431. Font = Enum.Font.GothamMedium,
  432. TextColor3 = Theme["Color Text"],
  433. Size = UDim2.new(1, -20),
  434. AutomaticSize = "Y",
  435. Position = UDim2.new(0, 0, 0.5),
  436. AnchorPoint = Vector2.new(0, 0.5),
  437. BackgroundTransparency = 1,
  438. TextTruncate = "AtEnd",
  439. TextSize = 10,
  440. TextXAlignment = "Left",
  441. Text = "",
  442. RichText = true
  443. }), "Text")
  444.  
  445. local DescL = InsertTheme(Create("TextLabel", {
  446. Font = Enum.Font.Gotham,
  447. TextColor3 = Theme["Color Dark Text"],
  448. Size = UDim2.new(1, -20),
  449. AutomaticSize = "Y",
  450. Position = UDim2.new(0, 12, 0, 15),
  451. BackgroundTransparency = 1,
  452. TextWrapped = true,
  453. TextSize = 8,
  454. TextXAlignment = "Left",
  455. Text = "",
  456. RichText = true
  457. }), "DarkText")
  458.  
  459. local Frame = Make("Button", Instance, {
  460. Size = UDim2.new(1, 0, 0, 25),
  461. AutomaticSize = "Y",
  462. Name = "Option"
  463. })Make("Corner", Frame, UDim.new(0, 6))
  464.  
  465. LabelHolder = Create("Frame", Frame, {
  466. AutomaticSize = "Y",
  467. BackgroundTransparency = 1,
  468. Size = HolderSize,
  469. Position = UDim2.new(0, 10, 0),
  470. AnchorPoint = Vector2.new(0, 0)
  471. }, {
  472. Create("UIListLayout", {
  473. SortOrder = "LayoutOrder",
  474. VerticalAlignment = "Center",
  475. Padding = UDim.new(0, 2)
  476. }),
  477. Create("UIPadding", {
  478. PaddingBottom = UDim.new(0, 5),
  479. PaddingTop = UDim.new(0, 5)
  480. }),
  481. TitleL,
  482. DescL,
  483. })
  484.  
  485. local Label = {}
  486. function Label:SetTitle(NewTitle)
  487. if type(NewTitle) == "string" and NewTitle:gsub(" ", ""):len() > 0 then
  488. TitleL.Text = NewTitle
  489. end
  490. end
  491. function Label:SetDesc(NewDesc)
  492. if type(NewDesc) == "string" and NewDesc:gsub(" ", ""):len() > 0 then
  493. DescL.Visible = true
  494. DescL.Text = NewDesc
  495. LabelHolder.Position = UDim2.new(0, 10, 0)
  496. LabelHolder.AnchorPoint = Vector2.new(0, 0)
  497. else
  498. DescL.Visible = false
  499. DescL.Text = ""
  500. LabelHolder.Position = UDim2.new(0, 10, 0.5)
  501. LabelHolder.AnchorPoint = Vector2.new(0, 0.5)
  502. end
  503. end
  504.  
  505. Label:SetTitle(Title)
  506. Label:SetDesc(Description)
  507. return Frame, Label
  508. end
  509.  
  510. local function GetColor(Instance)
  511. if Instance:IsA("Frame") then
  512. return "BackgroundColor3"
  513. elseif Instance:IsA("ImageLabel") then
  514. return "ImageColor3"
  515. elseif Instance:IsA("TextLabel") then
  516. return "TextColor3"
  517. elseif Instance:IsA("ScrollingFrame") then
  518. return "ScrollBarImageColor3"
  519. elseif Instance:IsA("UIStroke") then
  520. return "Color"
  521. end
  522. return ""
  523. end
  524.  
  525. -- /////////// --
  526. function redzlib:GetIcon(index)
  527. if type(index) ~= "string" or index:find("rbxassetid://") or #index == 0 then
  528. return index
  529. end
  530.  
  531. local firstMatch = nil
  532. index = string.lower(index):gsub("lucide", ""):gsub("-", "")
  533.  
  534. for Name, Icon in self.Icons do
  535. Name = Name:gsub("lucide", ""):gsub("-", "")
  536. if Name == index then
  537. return Icon
  538. elseif not firstMatch and Name:find(index, 1, true) then
  539. firstMatch = Icon
  540. end
  541. end
  542.  
  543. return firstMatch or index
  544. end
  545.  
  546. function redzlib:SetTheme(NewTheme)
  547. if not VerifyTheme(NewTheme) then return end
  548.  
  549. redzlib.Save.Theme = NewTheme
  550. SaveJson("redz library V5.json", redzlib.Save)
  551. Theme = redzlib.Themes[NewTheme]
  552.  
  553. Comnection:FireConnection("ThemeChanged", NewTheme)
  554. table.foreach(redzlib.Instances, function(_,Val)
  555. if Val.Type == "Gradient" then
  556. Val.Instance.Color = Theme["Color Hub 1"]
  557. elseif Val.Type == "Frame" then
  558. Val.Instance.BackgroundColor3 = Theme["Color Hub 2"]
  559. elseif Val.Type == "Stroke" then
  560. Val.Instance[GetColor(Val.Instance)] = Theme["Color Stroke"]
  561. elseif Val.Type == "Theme" then
  562. Val.Instance[GetColor(Val.Instance)] = Theme["Color Theme"]
  563. elseif Val.Type == "Text" then
  564. Val.Instance[GetColor(Val.Instance)] = Theme["Color Text"]
  565. elseif Val.Type == "DarkText" then
  566. Val.Instance[GetColor(Val.Instance)] = Theme["Color Dark Text"]
  567. elseif Val.Type == "ScrollBar" then
  568. Val.Instance[GetColor(Val.Instance)] = Theme["Color Theme"]
  569. end
  570. end)
  571. end
  572.  
  573. function redzlib:SetScale(NewScale)
  574. NewScale = ViewportSize.Y / math.clamp(NewScale, 300, 2000)
  575. UIScale, ScreenGui.Scale.Scale = NewScale, NewScale
  576. end
  577.  
  578. function redzlib:MakeWindow(Configs)
  579. local WTitle = Configs[1] or Configs.Name or Configs.Title or "redz Library V5"
  580. local WMiniText = Configs[2] or Configs.SubTitle or "by : redz9999"
  581.  
  582. Settings.ScriptFile = Configs[3] or Configs.SaveFolder or false
  583.  
  584. local function LoadFile()
  585. local File = Settings.ScriptFile
  586. if type(File) ~= "string" then return end
  587. if not readfile or not isfile then return end
  588. local s, r = pcall(isfile, File)
  589.  
  590. if s and r then
  591. local s, _Flags = pcall(readfile, File)
  592.  
  593. if s and type(_Flags) == "string" then
  594. local s,r = pcall(function() return HttpService:JSONDecode(_Flags) end)
  595. Flags = s and r or {}
  596. end
  597. end
  598. end;LoadFile()
  599.  
  600. local UISizeX, UISizeY = unpack(redzlib.Save.UISize)
  601. local MainFrame = InsertTheme(Create("ImageButton", ScreenGui, {
  602. Size = UDim2.fromOffset(UISizeX, UISizeY),
  603. Position = UDim2.new(0.5, -UISizeX/2, 0.5, -UISizeY/2),
  604. BackgroundTransparency = 0.03,
  605. Name = "Hub"
  606. }), "Main")
  607. Make("Gradient", MainFrame, {
  608. Rotation = 45
  609. })MakeDrag(MainFrame)
  610.  
  611. local MainCorner = Make("Corner", MainFrame)
  612.  
  613. local Components = Create("Folder", MainFrame, {
  614. Name = "Components"
  615. })
  616.  
  617. local DropdownHolder = Create("Folder", ScreenGui, {
  618. Name = "Dropdown"
  619. })
  620.  
  621. local TopBar = Create("Frame", Components, {
  622. Size = UDim2.new(1, 0, 0, 28),
  623. BackgroundTransparency = 1,
  624. Name = "Top Bar"
  625. })
  626.  
  627. local Title = InsertTheme(Create("TextLabel", TopBar, {
  628. Position = UDim2.new(0, 15, 0.5),
  629. AnchorPoint = Vector2.new(0, 0.5),
  630. AutomaticSize = "XY",
  631. Text = WTitle,
  632. TextXAlignment = "Left",
  633. TextSize = 12,
  634. TextColor3 = Theme["Color Text"],
  635. BackgroundTransparency = 1,
  636. Font = Enum.Font.GothamMedium,
  637. Name = "Title"
  638. }, {
  639. InsertTheme(Create("TextLabel", {
  640. Size = UDim2.fromScale(0, 1),
  641. AutomaticSize = "X",
  642. AnchorPoint = Vector2.new(0, 1),
  643. Position = UDim2.new(1, 5, 0.9),
  644. Text = WMiniText,
  645. TextColor3 = Theme["Color Dark Text"],
  646. BackgroundTransparency = 1,
  647. TextXAlignment = "Left",
  648. TextYAlignment = "Bottom",
  649. TextSize = 8,
  650. Font = Enum.Font.Gotham,
  651. Name = "SubTitle"
  652. }), "DarkText")
  653. }), "Text")
  654.  
  655. local MainScroll = InsertTheme(Create("ScrollingFrame", Components, {
  656. Size = UDim2.new(0, redzlib.Save.TabSize, 1, -TopBar.Size.Y.Offset),
  657. ScrollBarImageColor3 = Theme["Color Theme"],
  658. Position = UDim2.new(0, 0, 1, 0),
  659. AnchorPoint = Vector2.new(0, 1),
  660. ScrollBarThickness = 1.5,
  661. BackgroundTransparency = 1,
  662. ScrollBarImageTransparency = 0.2,
  663. CanvasSize = UDim2.new(),
  664. AutomaticCanvasSize = "Y",
  665. ScrollingDirection = "Y",
  666. BorderSizePixel = 0,
  667. Name = "Tab Scroll"
  668. }, {
  669. Create("UIPadding", {
  670. PaddingLeft = UDim.new(0, 10),
  671. PaddingRight = UDim.new(0, 10),
  672. PaddingTop = UDim.new(0, 10),
  673. PaddingBottom = UDim.new(0, 10)
  674. }), Create("UIListLayout", {
  675. Padding = UDim.new(0, 5)
  676. })
  677. }), "ScrollBar")
  678.  
  679. local Containers = Create("Frame", Components, {
  680. Size = UDim2.new(1, -MainScroll.Size.X.Offset, 1, -TopBar.Size.Y.Offset),
  681. AnchorPoint = Vector2.new(1, 1),
  682. Position = UDim2.new(1, 0, 1, 0),
  683. BackgroundTransparency = 1,
  684. ClipsDescendants = true,
  685. Name = "Containers"
  686. })
  687.  
  688. local ControlSize1, ControlSize2 = MakeDrag(Create("ImageButton", MainFrame, {
  689. Size = UDim2.new(0, 35, 0, 35),
  690. Position = MainFrame.Size,
  691. Active = true,
  692. AnchorPoint = Vector2.new(0.8, 0.8),
  693. BackgroundTransparency = 1,
  694. Name = "Control Hub Size"
  695. })), MakeDrag(Create("ImageButton", MainFrame, {
  696. Size = UDim2.new(0, 20, 1, -30),
  697. Position = UDim2.new(0, MainScroll.Size.X.Offset, 1, 0),
  698. AnchorPoint = Vector2.new(0.5, 1),
  699. Active = true,
  700. BackgroundTransparency = 1,
  701. Name = "Control Tab Size"
  702. }))
  703.  
  704. local function ControlSize()
  705. local Pos1, Pos2 = ControlSize1.Position, ControlSize2.Position
  706. ControlSize1.Position = UDim2.fromOffset(math.clamp(Pos1.X.Offset, 430, 1000), math.clamp(Pos1.Y.Offset, 200, 500))
  707. ControlSize2.Position = UDim2.new(0, math.clamp(Pos2.X.Offset, 135, 250), 1, 0)
  708.  
  709. MainScroll.Size = UDim2.new(0, ControlSize2.Position.X.Offset, 1, -TopBar.Size.Y.Offset)
  710. Containers.Size = UDim2.new(1, -MainScroll.Size.X.Offset, 1, -TopBar.Size.Y.Offset)
  711. MainFrame.Size = ControlSize1.Position
  712. end
  713.  
  714. ControlSize1:GetPropertyChangedSignal("Position"):Connect(ControlSize)
  715. ControlSize2:GetPropertyChangedSignal("Position"):Connect(ControlSize)
  716.  
  717. ConnectSave(ControlSize1, function()
  718. if not Minimized then
  719. redzlib.Save.UISize = {MainFrame.Size.X.Offset, MainFrame.Size.Y.Offset}
  720. SaveJson("redz library V5.json", redzlib.Save)
  721. end
  722. end)
  723.  
  724. ConnectSave(ControlSize2, function()
  725. redzlib.Save.TabSize = MainScroll.Size.X.Offset
  726. SaveJson("redz library V5.json", redzlib.Save)
  727. end)
  728.  
  729. local ButtonsFolder = Create("Folder", TopBar, {
  730. Name = "Buttons"
  731. })
  732.  
  733. local CloseButton = Create("ImageButton", {
  734. Size = UDim2.new(0, 14, 0, 14),
  735. Position = UDim2.new(1, -10, 0.5),
  736. AnchorPoint = Vector2.new(1, 0.5),
  737. BackgroundTransparency = 1,
  738. Image = "rbxassetid://10747384394",
  739. AutoButtonColor = false,
  740. Name = "Close"
  741. })
  742.  
  743. local MinimizeButton = SetProps(CloseButton:Clone(), {
  744. Position = UDim2.new(1, -35, 0.5),
  745. Image = "rbxassetid://10734896206",
  746. Name = "Minimize"
  747. })
  748.  
  749. SetChildren(ButtonsFolder, {
  750. CloseButton,
  751. MinimizeButton
  752. })
  753.  
  754. local Minimized, SaveSize, WaitClick
  755. local Window, FirstTab = {}, false
  756. function Window:CloseBtn()
  757. local Dialog = Window:Dialog({
  758. Title = "Close",
  759. Text = "Are you sure you want to close this script??",
  760. Options = {
  761. {"Confirm", function()
  762. ScreenGui:Destroy()
  763. end},
  764. {"Cancel"}
  765. }
  766. })
  767. end
  768. function Window:MinimizeBtn()
  769. if WaitClick then return end
  770. WaitClick = true
  771.  
  772. if Minimized then
  773. MinimizeButton.Image = "rbxassetid://10734896206"
  774. CreateTween({MainFrame, "Size", SaveSize, 0.25, true})
  775. ControlSize1.Visible = true
  776. ControlSize2.Visible = true
  777. Minimized = false
  778. else
  779. MinimizeButton.Image = "rbxassetid://10734924532"
  780. SaveSize = MainFrame.Size
  781. ControlSize1.Visible = false
  782. ControlSize2.Visible = false
  783. CreateTween({MainFrame, "Size", UDim2.fromOffset(MainFrame.Size.X.Offset, 28), 0.25, true})
  784. Minimized = true
  785. end
  786.  
  787. WaitClick = false
  788. end
  789. function Window:Minimize()
  790. MainFrame.Visible = not MainFrame.Visible
  791. end
  792. function Window:AddMinimizeButton(Configs)
  793. local Button = MakeDrag(Create("ImageButton", ScreenGui, {
  794. Size = UDim2.fromOffset(35, 35),
  795. Position = UDim2.fromScale(0.15, 0.15),
  796. BackgroundTransparency = 1,
  797. BackgroundColor3 = Theme["Color Hub 2"],
  798. AutoButtonColor = false
  799. }))
  800.  
  801. local Stroke, Corner
  802. if Configs.Corner then
  803. Corner = Make("Corner", Button)
  804. SetProps(Corner, Configs.Corner)
  805. end
  806. if Configs.Stroke then
  807. Stroke = Make("Stroke", Button)
  808. SetProps(Stroke, Configs.Corner)
  809. end
  810.  
  811. SetProps(Button, Configs.Button)
  812. Button.Activated:Connect(Window.Minimize)
  813.  
  814. return {
  815. Stroke = Stroke,
  816. Corner = Corner,
  817. Button = Button
  818. }
  819. end
  820. function Window:Set(Val1, Val2)
  821. if type(Val1) == "string" and type(Val2) == "string" then
  822. Title.Text = Val1
  823. Title.SubTitle.Text = Val2
  824. elseif type(Val1) == "string" then
  825. Title.Text = Val1
  826. end
  827. end
  828. function Window:Dialog(Configs)
  829. if MainFrame:FindFirstChild("Dialog") then return end
  830. if Minimized then
  831. Window:MinimizeBtn()
  832. end
  833.  
  834. local DTitle = Configs[1] or Configs.Title or "Dialog"
  835. local DText = Configs[2] or Configs.Text or "This is a Dialog"
  836. local DOptions = Configs[3] or Configs.Options or {}
  837.  
  838. local Frame = Create("Frame", {
  839. Active = true,
  840. Size = UDim2.fromOffset(250 * 1.08, 150 * 1.08),
  841. Position = UDim2.fromScale(0.5, 0.5),
  842. AnchorPoint = Vector2.new(0.5, 0.5)
  843. }, {
  844. InsertTheme(Create("TextLabel", {
  845. Font = Enum.Font.GothamBold,
  846. Size = UDim2.new(1, 0, 0, 20),
  847. Text = DTitle,
  848. TextXAlignment = "Left",
  849. TextColor3 = Theme["Color Text"],
  850. TextSize = 15,
  851. Position = UDim2.fromOffset(15, 5),
  852. BackgroundTransparency = 1
  853. }), "Text"),
  854. InsertTheme(Create("TextLabel", {
  855. Font = Enum.Font.GothamMedium,
  856. Size = UDim2.new(1, -25),
  857. AutomaticSize = "Y",
  858. Text = DText,
  859. TextXAlignment = "Left",
  860. TextColor3 = Theme["Color Dark Text"],
  861. TextSize = 12,
  862. Position = UDim2.fromOffset(15, 25),
  863. BackgroundTransparency = 1,
  864. TextWrapped = true
  865. }), "DarkText")
  866. })Make("Gradient", Frame, {Rotation = 270})Make("Corner", Frame)
  867.  
  868. local ButtonsHolder = Create("Frame", Frame, {
  869. Size = UDim2.fromScale(1, 0.35),
  870. Position = UDim2.fromScale(0, 1),
  871. AnchorPoint = Vector2.new(0, 1),
  872. BackgroundColor3 = Theme["Color Hub 2"],
  873. BackgroundTransparency = 1
  874. }, {
  875. Create("UIListLayout", {
  876. Padding = UDim.new(0, 10),
  877. VerticalAlignment = "Center",
  878. FillDirection = "Horizontal",
  879. HorizontalAlignment = "Center"
  880. })
  881. })
  882.  
  883. local Screen = InsertTheme(Create("Frame", MainFrame, {
  884. BackgroundTransparency = 0.6,
  885. Active = true,
  886. BackgroundColor3 = Theme["Color Hub 2"],
  887. Size = UDim2.new(1, 0, 1, 0),
  888. BackgroundColor3 = Theme["Color Stroke"],
  889. Name = "Dialog"
  890. }), "Stroke")
  891.  
  892. MainCorner:Clone().Parent = Screen
  893. Frame.Parent = Screen
  894. CreateTween({Frame, "Size", UDim2.fromOffset(250, 150), 0.2})
  895. CreateTween({Frame, "Transparency", 0, 0.15})
  896. CreateTween({Screen, "Transparency", 0.3, 0.15})
  897.  
  898. local ButtonCount, Dialog = 1, {}
  899. function Dialog:Button(Configs)
  900. local Name = Configs[1] or Configs.Name or Configs.Title or ""
  901. local Callback = Configs[2] or Configs.Callback or function()end
  902.  
  903. ButtonCount = ButtonCount + 1
  904. local Button = Make("Button", ButtonsHolder)
  905. Make("Corner", Button)
  906. SetProps(Button, {
  907. Text = Name,
  908. Font = Enum.Font.GothamBold,
  909. TextColor3 = Theme["Color Text"],
  910. TextSize = 12
  911. })
  912.  
  913. for _,Button in pairs(ButtonsHolder:GetChildren()) do
  914. if Button:IsA("TextButton") then
  915. Button.Size = UDim2.new(1 / ButtonCount, -(((ButtonCount - 1) * 20) / ButtonCount), 0, 32) -- Fluent Library :)
  916. end
  917. end
  918. Button.Activated:Connect(Dialog.Close)
  919. Button.Activated:Connect(Callback)
  920. end
  921. function Dialog:Close()
  922. CreateTween({Frame, "Size", UDim2.fromOffset(250 * 1.08, 150 * 1.08), 0.2})
  923. CreateTween({Screen, "Transparency", 1, 0.15})
  924. CreateTween({Frame, "Transparency", 1, 0.15, true})
  925. Screen:Destroy()
  926. end
  927. table.foreach(DOptions, function(_,Button)
  928. Dialog:Button(Button)
  929. end)
  930. return Dialog
  931. end
  932. function Window:SelectTab(TabSelect)
  933. if type(TabSelect) == "number" then
  934. redzlib.Tabs[TabSelect].func:Enable()
  935. else
  936. for _,Tab in pairs(redzlib.Tabs) do
  937. if Tab.Cont == TabSelect.Cont then
  938. Tab.func:Enable()
  939. end
  940. end
  941. end
  942. end
  943.  
  944. local ContainerList = {}
  945. function Window:MakeTab(paste, Configs)
  946. if type(paste) == "table" then Configs = paste end
  947. local TName = Configs[1] or Configs.Title or "Tab!"
  948. local TIcon = Configs[2] or Configs.Icon or ""
  949.  
  950. TIcon = redzlib:GetIcon(TIcon)
  951. if not TIcon:find("rbxassetid://") or TIcon:gsub("rbxassetid://", ""):len() < 6 then
  952. TIcon = false
  953. end
  954.  
  955. local TabSelect = Make("Button", MainScroll, {
  956. Size = UDim2.new(1, 0, 0, 24)
  957. })Make("Corner", TabSelect)
  958.  
  959. local LabelTitle = InsertTheme(Create("TextLabel", TabSelect, {
  960. Size = UDim2.new(1, TIcon and -25 or -15, 1),
  961. Position = UDim2.fromOffset(TIcon and 25 or 15),
  962. BackgroundTransparency = 1,
  963. Font = Enum.Font.GothamMedium,
  964. Text = TName,
  965. TextColor3 = Theme["Color Text"],
  966. TextSize = 10,
  967. TextXAlignment = Enum.TextXAlignment.Left,
  968. TextTransparency = (FirstTab and 0.3) or 0,
  969. TextTruncate = "AtEnd"
  970. }), "Text")
  971.  
  972. local LabelIcon = InsertTheme(Create("ImageLabel", TabSelect, {
  973. Position = UDim2.new(0, 8, 0.5),
  974. Size = UDim2.new(0, 13, 0, 13),
  975. AnchorPoint = Vector2.new(0, 0.5),
  976. Image = TIcon or "",
  977. BackgroundTransparency = 1,
  978. ImageTransparency = (FirstTab and 0.3) or 0
  979. }), "Text")
  980.  
  981. local Selected = InsertTheme(Create("Frame", TabSelect, {
  982. Size = FirstTab and UDim2.new(0, 4, 0, 4) or UDim2.new(0, 4, 0, 13),
  983. Position = UDim2.new(0, 1, 0.5),
  984. AnchorPoint = Vector2.new(0, 0.5),
  985. BackgroundColor3 = Theme["Color Theme"],
  986. BackgroundTransparency = FirstTab and 1 or 0
  987. }), "Theme")Make("Corner", Selected, UDim.new(0.5, 0))
  988.  
  989. local Container = InsertTheme(Create("ScrollingFrame", {
  990. Size = UDim2.new(1, 0, 1, 0),
  991. Position = UDim2.new(0, 0, 1),
  992. AnchorPoint = Vector2.new(0, 1),
  993. ScrollBarThickness = 1.5,
  994. BackgroundTransparency = 1,
  995. ScrollBarImageTransparency = 0.2,
  996. ScrollBarImageColor3 = Theme["Color Theme"],
  997. AutomaticCanvasSize = "Y",
  998. ScrollingDirection = "Y",
  999. BorderSizePixel = 0,
  1000. CanvasSize = UDim2.new(),
  1001. Name = ("Container %i [ %s ]"):format(#ContainerList + 1, TName)
  1002. }, {
  1003. Create("UIPadding", {
  1004. PaddingLeft = UDim.new(0, 10),
  1005. PaddingRight = UDim.new(0, 10),
  1006. PaddingTop = UDim.new(0, 10),
  1007. PaddingBottom = UDim.new(0, 10)
  1008. }), Create("UIListLayout", {
  1009. Padding = UDim.new(0, 5)
  1010. })
  1011. }), "ScrollBar")
  1012.  
  1013. table.insert(ContainerList, Container)
  1014.  
  1015. if not FirstTab then Container.Parent = Containers end
  1016.  
  1017. local function Tabs()
  1018. if Container.Parent then return end
  1019. for _,Frame in pairs(ContainerList) do
  1020. if Frame:IsA("ScrollingFrame") and Frame ~= Container then
  1021. Frame.Parent = nil
  1022. end
  1023. end
  1024. Container.Parent = Containers
  1025. Container.Size = UDim2.new(1, 0, 1, 150)
  1026. table.foreach(redzlib.Tabs, function(_,Tab)
  1027. if Tab.Cont ~= Container then
  1028. Tab.func:Disable()
  1029. end
  1030. end)
  1031. CreateTween({Container, "Size", UDim2.new(1, 0, 1, 0), 0.3})
  1032. CreateTween({LabelTitle, "TextTransparency", 0, 0.35})
  1033. CreateTween({LabelIcon, "ImageTransparency", 0, 0.35})
  1034. CreateTween({Selected, "Size", UDim2.new(0, 4, 0, 13), 0.35})
  1035. CreateTween({Selected, "BackgroundTransparency", 0, 0.35})
  1036. end
  1037. TabSelect.Activated:Connect(Tabs)
  1038.  
  1039. FirstTab = true
  1040. local Tab = {}
  1041. table.insert(redzlib.Tabs, {TabInfo = {Name = TName, Icon = TIcon}, func = Tab, Cont = Container})
  1042. Tab.Cont = Container
  1043.  
  1044. function Tab:Disable()
  1045. Container.Parent = nil
  1046. CreateTween({LabelTitle, "TextTransparency", 0.3, 0.35})
  1047. CreateTween({LabelIcon, "ImageTransparency", 0.3, 0.35})
  1048. CreateTween({Selected, "Size", UDim2.new(0, 4, 0, 4), 0.35})
  1049. CreateTween({Selected, "BackgroundTransparency", 1, 0.35})
  1050. end
  1051. function Tab:Enable()
  1052. Tabs()
  1053. end
  1054. function Tab:Visible(Bool)
  1055. Funcs:ToggleVisible(TabSelect, Bool)
  1056. Funcs:ToggleParent(Container, Bool, Containers)
  1057. end
  1058. function Tab:Destroy() TabSelect:Destroy() Container:Destroy() end
  1059.  
  1060. function Tab:AddSection(Configs)
  1061. local SectionName = type(Configs) == "string" and Configs or Configs[1] or Configs.Name or Configs.Title or Configs.Section
  1062.  
  1063. local SectionFrame = Create("Frame", Container, {
  1064. Size = UDim2.new(1, 0, 0, 20),
  1065. BackgroundTransparency = 1,
  1066. Name = "Option"
  1067. })
  1068.  
  1069. local SectionLabel = InsertTheme(Create("TextLabel", SectionFrame, {
  1070. Font = Enum.Font.GothamBold,
  1071. Text = SectionName,
  1072. TextColor3 = Theme["Color Text"],
  1073. Size = UDim2.new(1, -25, 1, 0),
  1074. Position = UDim2.new(0, 5),
  1075. BackgroundTransparency = 1,
  1076. TextTruncate = "AtEnd",
  1077. TextSize = 14,
  1078. TextXAlignment = "Left"
  1079. }), "Text")
  1080.  
  1081. local Section = {}
  1082. table.insert(redzlib.Options, {type = "Section", Name = SectionName, func = Section})
  1083. function Section:Visible(Bool)
  1084. if Bool == nil then SectionFrame.Visible = not SectionFrame.Visible return end
  1085. SectionFrame.Visible = Bool
  1086. end
  1087. function Section:Destroy()
  1088. SectionFrame:Destroy()
  1089. end
  1090. function Section:Set(New)
  1091. if New then
  1092. SectionLabel.Text = GetStr(New)
  1093. end
  1094. end
  1095. return Section
  1096. end
  1097. function Tab:AddParagraph(Configs)
  1098. local PName = Configs[1] or Configs.Title or "Paragraph"
  1099. local PDesc = Configs[2] or Configs.Text or ""
  1100.  
  1101. local Frame, LabelFunc = ButtonFrame(Container, PName, PDesc, UDim2.new(1, -20))
  1102.  
  1103. local Paragraph = {}
  1104. function Paragraph:Visible(...) Funcs:ToggleVisible(Frame, ...) end
  1105. function Paragraph:Destroy() Frame:Destroy() end
  1106. function Paragraph:SetTitle(Val)
  1107. LabelFunc:SetTitle(GetStr(Val))
  1108. end
  1109. function Paragraph:SetDesc(Val)
  1110. LabelFunc:SetDesc(GetStr(Val))
  1111. end
  1112. function Paragraph:Set(Val1, Val2)
  1113. if Val1 and Val2 then
  1114. LabelFunc:SetTitle(GetStr(Val1))
  1115. LabelFunc:SetDesc(GetStr(Val2))
  1116. elseif Val1 then
  1117. LabelFunc:SetDesc(GetStr(Val1))
  1118. end
  1119. end
  1120. return Paragraph
  1121. end
  1122. function Tab:AddButton(Configs)
  1123. local BName = Configs[1] or Configs.Name or Configs.Title or "Button!"
  1124. local BDescription = Configs.Desc or Configs.Description or ""
  1125. local Callback = Funcs:GetCallback(Configs, 2)
  1126.  
  1127. local FButton, LabelFunc = ButtonFrame(Container, BName, BDescription, UDim2.new(1, -20))
  1128.  
  1129. local ButtonIcon = Create("ImageLabel", FButton, {
  1130. Size = UDim2.new(0, 14, 0, 14),
  1131. Position = UDim2.new(1, -10, 0.5),
  1132. AnchorPoint = Vector2.new(1, 0.5),
  1133. BackgroundTransparency = 1,
  1134. Image = "rbxassetid://10709791437"
  1135. })
  1136.  
  1137. FButton.Activated:Connect(function()
  1138. Funcs:FireCallback(Callback)
  1139. end)
  1140.  
  1141. local Button = {}
  1142. function Button:Visible(...) Funcs:ToggleVisible(FButton, ...) end
  1143. function Button:Destroy() FButton:Destroy() end
  1144. function Button:Callback(...) Funcs:InsertCallback(Callback, ...) end
  1145. function Button:Set(Val1, Val2)
  1146. if type(Val1) == "string" and type(Val2) == "string" then
  1147. LabelFunc:SetTitle(Val1)
  1148. LabelFunc:SetDesc(Val2)
  1149. elseif type(Val1) == "string" then
  1150. LabelFunc:SetTitle(Val1)
  1151. elseif type(Val1) == "function" then
  1152. Callback = Val1
  1153. end
  1154. end
  1155. return Button
  1156. end
  1157. function Tab:AddToggle(Configs)
  1158. local TName = Configs[1] or Configs.Name or Configs.Title or "Toggle"
  1159. local TDesc = Configs.Desc or Configs.Description or ""
  1160. local Callback = Funcs:GetCallback(Configs, 3)
  1161. local Flag = Configs[4] or Configs.Flag or false
  1162. local Default = Configs[2] or Configs.Default or false
  1163. if CheckFlag(Flag) then Default = GetFlag(Flag) end
  1164.  
  1165. local Button, LabelFunc = ButtonFrame(Container, TName, TDesc, UDim2.new(1, -38))
  1166.  
  1167. local ToggleHolder = InsertTheme(Create("Frame", Button, {
  1168. Size = UDim2.new(0, 35, 0, 18),
  1169. Position = UDim2.new(1, -10, 0.5),
  1170. AnchorPoint = Vector2.new(1, 0.5),
  1171. BackgroundColor3 = Theme["Color Stroke"]
  1172. }), "Stroke")Make("Corner", ToggleHolder, UDim.new(0.5, 0))
  1173.  
  1174. local Slider = Create("Frame", ToggleHolder, {
  1175. BackgroundTransparency = 1,
  1176. Size = UDim2.new(0.8, 0, 0.8, 0),
  1177. Position = UDim2.new(0.5, 0, 0.5, 0),
  1178. AnchorPoint = Vector2.new(0.5, 0.5)
  1179. })
  1180.  
  1181. local Toggle = InsertTheme(Create("Frame", Slider, {
  1182. Size = UDim2.new(0, 12, 0, 12),
  1183. Position = UDim2.new(0, 0, 0.5),
  1184. AnchorPoint = Vector2.new(0, 0.5),
  1185. BackgroundColor3 = Theme["Color Theme"]
  1186. }), "Theme")Make("Corner", Toggle, UDim.new(0.5, 0))
  1187.  
  1188. local WaitClick
  1189. local function SetToggle(Val)
  1190. if WaitClick then return end
  1191.  
  1192. WaitClick, Default = true, Val
  1193. SetFlag(Flag, Default)
  1194. Funcs:FireCallback(Callback, Default)
  1195. if Default then
  1196. CreateTween({Toggle, "Position", UDim2.new(1, 0, 0.5), 0.25})
  1197. CreateTween({Toggle, "BackgroundTransparency", 0, 0.25})
  1198. CreateTween({Toggle, "AnchorPoint", Vector2.new(1, 0.5), 0.25, Wait or false})
  1199. else
  1200. CreateTween({Toggle, "Position", UDim2.new(0, 0, 0.5), 0.25})
  1201. CreateTween({Toggle, "BackgroundTransparency", 0.8, 0.25})
  1202. CreateTween({Toggle, "AnchorPoint", Vector2.new(0, 0.5), 0.25, Wait or false})
  1203. end
  1204. WaitClick = false
  1205. end;task.spawn(SetToggle, Default)
  1206.  
  1207. Button.Activated:Connect(function()
  1208. SetToggle(not Default)
  1209. end)
  1210.  
  1211. local Toggle = {}
  1212. function Toggle:Visible(...) Funcs:ToggleVisible(Button, ...) end
  1213. function Toggle:Destroy() Button:Destroy() end
  1214. function Toggle:Callback(...) Funcs:InsertCallback(Callback, ...)() end
  1215. function Toggle:Set(Val1, Val2)
  1216. if type(Val1) == "string" and type(Val2) == "string" then
  1217. LabelFunc:SetTitle(Val1)
  1218. LabelFunc:SetDesc(Val2)
  1219. elseif type(Val1) == "string" then
  1220. LabelFunc:SetTitle(Val1, false, true)
  1221. elseif type(Val1) == "boolean" then
  1222. if WaitClick and Val2 then
  1223. repeat task.wait() until not WaitClick
  1224. end
  1225. task.spawn(SetToggle, Val1)
  1226. elseif type(Val1) == "function" then
  1227. Callback = Val1
  1228. end
  1229. end
  1230. return Toggle
  1231. end
  1232. function Tab:AddDropdown(Configs)
  1233. local DName = Configs[1] or Configs.Name or Configs.Title or "Dropdown"
  1234. local DDesc = Configs.Desc or Configs.Description or ""
  1235. local DOptions = Configs[2] or Configs.Options or {}
  1236. local OpDefault = Configs[3] or Configs.Default or {}
  1237. local Flag = Configs[5] or Configs.Flag or false
  1238. local DMultiSelect = Configs.MultiSelect or false
  1239. local Callback = Funcs:GetCallback(Configs, 4)
  1240.  
  1241. local Button, LabelFunc = ButtonFrame(Container, DName, DDesc, UDim2.new(1, -180))
  1242.  
  1243. local SelectedFrame = InsertTheme(Create("Frame", Button, {
  1244. Size = UDim2.new(0, 150, 0, 18),
  1245. Position = UDim2.new(1, -10, 0.5),
  1246. AnchorPoint = Vector2.new(1, 0.5),
  1247. BackgroundColor3 = Theme["Color Stroke"]
  1248. }), "Stroke")Make("Corner", SelectedFrame, UDim.new(0, 4))
  1249.  
  1250. local ActiveLabel = InsertTheme(Create("TextLabel", SelectedFrame, {
  1251. Size = UDim2.new(0.85, 0, 0.85, 0),
  1252. AnchorPoint = Vector2.new(0.5, 0.5),
  1253. Position = UDim2.new(0.5, 0, 0.5, 0),
  1254. BackgroundTransparency = 1,
  1255. Font = Enum.Font.GothamBold,
  1256. TextScaled = true,
  1257. TextColor3 = Theme["Color Text"],
  1258. Text = "..."
  1259. }), "Text")
  1260.  
  1261. local Arrow = Create("ImageLabel", SelectedFrame, {
  1262. Size = UDim2.new(0, 15, 0, 15),
  1263. Position = UDim2.new(0, -5, 0.5),
  1264. AnchorPoint = Vector2.new(1, 0.5),
  1265. Image = "rbxassetid://10709791523",
  1266. BackgroundTransparency = 1
  1267. })
  1268.  
  1269. local NoClickFrame = Create("TextButton", DropdownHolder, {
  1270. Name = "AntiClick",
  1271. Size = UDim2.new(1, 0, 1, 0),
  1272. BackgroundTransparency = 1,
  1273. Visible = false,
  1274. Text = ""
  1275. })
  1276.  
  1277. local DropFrame = Create("Frame", NoClickFrame, {
  1278. Size = UDim2.new(SelectedFrame.Size.X, 0, 0),
  1279. BackgroundTransparency = 0.1,
  1280. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1281. AnchorPoint = Vector2.new(0, 1),
  1282. Name = "DropdownFrame",
  1283. ClipsDescendants = true,
  1284. Active = true
  1285. })Make("Corner", DropFrame)Make("Stroke", DropFrame)Make("Gradient", DropFrame, {Rotation = 60})
  1286.  
  1287. local ScrollFrame = InsertTheme(Create("ScrollingFrame", DropFrame, {
  1288. ScrollBarImageColor3 = Theme["Color Theme"],
  1289. Size = UDim2.new(1, 0, 1, 0),
  1290. ScrollBarThickness = 1.5,
  1291. BackgroundTransparency = 1,
  1292. BorderSizePixel = 0,
  1293. CanvasSize = UDim2.new(),
  1294. ScrollingDirection = "Y",
  1295. AutomaticCanvasSize = "Y",
  1296. Active = true
  1297. }, {
  1298. Create("UIPadding", {
  1299. PaddingLeft = UDim.new(0, 8),
  1300. PaddingRight = UDim.new(0, 8),
  1301. PaddingTop = UDim.new(0, 5),
  1302. PaddingBottom = UDim.new(0, 5)
  1303. }), Create("UIListLayout", {
  1304. Padding = UDim.new(0, 4)
  1305. })
  1306. }), "ScrollBar")
  1307.  
  1308. local ScrollSize, WaitClick = 5
  1309. local function Disable()
  1310. WaitClick = true
  1311. CreateTween({Arrow, "Rotation", 0, 0.2})
  1312. CreateTween({DropFrame, "Size", UDim2.new(0, 152, 0, 0), 0.2, true})
  1313. CreateTween({Arrow, "ImageColor3", Color3.fromRGB(255, 255, 255), 0.2})
  1314. Arrow.Image = "rbxassetid://10709791523"
  1315. NoClickFrame.Visible = false
  1316. WaitClick = false
  1317. end
  1318.  
  1319. local function GetFrameSize()
  1320. return UDim2.fromOffset(152, ScrollSize)
  1321. end
  1322.  
  1323. local function CalculateSize()
  1324. local Count = 0
  1325. for _,Frame in pairs(ScrollFrame:GetChildren()) do
  1326. if Frame:IsA("Frame") or Frame.Name == "Option" then
  1327. Count = Count + 1
  1328. end
  1329. end
  1330. ScrollSize = (math.clamp(Count, 0, 10) * 25) + 10
  1331. if NoClickFrame.Visible then
  1332. NoClickFrame.Visible = true
  1333. CreateTween({DropFrame, "Size", GetFrameSize(), 0.2, true})
  1334. end
  1335. end
  1336.  
  1337. local function Minimize()
  1338. if WaitClick then return end
  1339. WaitClick = true
  1340. if NoClickFrame.Visible then
  1341. Arrow.Image = "rbxassetid://10709791523"
  1342. CreateTween({Arrow, "ImageColor3", Color3.fromRGB(255, 255, 255), 0.2})
  1343. CreateTween({DropFrame, "Size", UDim2.new(0, 152, 0, 0), 0.2, true})
  1344. NoClickFrame.Visible = false
  1345. else
  1346. NoClickFrame.Visible = true
  1347. Arrow.Image = "rbxassetid://10709790948"
  1348. CreateTween({Arrow, "ImageColor3", Theme["Color Theme"], 0.2})
  1349. CreateTween({DropFrame, "Size", GetFrameSize(), 0.2, true})
  1350. end
  1351. WaitClick = false
  1352. end
  1353.  
  1354. local function CalculatePos()
  1355. local FramePos = SelectedFrame.AbsolutePosition
  1356. local ScreenSize = ScreenGui.AbsoluteSize
  1357. local ClampX = math.clamp((FramePos.X / UIScale), 0, ScreenSize.X / UIScale - DropFrame.Size.X.Offset)
  1358. local ClampY = math.clamp((FramePos.Y / UIScale) , 0, ScreenSize.Y / UIScale)
  1359.  
  1360. local NewPos = UDim2.fromOffset(ClampX, ClampY)
  1361. local AnchorPoint = FramePos.Y > ScreenSize.Y / 1.4 and 1 or ScrollSize > 80 and 0.5 or 0
  1362. DropFrame.AnchorPoint = Vector2.new(0, AnchorPoint)
  1363. CreateTween({DropFrame, "Position", NewPos, 0.1})
  1364. end
  1365.  
  1366. local AddNewOptions, GetOptions, AddOption, RemoveOption, Selected do
  1367. local Default = type(OpDefault) ~= "table" and {OpDefault} or OpDefault
  1368. local MultiSelect = DMultiSelect
  1369. local Options = {}
  1370. Selected = MultiSelect and {} or CheckFlag(Flag) and GetFlag(Flag) or Default[1]
  1371.  
  1372. if MultiSelect then
  1373. for index, Value in pairs(CheckFlag(Flag) and GetFlag(Flag) or Default) do
  1374. if type(index) == "string" and (DOptions[index] or table.find(DOptions, index)) then
  1375. Selected[index] = Value
  1376. elseif DOptions[Value] then
  1377. Selected[Value] = true
  1378. end
  1379. end
  1380. end
  1381.  
  1382. local function CallbackSelected()
  1383. SetFlag(Flag, MultiSelect and Selected or tostring(Selected))
  1384. Funcs:FireCallback(Callback, Selected)
  1385. end
  1386.  
  1387. local function UpdateLabel()
  1388. if MultiSelect then
  1389. local list = {}
  1390. for index, Value in pairs(Selected) do
  1391. if Value then
  1392. table.insert(list, index)
  1393. end
  1394. end
  1395. ActiveLabel.Text = #list > 0 and table.concat(list, ", ") or "..."
  1396. else
  1397. ActiveLabel.Text = tostring(Selected or "...")
  1398. end
  1399. end
  1400.  
  1401. local function UpdateSelected()
  1402. if MultiSelect then
  1403. for _,v in pairs(Options) do
  1404. local nodes, Stats = v.nodes, v.Stats
  1405. CreateTween({nodes[2], "BackgroundTransparency", Stats and 0 or 0.8, 0.35})
  1406. CreateTween({nodes[2], "Size", Stats and UDim2.fromOffset(4, 12) or UDim2.fromOffset(4, 4), 0.35})
  1407. CreateTween({nodes[3], "TextTransparency", Stats and 0 or 0.4, 0.35})
  1408. end
  1409. else
  1410. for _,v in pairs(Options) do
  1411. local Slt = v.Value == Selected
  1412. local nodes = v.nodes
  1413. CreateTween({nodes[2], "BackgroundTransparency", Slt and 0 or 1, 0.35})
  1414. CreateTween({nodes[2], "Size", Slt and UDim2.fromOffset(4, 14) or UDim2.fromOffset(4, 4), 0.35})
  1415. CreateTween({nodes[3], "TextTransparency", Slt and 0 or 0.4, 0.35})
  1416. end
  1417. end
  1418. UpdateLabel()
  1419. end
  1420.  
  1421. local function Select(Option)
  1422. if MultiSelect then
  1423. Option.Stats = not Option.Stats
  1424. Option.LastCB = tick()
  1425.  
  1426. Selected[Option.Name] = Option.Stats
  1427. CallbackSelected()
  1428. else
  1429. Option.LastCB = tick()
  1430.  
  1431. Selected = Option.Value
  1432. CallbackSelected()
  1433. end
  1434. UpdateSelected()
  1435. end
  1436.  
  1437. AddOption = function(index, Value)
  1438. local Name = tostring(type(index) == "string" and index or Value)
  1439.  
  1440. if Options[Name] then return end
  1441. Options[Name] = {
  1442. index = index,
  1443. Value = Value,
  1444. Name = Name,
  1445. Stats = false,
  1446. LastCB = 0
  1447. }
  1448.  
  1449. if MultiSelect then
  1450. local Stats = Selected[Name]
  1451. Selected[Name] = Stats or false
  1452. Options[Name].Stats = Stats
  1453. end
  1454.  
  1455. local Button = Make("Button", ScrollFrame, {
  1456. Name = "Option",
  1457. Size = UDim2.new(1, 0, 0, 21),
  1458. Position = UDim2.new(0, 0, 0.5),
  1459. AnchorPoint = Vector2.new(0, 0.5)
  1460. })Make("Corner", Button, UDim.new(0, 4))
  1461.  
  1462. local IsSelected = InsertTheme(Create("Frame", Button, {
  1463. Position = UDim2.new(0, 1, 0.5),
  1464. Size = UDim2.new(0, 4, 0, 4),
  1465. BackgroundColor3 = Theme["Color Theme"],
  1466. BackgroundTransparency = 1,
  1467. AnchorPoint = Vector2.new(0, 0.5)
  1468. }), "Theme")Make("Corner", IsSelected, UDim.new(0.5, 0))
  1469.  
  1470. local OptioneName = InsertTheme(Create("TextLabel", Button, {
  1471. Size = UDim2.new(1, 0, 1),
  1472. Position = UDim2.new(0, 10),
  1473. Text = Name,
  1474. TextColor3 = Theme["Color Text"],
  1475. Font = Enum.Font.GothamBold,
  1476. TextXAlignment = "Left",
  1477. BackgroundTransparency = 1,
  1478. TextTransparency = 0.4
  1479. }), "Text")
  1480.  
  1481. Button.Activated:Connect(function()
  1482. Select(Options[Name])
  1483. end)
  1484.  
  1485. Options[Name].nodes = {Button, IsSelected, OptioneName}
  1486. end
  1487.  
  1488. RemoveOption = function(index, Value)
  1489. local Name = tostring(type(index) == "string" and index or Value)
  1490. if Options[Name] then
  1491. if MultiSelect then Selected[Name] = nil else Selected = nil end
  1492. Options[Name].nodes[1]:Destroy()
  1493. table.clear(Options[Name])
  1494. Options[Name] = nil
  1495. end
  1496. end
  1497.  
  1498. GetOptions = function()
  1499. return Options
  1500. end
  1501.  
  1502. AddNewOptions = function(List, Clear)
  1503. if Clear then
  1504. table.foreach(Options, RemoveOption)
  1505. end
  1506. table.foreach(List, AddOption)
  1507. CallbackSelected()
  1508. UpdateSelected()
  1509. end
  1510.  
  1511. table.foreach(DOptions, AddOption)
  1512. CallbackSelected()
  1513. UpdateSelected()
  1514. end
  1515.  
  1516. Button.Activated:Connect(Minimize)
  1517. NoClickFrame.MouseButton1Down:Connect(Disable)
  1518. NoClickFrame.MouseButton1Click:Connect(Disable)
  1519. MainFrame:GetPropertyChangedSignal("Visible"):Connect(Disable)
  1520. SelectedFrame:GetPropertyChangedSignal("AbsolutePosition"):Connect(CalculatePos)
  1521.  
  1522. Button.Activated:Connect(CalculateSize)
  1523. ScrollFrame.ChildAdded:Connect(CalculateSize)
  1524. ScrollFrame.ChildRemoved:Connect(CalculateSize)
  1525. CalculatePos()
  1526. CalculateSize()
  1527.  
  1528. local Dropdown = {}
  1529. function Dropdown:Visible(...) Funcs:ToggleVisible(Button, ...) end
  1530. function Dropdown:Destroy() Button:Destroy() end
  1531. function Dropdown:Callback(...) Funcs:InsertCallback(Callback, ...)(Selected) end
  1532.  
  1533. function Dropdown:Add(...)
  1534. local NewOptions = {...}
  1535. if type(NewOptions[1]) == "table" then
  1536. table.foreach(Option, function(_,Name)
  1537. AddOption(Name)
  1538. end)
  1539. else
  1540. table.foreach(NewOptions, function(_,Name)
  1541. AddOption(Name)
  1542. end)
  1543. end
  1544. end
  1545. function Dropdown:Remove(Option)
  1546. for index, Value in pairs(GetOptions()) do
  1547. if type(Option) == "number" and index == Option or Value.Name == "Option" then
  1548. RemoveOption(index, Value.Value)
  1549. end
  1550. end
  1551. end
  1552. function Dropdown:Select(Option)
  1553. if type(Option) == "string" then
  1554. for _,Val in pairs(Options) do
  1555. if Val.Name == Option then
  1556. Val.Active()
  1557. end
  1558. end
  1559. elseif type(Option) == "number" then
  1560. for ind,Val in pairs(Options) do
  1561. if ind == Option then
  1562. Val.Active()
  1563. end
  1564. end
  1565. end
  1566. end
  1567. function Dropdown:Set(Val1, Clear)
  1568. if type(Val1) == "table" then
  1569. AddNewOptions(Val1, not Clear)
  1570. elseif type(Val1) == "function" then
  1571. Callback = Val1
  1572. end
  1573. end
  1574. return Dropdown
  1575. end
  1576. function Tab:AddSlider(Configs)
  1577. local SName = Configs[1] or Configs.Name or Configs.Title or "Slider!"
  1578. local SDesc = Configs.Desc or Configs.Description or ""
  1579. local Min = Configs[2] or Configs.MinValue or Configs.Min or 10
  1580. local Max = Configs[3] or Configs.MaxValue or Configs.Max or 100
  1581. local Increase = Configs[4] or Configs.Increase or 1
  1582. local Callback = Funcs:GetCallback(Configs, 6)
  1583. local Flag = Configs[7] or Configs.Flag or false
  1584. local Default = Configs[5] or Configs.Default or 25
  1585. if CheckFlag(Flag) then Default = GetFlag(Flag) end
  1586. Min, Max = Min / Increase, Max / Increase
  1587.  
  1588. local Button, LabelFunc = ButtonFrame(Container, SName, SDesc, UDim2.new(1, -180))
  1589.  
  1590. local SliderHolder = Create("TextButton", Button, {
  1591. Size = UDim2.new(0.45, 0, 1),
  1592. Position = UDim2.new(1),
  1593. AnchorPoint = Vector2.new(1, 0),
  1594. AutoButtonColor = false,
  1595. Text = "",
  1596. BackgroundTransparency = 1
  1597. })
  1598.  
  1599. local SliderBar = InsertTheme(Create("Frame", SliderHolder, {
  1600. BackgroundColor3 = Theme["Color Stroke"],
  1601. Size = UDim2.new(1, -20, 0, 6),
  1602. Position = UDim2.new(0.5, 0, 0.5),
  1603. AnchorPoint = Vector2.new(0.5, 0.5)
  1604. }), "Stroke")Make("Corner", SliderBar)
  1605.  
  1606. local Indicator = InsertTheme(Create("Frame", SliderBar, {
  1607. BackgroundColor3 = Theme["Color Theme"],
  1608. Size = UDim2.fromScale(0.3, 1),
  1609. BorderSizePixel = 0
  1610. }), "Theme")Make("Corner", Indicator)
  1611.  
  1612. local SliderIcon = Create("Frame", SliderBar, {
  1613. Size = UDim2.new(0, 6, 0, 12),
  1614. BackgroundColor3 = Color3.fromRGB(220, 220, 220),
  1615. Position = UDim2.fromScale(0.3, 0.5),
  1616. AnchorPoint = Vector2.new(0.5, 0.5),
  1617. BackgroundTransparency = 0.2
  1618. })Make("Corner", SliderIcon)
  1619.  
  1620. local LabelVal = InsertTheme(Create("TextLabel", SliderHolder, {
  1621. Size = UDim2.new(0, 14, 0, 14),
  1622. AnchorPoint = Vector2.new(1, 0.5),
  1623. Position = UDim2.new(0, 0, 0.5),
  1624. BackgroundTransparency = 1,
  1625. TextColor3 = Theme["Color Text"],
  1626. Font = Enum.Font.FredokaOne,
  1627. TextSize = 12
  1628. }), "Text")
  1629.  
  1630. local UIScale = Create("UIScale", LabelVal)
  1631.  
  1632. local BaseMousePos = Create("Frame", SliderBar, {
  1633. Position = UDim2.new(0, 0, 0.5, 0),
  1634. Visible = false
  1635. })
  1636.  
  1637. local function UpdateLabel(NewValue)
  1638. local Number = tonumber(NewValue * Increase)
  1639. Number = math.floor(Number * 100) / 100
  1640.  
  1641. Default, LabelVal.Text = Number, tostring(Number)
  1642. Funcs:FireCallback(Callback, Default)
  1643. end
  1644.  
  1645. local function ControlPos()
  1646. local MousePos = Player:GetMouse()
  1647. local APos = MousePos.X - BaseMousePos.AbsolutePosition.X
  1648. local ConfigureDpiPos = APos / SliderBar.AbsoluteSize.X
  1649.  
  1650. SliderIcon.Position = UDim2.new(math.clamp(ConfigureDpiPos, 0, 1), 0, 0.5, 0)
  1651. end
  1652.  
  1653. local function UpdateValues()
  1654. Indicator.Size = UDim2.new(SliderIcon.Position.X.Scale, 0, 1, 0)
  1655. local SliderPos = SliderIcon.Position.X.Scale
  1656. local NewValue = math.floor(((SliderPos * Max) / Max) * (Max - Min) + Min)
  1657. UpdateLabel(NewValue)
  1658. end
  1659.  
  1660. SliderHolder.MouseButton1Down:Connect(function()
  1661. CreateTween({SliderIcon, "Transparency", 0, 0.3})
  1662. Container.ScrollingEnabled = false
  1663. while UserInputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do task.wait()
  1664. ControlPos()
  1665. end
  1666. CreateTween({SliderIcon, "Transparency", 0.2, 0.3})
  1667. Container.ScrollingEnabled = true
  1668. SetFlag(Flag, Default)
  1669. end)
  1670.  
  1671. LabelVal:GetPropertyChangedSignal("Text"):Connect(function()
  1672. UIScale.Scale = 0.3
  1673. CreateTween({UIScale, "Scale", 1.2, 0.1})
  1674. CreateTween({LabelVal, "Rotation", math.random(-1, 1) * 5, 0.15, true})
  1675. CreateTween({UIScale, "Scale", 1, 0.2})
  1676. CreateTween({LabelVal, "Rotation", 0, 0.1})
  1677. end)
  1678.  
  1679. function SetSlider(NewValue)
  1680. if type(NewValue) ~= "number" then return end
  1681.  
  1682. local Min, Max = Min * Increase, Max * Increase
  1683.  
  1684. local SliderPos = (NewValue - Min) / (Max - Min)
  1685.  
  1686. SetFlag(Flag, NewValue)
  1687. CreateTween({ SliderIcon, "Position", UDim2.fromScale(math.clamp(SliderPos, 0, 1), 0.5), 0.3, true })
  1688. end;SetSlider(Default)
  1689.  
  1690. SliderIcon:GetPropertyChangedSignal("Position"):Connect(UpdateValues)UpdateValues()
  1691.  
  1692. local Slider = {}
  1693. function Slider:Set(NewVal1, NewVal2)
  1694. if NewVal1 and NewVal2 then
  1695. LabelFunc:SetTitle(NewVal1)
  1696. LabelFunc:SetDesc(NewVal2)
  1697. elseif type(NewVal1) == "string" then
  1698. LabelFunc:SetTitle(NewVal1)
  1699. elseif type(NewVal1) == "function" then
  1700. Callback = NewVal1
  1701. elseif type(NewVal1) == "number" then
  1702. SetSlider(NewVal1)
  1703. end
  1704. end
  1705. function Slider:Callback(...) Funcs:InsertCallback(Callback, ...)(tonumber(Default)) end
  1706. function Slider:Visible(...) Funcs:ToggleVisible(Button, ...) end
  1707. function Slider:Destroy() Button:Destroy() end
  1708. return Slider
  1709. end
  1710. function Tab:AddTextBox(Configs)
  1711. local TName = Configs[1] or Configs.Name or Configs.Title or "Text Box"
  1712. local TDesc = Configs.Desc or Configs.Description or ""
  1713. local TDefault = Configs[2] or Configs.Default or ""
  1714. local TPlaceholderText = Configs[5] or Configs.PlaceholderText or "Input"
  1715. local TClearText = Configs[3] or Configs.ClearText or false
  1716. local Callback = Funcs:GetCallback(Configs, 4)
  1717.  
  1718. if type(TDefault) ~= "string" or TDefault:gsub(" ", ""):len() < 1 then
  1719. TDefault = false
  1720. end
  1721.  
  1722. local Button, LabelFunc = ButtonFrame(Container, TName, TDesc, UDim2.new(1, -38))
  1723.  
  1724. local SelectedFrame = InsertTheme(Create("Frame", Button, {
  1725. Size = UDim2.new(0, 150, 0, 18),
  1726. Position = UDim2.new(1, -10, 0.5),
  1727. AnchorPoint = Vector2.new(1, 0.5),
  1728. BackgroundColor3 = Theme["Color Stroke"]
  1729. }), "Stroke")Make("Corner", SelectedFrame, UDim.new(0, 4))
  1730.  
  1731. local TextBoxInput = InsertTheme(Create("TextBox", SelectedFrame, {
  1732. Size = UDim2.new(0.85, 0, 0.85, 0),
  1733. AnchorPoint = Vector2.new(0.5, 0.5),
  1734. Position = UDim2.new(0.5, 0, 0.5, 0),
  1735. BackgroundTransparency = 1,
  1736. Font = Enum.Font.GothamBold,
  1737. TextScaled = true,
  1738. TextColor3 = Theme["Color Text"],
  1739. ClearTextOnFocus = TClearText,
  1740. PlaceholderText = TPlaceholderText,
  1741. Text = ""
  1742. }), "Text")
  1743.  
  1744. local Pencil = Create("ImageLabel", SelectedFrame, {
  1745. Size = UDim2.new(0, 12, 0, 12),
  1746. Position = UDim2.new(0, -5, 0.5),
  1747. AnchorPoint = Vector2.new(1, 0.5),
  1748. Image = "rbxassetid://15637081879",
  1749. BackgroundTransparency = 1
  1750. })
  1751.  
  1752. local TextBox = {}
  1753. local function Input()
  1754. local Text = TextBoxInput.Text
  1755. if Text:gsub(" ", ""):len() > 0 then
  1756. if TextBox.OnChanging then Text = TextBox.OnChanging(Text) or Text end
  1757. Funcs:FireCallback(Callback, Text)
  1758. TextBoxInput.Text = Text
  1759. end
  1760. end
  1761.  
  1762. TextBoxInput.FocusLost:Connect(Input)Input()
  1763.  
  1764. TextBoxInput.FocusLost:Connect(function()
  1765. CreateTween({Pencil, "ImageColor3", Color3.fromRGB(255, 255, 255), 0.2})
  1766. end)
  1767. TextBoxInput.Focused:Connect(function()
  1768. CreateTween({Pencil, "ImageColor3", Theme["Color Theme"], 0.2})
  1769. end)
  1770.  
  1771. TextBox.OnChanging = false
  1772. function TextBox:Visible(...) Funcs:ToggleVisible(Button, ...) end
  1773. function TextBox:Destroy() Button:Destroy() end
  1774. return TextBox
  1775. end
  1776. function Tab:AddDiscordInvite(Configs)
  1777. local Title = Configs[1] or Configs.Name or Configs.Title or "Discord"
  1778. local Desc = Configs.Desc or Configs.Description or ""
  1779. local Logo = Configs[2] or Configs.Logo or ""
  1780. local Invite = Configs[3] or Configs.Invite or ""
  1781.  
  1782. local InviteHolder = Create("Frame", Container, {
  1783. Size = UDim2.new(1, 0, 0, 80),
  1784. Name = "Option",
  1785. BackgroundTransparency = 1
  1786. })
  1787.  
  1788. local InviteLabel = Create("TextLabel", InviteHolder, {
  1789. Size = UDim2.new(1, 0, 0, 15),
  1790. Position = UDim2.new(0, 5),
  1791. TextColor3 = Color3.fromRGB(40, 150, 255),
  1792. Font = Enum.Font.GothamBold,
  1793. TextXAlignment = "Left",
  1794. BackgroundTransparency = 1,
  1795. TextSize = 10,
  1796. Text = Invite
  1797. })
  1798.  
  1799. local FrameHolder = InsertTheme(Create("Frame", InviteHolder, {
  1800. Size = UDim2.new(1, 0, 0, 65),
  1801. AnchorPoint = Vector2.new(0, 1),
  1802. Position = UDim2.new(0, 0, 1),
  1803. BackgroundColor3 = Theme["Color Hub 2"]
  1804. }), "Frame")Make("Corner", FrameHolder)
  1805.  
  1806. local ImageLabel = Create("ImageLabel", FrameHolder, {
  1807. Size = UDim2.new(0, 30, 0, 30),
  1808. Position = UDim2.new(0, 7, 0, 7),
  1809. Image = Logo,
  1810. BackgroundTransparency = 1
  1811. })Make("Corner", ImageLabel, UDim.new(0, 4))Make("Stroke", ImageLabel)
  1812.  
  1813. local LTitle = InsertTheme(Create("TextLabel", FrameHolder, {
  1814. Size = UDim2.new(1, -52, 0, 15),
  1815. Position = UDim2.new(0, 44, 0, 7),
  1816. Font = Enum.Font.GothamBold,
  1817. TextColor3 = Theme["Color Text"],
  1818. TextXAlignment = "Left",
  1819. BackgroundTransparency = 1,
  1820. TextSize = 10,
  1821. Text = Title
  1822. }), "Text")
  1823.  
  1824. local LDesc = InsertTheme(Create("TextLabel", FrameHolder, {
  1825. Size = UDim2.new(1, -52, 0, 0),
  1826. Position = UDim2.new(0, 44, 0, 22),
  1827. TextWrapped = "Y",
  1828. AutomaticSize = "Y",
  1829. Font = Enum.Font.Gotham,
  1830. TextColor3 = Theme["Color Dark Text"],
  1831. TextXAlignment = "Left",
  1832. BackgroundTransparency = 1,
  1833. TextSize = 8,
  1834. Text = Desc
  1835. }), "DarkText")
  1836.  
  1837. local JoinButton = Create("TextButton", FrameHolder, {
  1838. Size = UDim2.new(1, -14, 0, 16),
  1839. AnchorPoint = Vector2.new(0.5, 1),
  1840. Position = UDim2.new(0.5, 0, 1, -7),
  1841. Text = "Join",
  1842. Font = Enum.Font.GothamBold,
  1843. TextSize = 12,
  1844. TextColor3 = Color3.fromRGB(220, 220, 220),
  1845. BackgroundColor3 = Color3.fromRGB(50, 150, 50)
  1846. })Make("Corner", JoinButton, UDim.new(0, 5))
  1847.  
  1848. local ClickDelay
  1849. JoinButton.Activated:Connect(function()
  1850. setclipboard(Invite)
  1851. if ClickDelay then return end
  1852.  
  1853. ClickDelay = true
  1854. SetProps(JoinButton, {
  1855. Text = "Copied to Clipboard",
  1856. BackgroundColor3 = Color3.fromRGB(100, 100, 100),
  1857. TextColor3 = Color3.fromRGB(150, 150, 150)
  1858. })task.wait(5)
  1859. SetProps(JoinButton, {
  1860. Text = "Join",
  1861. BackgroundColor3 = Color3.fromRGB(50, 150, 50),
  1862. TextColor3 = Color3.fromRGB(220, 220, 220)
  1863. })ClickDelay = false
  1864. end)
  1865.  
  1866. local DiscordInvite = {}
  1867. function DiscordInvite:Destroy() InviteHolder:Destroy() end
  1868. function DiscordInvite:Visible(...) Funcs:ToggleVisible(InviteHolder, ...) end
  1869. return DiscordInvite
  1870. end
  1871. return Tab
  1872. end
  1873.  
  1874. CloseButton.Activated:Connect(Window.CloseBtn)
  1875. MinimizeButton.Activated:Connect(Window.MinimizeBtn)
  1876. return Window
  1877. end
  1878.  
  1879. return redzlib
  1880.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement