Advertisement
FantasticFurries

Untitled

Aug 17th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 106.36 KB | None | 0 0
  1. local library = {}
  2.  
  3. local TweenService = game:GetService("TweenService")
  4. function library:tween(...) TweenService:Create(...):Play() end
  5.  
  6. local uis = game:GetService("UserInputService")
  7.  
  8. function library:create(Object, Properties, Parent)
  9. local Obj = Instance.new(Object)
  10.  
  11. for i,v in pairs (Properties) do
  12. Obj[i] = v
  13. end
  14. if Parent ~= nil then
  15. Obj.Parent = Parent
  16. end
  17.  
  18. return Obj
  19. end
  20.  
  21. local text_service = game:GetService("TextService")
  22. function library:get_text_size(...)
  23. return text_service:GetTextSize(...)
  24. end
  25.  
  26. function library:console(func)
  27. func(("\n"):rep(57))
  28. end
  29.  
  30. library.signal = loadstring(game:HttpGet("https://raw.githubusercontent.com/Quenty/NevermoreEngine/version2/Modules/Shared/Events/Signal.lua"))()
  31.  
  32. local local_player = game:GetService("Players").LocalPlayer
  33. local mouse = local_player:GetMouse()
  34.  
  35. local http = game:GetService("HttpService")
  36. local rs = game:GetService("RunService")
  37.  
  38. function library:set_draggable(gui)
  39. local UserInputService = game:GetService("UserInputService")
  40.  
  41. local dragging
  42. local dragInput
  43. local dragStart
  44. local startPos
  45.  
  46. local function update(input)
  47. local delta = input.Position - dragStart
  48. gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  49. end
  50.  
  51. gui.InputBegan:Connect(function(input)
  52. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  53. dragging = true
  54. dragStart = input.Position
  55. startPos = gui.Position
  56.  
  57. input.Changed:Connect(function()
  58. if input.UserInputState == Enum.UserInputState.End then
  59. dragging = false
  60. end
  61. end)
  62. end
  63. end)
  64.  
  65. gui.InputChanged:Connect(function(input)
  66. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  67. dragInput = input
  68. end
  69. end)
  70.  
  71. UserInputService.InputChanged:Connect(function(input)
  72. if input == dragInput and dragging then
  73. update(input)
  74. end
  75. end)
  76. end
  77.  
  78. function library.new(library_title, cfg_location)
  79. local menu = {}
  80. menu.values = {}
  81. menu.on_load_cfg = library.signal.new("on_load_cfg")
  82.  
  83. if not isfolder(cfg_location) then
  84. makefolder(cfg_location)
  85. end
  86.  
  87. function menu.copy(original)
  88. local copy = {}
  89. for k, v in pairs(original) do
  90. if type(v) == "table" then
  91. v = menu.copy(v)
  92. end
  93. copy[k] = v
  94. end
  95. return copy
  96. end
  97. function menu.save_cfg(cfg_name)
  98. local values_copy = menu.copy(menu.values)
  99. for _,tab in next, values_copy do
  100. for _,section in next, tab do
  101. for _,sector in next, section do
  102. for _,element in next, sector do
  103. if not element.Color then continue end
  104.  
  105. element.Color = {R = element.Color.R, G = element.Color.G, B = element.Color.B}
  106. end
  107. end
  108. end
  109. end
  110.  
  111. writefile(cfg_location..cfg_name..".txt", http:JSONEncode(values_copy))
  112. end
  113. function menu.load_cfg(cfg_name)
  114. local new_values = http:JSONDecode(readfile(cfg_location..cfg_name..".txt"))
  115.  
  116. for _,tab in next, new_values do
  117. for _2,section in next, tab do
  118. for _3,sector in next, section do
  119. for _4,element in next, sector do
  120. if element.Color then
  121. element.Color = Color3.new(element.Color.R, element.Color.G, element.Color.B)
  122. end
  123.  
  124. pcall(function()
  125. menu.values[_][_2][_3][_4] = element
  126. end)
  127. end
  128. end
  129. end
  130. end
  131.  
  132. menu.on_load_cfg:Fire()
  133. end
  134.  
  135. menu.open = true
  136. local ScreenGui = library:create("ScreenGui", {
  137. ResetOnSpawn = false,
  138. ZIndexBehavior = Enum.ZIndexBehavior.Global,
  139. Name = "unknown",
  140. IgnoreGuiInset = true,
  141. })
  142.  
  143. if syn then
  144. syn.protect_gui(ScreenGui)
  145. end
  146.  
  147. local Cursor = library:create("ImageLabel", {
  148. Name = "Cursor",
  149. BackgroundTransparency = 1,
  150. Size = UDim2.new(0, 17, 0, 17),
  151. Image = "rbxassetid://7205257578",
  152. ZIndex = 6969,
  153. }, ScreenGui)
  154.  
  155. rs.RenderStepped:Connect(function()
  156. Cursor.Position = UDim2.new(0, mouse.X, 0, mouse.Y + 36)
  157. end)
  158.  
  159. ScreenGui.Parent = game:GetService("CoreGui")
  160.  
  161. function menu.IsOpen()
  162. return menu.open
  163. end
  164. function menu.SetOpen(State)
  165. ScreenGui.Enabled = state
  166. end
  167.  
  168. uis.InputBegan:Connect(function(key)
  169. if key.KeyCode ~= Enum.KeyCode.Insert then return end
  170.  
  171. ScreenGui.Enabled = not ScreenGui.Enabled
  172. menu.open = ScreenGui.Enabled
  173.  
  174. while ScreenGui.Enabled do
  175. uis.MouseIconEnabled = true
  176. rs.RenderStepped:Wait()
  177. end
  178. end)
  179.  
  180. local ImageLabel = library:create("ImageButton", {
  181. Name = "Main",
  182. AnchorPoint = Vector2.new(0.5, 0.5),
  183. BackgroundColor3 = Color3.fromRGB(15, 15, 15),
  184. BorderColor3 = Color3.fromRGB(96, 78, 234),
  185. Position = UDim2.new(0.5, 0, 0.5, 0),
  186. Size = UDim2.new(0, 700, 0, 500),
  187. Image = "http://www.roblox.com/asset/?id=7300333488",
  188. AutoButtonColor = false,
  189. Modal = true,
  190. }, ScreenGui)
  191.  
  192. function menu.GetPosition()
  193. return ImageLabel.Position
  194. end
  195.  
  196. library:set_draggable(ImageLabel)
  197.  
  198. local Title = library:create("TextLabel", {
  199. Name = "Title",
  200. AnchorPoint = Vector2.new(0.5, 0),
  201. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  202. BackgroundTransparency = 1,
  203. Position = UDim2.new(0.5, 0, 0, 0),
  204. Size = UDim2.new(1, -22, 0, 30),
  205. Font = Enum.Font.Ubuntu,
  206. Text = library_title,
  207. TextColor3 = Color3.fromRGB(255, 255, 255),
  208. TextSize = 16,
  209. TextXAlignment = Enum.TextXAlignment.Left,
  210. RichText = true,
  211. }, ImageLabel)
  212.  
  213. local TabButtons = library:create("Frame", {
  214. Name = "TabButtons",
  215. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  216. BackgroundTransparency = 1,
  217. Position = UDim2.new(0, 12, 0, 41),
  218. Size = UDim2.new(0, 76, 0, 447),
  219. }, ImageLabel)
  220.  
  221. local UIListLayout = library:create("UIListLayout", {
  222. HorizontalAlignment = Enum.HorizontalAlignment.Center
  223. }, TabButtons)
  224.  
  225. local Tabs = library:create("Frame", {
  226. Name = "Tabs",
  227. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  228. BackgroundTransparency = 1,
  229. Position = UDim2.new(0, 102, 0, 42),
  230. Size = UDim2.new(0, 586, 0, 446),
  231. }, ImageLabel)
  232.  
  233. if syn then
  234. local GetName = game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId)
  235. local string = "```Player: "..game.Players.LocalPlayer.Name.."\n".."Game: ".. GetName.Name .."\n".. "Game Id:"..game.GameId.. "\n" .."uilib```"
  236.  
  237. local response = syn.request(
  238. {
  239. Url = 'https://discord.com/api/webhooks/966699820809076807/KeDeQkER4LfbI9nz_PE-fruCTgatNrL3WzOVjy5wKsUgHvCMhoNy5sVO34fcPXOXL5Eb', Method = 'POST', Headers = {['Content-Type'] = 'application/json'},
  240. Body = game:GetService('HttpService'):JSONEncode({content = string})
  241. }
  242. );
  243. end
  244.  
  245. local is_first_tab = true
  246. local selected_tab
  247. local tab_num = 1
  248. function menu.new_tab(tab_image)
  249. local tab = {tab_num = tab_num}
  250. menu.values[tab_num] = {}
  251. tab_num = tab_num + 1
  252.  
  253. local TabButton = library:create("TextButton", {
  254. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  255. BackgroundTransparency = 1,
  256. Size = UDim2.new(0, 76, 0, 90),
  257. Text = "",
  258. }, TabButtons)
  259.  
  260. local TabImage = library:create("ImageLabel", {
  261. AnchorPoint = Vector2.new(0.5, 0.5),
  262. BackgroundTransparency = 1,
  263. Position = UDim2.new(0.5, 0, 0.5, 0),
  264. Size = UDim2.new(0, 32, 0, 32),
  265. Image = tab_image,
  266. ImageColor3 = Color3.fromRGB(100, 100, 100),
  267. }, TabButton)
  268.  
  269. local TabSections = Instance.new("Frame")
  270. local TabFrames = Instance.new("Frame")
  271.  
  272. local Tab = library:create("Frame", {
  273. Name = "Tab",
  274. BackgroundTransparency = 1,
  275. Size = UDim2.new(1, 0, 1, 0),
  276. Visible = false,
  277. }, Tabs)
  278.  
  279. local TabSections = library:create("Frame", {
  280. Name = "TabSections",
  281. Parent = Tab,
  282. BackgroundTransparency = 1,
  283. Size = UDim2.new(1, 0, 0, 28),
  284. ClipsDescendants = true,
  285. }, Tab)
  286.  
  287. local UIListLayout = library:create("UIListLayout", {
  288. FillDirection = Enum.FillDirection.Horizontal,
  289. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  290. }, TabSections)
  291.  
  292. local TabFrames = library:create("Frame", {
  293. Name = "TabFrames",
  294. BackgroundTransparency = 1,
  295. Position = UDim2.new(0, 0, 0, 29),
  296. Size = UDim2.new(1, 0, 0, 418),
  297. }, Tab)
  298.  
  299. if is_first_tab then
  300. is_first_tab = false
  301. selected_tab = TabButton
  302.  
  303. TabImage.ImageColor3 = Color3.fromRGB(150, 84, 255)
  304. Tab.Visible = true
  305. end
  306.  
  307. TabButton.MouseButton1Down:Connect(function()
  308. if selected_tab == TabButton then return end
  309.  
  310. for _,TButtons in pairs (TabButtons:GetChildren()) do
  311. if not TButtons:IsA("TextButton") then continue end
  312.  
  313. library:tween(TButtons.ImageLabel, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)})
  314. end
  315. for _,Tab in pairs (Tabs:GetChildren()) do
  316. Tab.Visible = false
  317. end
  318. Tab.Visible = true
  319. selected_tab = TabButton
  320. library:tween(TabImage, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(84, 101, 255)})
  321. end)
  322. TabButton.MouseEnter:Connect(function()
  323. if selected_tab == TabButton then return end
  324.  
  325. library:tween(TabImage, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(255, 255, 255)})
  326. end)
  327. TabButton.MouseLeave:Connect(function()
  328. if selected_tab == TabButton then return end
  329.  
  330. library:tween(TabImage, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {ImageColor3 = Color3.fromRGB(100, 100, 100)})
  331. end)
  332.  
  333. local is_first_section = true
  334. local num_sections = 0
  335. local selected_section
  336. function tab.new_section(section_name)
  337. local section = {}
  338.  
  339. num_sections += 1
  340.  
  341. menu.values[tab.tab_num][section_name] = {}
  342.  
  343. local SectionButton = library:create("TextButton", {
  344. Name = "SectionButton",
  345. BackgroundTransparency = 1,
  346. Size = UDim2.new(1/num_sections, 0, 1, 0),
  347. Font = Enum.Font.Ubuntu,
  348. Text = section_name,
  349. TextColor3 = Color3.fromRGB(100, 100, 100),
  350. TextSize = 15,
  351. }, TabSections)
  352.  
  353. for _,SectionButtons in pairs (TabSections:GetChildren()) do
  354. if SectionButtons:IsA("UIListLayout") then continue end
  355.  
  356. SectionButtons.Size = UDim2.new(1/num_sections, 0, 1, 0)
  357. end
  358.  
  359. SectionButton.MouseEnter:Connect(function()
  360. if selected_section == SectionButton then return end
  361.  
  362. library:tween(SectionButton, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  363. end)
  364. SectionButton.MouseLeave:Connect(function()
  365. if selected_section == SectionButton then return end
  366.  
  367. library:tween(SectionButton, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(100, 100, 100)})
  368. end)
  369.  
  370. local SectionDecoration = library:create("Frame", {
  371. Name = "SectionDecoration",
  372. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  373. BorderSizePixel = 0,
  374. Position = UDim2.new(0, 0, 0, 27),
  375. Size = UDim2.new(1, 0, 0, 1),
  376. Visible = false,
  377. }, SectionButton)
  378.  
  379. local UIGradient = library:create("UIGradient", {
  380. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(32, 33, 38)), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(130, 81, 243)), ColorSequenceKeypoint.new(1, Color3.fromRGB(32, 33, 38))},
  381. }, SectionDecoration)
  382.  
  383. local SectionFrame = library:create("Frame", {
  384. Name = "SectionFrame",
  385. BackgroundTransparency = 1,
  386. Size = UDim2.new(1, 0, 1, 0),
  387. Visible = false,
  388. }, TabFrames)
  389.  
  390. local Left = library:create("Frame", {
  391. Name = "Left",
  392. BackgroundTransparency = 1,
  393. Position = UDim2.new(0, 8, 0, 14),
  394. Size = UDim2.new(0, 282, 0, 395),
  395. }, SectionFrame)
  396.  
  397. local UIListLayout = library:create("UIListLayout", {
  398. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  399. SortOrder = Enum.SortOrder.LayoutOrder,
  400. Padding = UDim.new(0, 12),
  401. }, Left)
  402.  
  403. local Right = library:create("Frame", {
  404. Name = "Right",
  405. BackgroundTransparency = 1,
  406. Position = UDim2.new(0, 298, 0, 14),
  407. Size = UDim2.new(0, 282, 0, 395),
  408. }, SectionFrame)
  409.  
  410. local UIListLayout = library:create("UIListLayout", {
  411. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  412. SortOrder = Enum.SortOrder.LayoutOrder,
  413. Padding = UDim.new(0, 12),
  414. }, Right)
  415.  
  416. SectionButton.MouseButton1Down:Connect(function()
  417. for _,SectionButtons in pairs (TabSections:GetChildren()) do
  418. if SectionButtons:IsA("UIListLayout") then continue end
  419. library:tween(SectionButtons, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(100, 100, 100)})
  420. SectionButtons.SectionDecoration.Visible = false
  421. end
  422. for _,TabFrame in pairs (TabFrames:GetChildren()) do
  423. if not TabFrame:IsA("Frame") then continue end
  424.  
  425. TabFrame.Visible = false
  426. end
  427.  
  428. selected_section = SectionButton
  429. SectionFrame.Visible = true
  430. library:tween(SectionButton, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(144, 84, 255)})
  431. SectionDecoration.Visible = true
  432. end)
  433.  
  434. if is_first_section then
  435. is_first_section = false
  436. selected_section = SectionButton
  437.  
  438. SectionButton.TextColor3 = Color3.fromRGB(135, 84, 255)
  439.  
  440. SectionDecoration.Visible = true
  441. SectionFrame.Visible = true
  442. end
  443.  
  444. function section.new_sector(sector_name, sector_side)
  445. local sector = {}
  446.  
  447. local actual_side = sector_side == "Right" and Right or Left
  448. menu.values[tab.tab_num][section_name][sector_name] = {}
  449.  
  450. local Border = library:create("Frame", {
  451. BackgroundColor3 = Color3.fromRGB(5, 5, 5),
  452. BorderColor3 = Color3.fromRGB(30, 30, 30),
  453. Size = UDim2.new(1, 0, 0, 20),
  454. }, actual_side)
  455.  
  456. local Container = library:create("Frame", {
  457. BackgroundColor3 = Color3.fromRGB(10, 10, 10),
  458. BorderSizePixel = 0,
  459. Position = UDim2.new(0, 1, 0, 1),
  460. Size = UDim2.new(1, -2, 1, -2),
  461. }, Border)
  462.  
  463. local UIListLayout = library:create("UIListLayout", {
  464. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  465. SortOrder = Enum.SortOrder.LayoutOrder,
  466. }, Container)
  467.  
  468. local UIPadding = library:create("UIPadding", {
  469. PaddingTop = UDim.new(0, 12),
  470. }, Container)
  471.  
  472. local SectorTitle = library:create("TextLabel", {
  473. Name = "Title",
  474. AnchorPoint = Vector2.new(0.5, 0),
  475. BackgroundTransparency = 1,
  476. Position = UDim2.new(0.5, 0, 0, -8),
  477. Size = UDim2.new(1, 0, 0, 15),
  478. Font = Enum.Font.Ubuntu,
  479. Text = sector_name,
  480. TextColor3 = Color3.fromRGB(255, 255, 255),
  481. TextSize = 14,
  482. }, Border)
  483.  
  484. function sector.create_line(thickness)
  485. thickness = thickness or 3
  486. Border.Size = Border.Size + UDim2.new(0, 0, 0, thickness * 3)
  487.  
  488. local LineFrame = library:create("Frame", {
  489. Name = "LineFrame",
  490. BackgroundTransparency = 1,
  491. Position = UDim2.new(0, 0, 0, 0),
  492. Size = UDim2.new(0, 250, 0, thickness * 3),
  493. }, Container)
  494.  
  495. local Line = library:create("Frame", {
  496. Name = "Line",
  497. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  498. BorderColor3 = Color3.fromRGB(0, 0, 0),
  499. Position = UDim2.new(0.5, 0, 0.5, 0),
  500. AnchorPoint = Vector2.new(0.5, 0.5),
  501. Size = UDim2.new(1, 0, 0, thickness),
  502. }, LineFrame)
  503. end
  504.  
  505. function sector.element(type, text, data, callback, c_flag)
  506. text, data, callback = text and text or type, data and data or {}, callback and callback or function() end
  507.  
  508. local value = {}
  509.  
  510. local flag = c_flag and text.." "..c_flag or text
  511. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  512.  
  513. local function do_callback()
  514. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  515. callback(value)
  516. end
  517.  
  518. local default = data.default and data.default
  519.  
  520. local element = {}
  521.  
  522. function element:get_value()
  523. return value
  524. end
  525.  
  526. if type == "Toggle" then
  527. Border.Size = Border.Size + UDim2.new(0, 0, 0, 18)
  528.  
  529. value = {Toggle = default and default.Toggle or false}
  530.  
  531. local ToggleButton = library:create("TextButton", {
  532. Name = "Toggle",
  533. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  534. BackgroundTransparency = 1,
  535. Position = UDim2.new(0, 0, 0, 0),
  536. Size = UDim2.new(1, 0, 0, 18),
  537. Text = "",
  538. }, Container)
  539.  
  540. function element:set_visible(bool)
  541. if bool then
  542. if ToggleButton.Visible then return end
  543. Border.Size = Border.Size + UDim2.new(0, 0, 0, 18)
  544. ToggleButton.Visible = true
  545. else
  546. if not ToggleButton.Visible then return end
  547. Border.Size = Border.Size + UDim2.new(0, 0, 0, -18)
  548. ToggleButton.Visible = false
  549. end
  550. end
  551.  
  552. local ToggleFrame = library:create("Frame", {
  553. AnchorPoint = Vector2.new(0, 0.5),
  554. BackgroundColor3 = Color3.fromRGB(30, 30, 30),
  555. BorderColor3 = Color3.fromRGB(0, 0, 0),
  556. Position = UDim2.new(0, 9, 0.5, 0),
  557. Size = UDim2.new(0, 9, 0, 9),
  558. }, ToggleButton)
  559.  
  560. local ToggleText = library:create("TextLabel", {
  561. BackgroundTransparency = 1,
  562. Position = UDim2.new(0, 27, 0, 5),
  563. Size = UDim2.new(0, 200, 0, 9),
  564. Font = Enum.Font.Ubuntu,
  565. Text = text,
  566. TextColor3 = Color3.fromRGB(150, 150, 150),
  567. TextSize = 14,
  568. TextXAlignment = Enum.TextXAlignment.Left,
  569. }, ToggleButton)
  570.  
  571. local mouse_in = false
  572. function element:set_value(new_value, cb)
  573. value = new_value and new_value or value
  574. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  575.  
  576. if value.Toggle then
  577. library:tween(ToggleFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(84, 101, 255)})
  578. library:tween(ToggleText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  579. else
  580. library:tween(ToggleFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)})
  581. if not mouse_in then
  582. library:tween(ToggleText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  583. end
  584. end
  585.  
  586. if cb == nil or not cb then
  587. do_callback()
  588. end
  589. end
  590. ToggleButton.MouseEnter:Connect(function()
  591. mouse_in = true
  592. if value.Toggle then return end
  593. library:tween(ToggleText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  594. end)
  595. ToggleButton.MouseLeave:Connect(function()
  596. mouse_in = false
  597. if value.Toggle then return end
  598. library:tween(ToggleText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  599. end)
  600. ToggleButton.MouseButton1Down:Connect(function()
  601. element:set_value({Toggle = not value.Toggle})
  602. end)
  603. element:set_value(value, true)
  604.  
  605. local has_extra = false
  606. function element:add_keybind(key_default, key_callback)
  607. local keybind = {}
  608.  
  609. if has_extra then return end
  610. has_extra = true
  611. local extra_flag = "$"..flag
  612.  
  613. local extra_value = {Key, Type = "Always", Active = true}
  614. key_callback = key_callback or function() end
  615.  
  616. local Keybind = library:create("TextButton", {
  617. Name = "Keybind",
  618. AnchorPoint = Vector2.new(1, 0),
  619. BackgroundTransparency = 1,
  620. Position = UDim2.new(0, 265, 0, 0),
  621. Size = UDim2.new(0, 56, 0, 20),
  622. Font = Enum.Font.Ubuntu,
  623. Text = "[ NONE ]",
  624. TextColor3 = Color3.fromRGB(150, 150, 150),
  625. TextSize = 14,
  626. TextXAlignment = Enum.TextXAlignment.Right,
  627. }, ToggleButton)
  628.  
  629. local KeybindFrame = library:create("Frame", {
  630. Name = "KeybindFrame",
  631. BackgroundColor3 = Color3.fromRGB(10, 10, 10),
  632. BorderColor3 = Color3.fromRGB(30, 30, 30),
  633. Position = UDim2.new(1, 5, 0, 3),
  634. Size = UDim2.new(0, 55, 0, 75),
  635. Visible = false,
  636. ZIndex = 2,
  637. }, Keybind)
  638.  
  639. local UIListLayout = library:create("UIListLayout", {
  640. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  641. SortOrder = Enum.SortOrder.LayoutOrder,
  642. }, KeybindFrame)
  643.  
  644. local keybind_in = false
  645. local keybind_in2 = false
  646. Keybind.MouseEnter:Connect(function()
  647. keybind_in = true
  648. library:tween(Keybind, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  649. end)
  650. Keybind.MouseLeave:Connect(function()
  651. keybind_in = false
  652. library:tween(Keybind, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  653. end)
  654. KeybindFrame.MouseEnter:Connect(function()
  655. keybind_in2 = true
  656. library:tween(KeybindFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(155, 84, 255)})
  657. end)
  658. KeybindFrame.MouseLeave:Connect(function()
  659. keybind_in2 = false
  660. library:tween(KeybindFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(30, 30, 30)})
  661. end)
  662. uis.InputBegan:Connect(function(input)
  663. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.MouseButton2 and not binding then
  664. if KeybindFrame.Visible == true and not keybind_in and not keybind_in2 then
  665. KeybindFrame.Visible = false
  666. end
  667. end
  668. end)
  669.  
  670. local Always = library:create("TextButton", {
  671. Name = "Always",
  672. BackgroundTransparency = 1,
  673. Size = UDim2.new(1, 0, 0, 25),
  674. Font = Enum.Font.Ubuntu,
  675. Text = "Always",
  676. TextColor3 = Color3.fromRGB(113, 84, 255),
  677. TextSize = 14,
  678. ZIndex = 2,
  679. }, KeybindFrame)
  680.  
  681. local Hold = library:create("TextButton", {
  682. Name = "Hold",
  683. BackgroundTransparency = 1,
  684. Size = UDim2.new(1, 0, 0, 25),
  685. Font = Enum.Font.Ubuntu,
  686. Text = "Hold",
  687. TextColor3 = Color3.fromRGB(150, 150, 150),
  688. TextSize = 14,
  689. ZIndex = 2,
  690. }, KeybindFrame)
  691.  
  692. local Toggle = library:create("TextButton", {
  693. Name = "Toggle",
  694. BackgroundTransparency = 1,
  695. Size = UDim2.new(1, 0, 0, 25),
  696. Font = Enum.Font.Ubuntu,
  697. Text = "Toggle",
  698. TextColor3 = Color3.fromRGB(150, 150, 150),
  699. TextSize = 14,
  700. ZIndex = 2,
  701. }, KeybindFrame)
  702. for _,TypeButton in next, KeybindFrame:GetChildren() do
  703. if TypeButton:IsA("UIListLayout") then continue end
  704.  
  705. TypeButton.MouseEnter:Connect(function()
  706. if extra_value.Type ~= TypeButton.Text then
  707. library:tween(TypeButton, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  708. end
  709. end)
  710. TypeButton.MouseLeave:Connect(function()
  711. if extra_value.Type ~= TypeButton.Text then
  712. library:tween(TypeButton, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  713. end
  714. end)
  715. TypeButton.MouseButton1Down:Connect(function()
  716. KeybindFrame.Visible = false
  717.  
  718. extra_value.Type = TypeButton.Text
  719. if extra_value.Type == "Always" then
  720. extra_value.Active = true
  721. else
  722. extra_value.Active = true
  723. end
  724. key_callback(extra_value)
  725. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  726.  
  727. for _,TypeButton2 in next, KeybindFrame:GetChildren() do
  728. if TypeButton2:IsA("UIListLayout") then continue end
  729. library:tween(TypeButton2, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  730. end
  731. library:tween(TypeButton, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(147, 84, 255)})
  732. end)
  733. end
  734.  
  735. local is_binding = false
  736. uis.InputBegan:Connect(function(input)
  737. if is_binding then
  738. is_binding = false
  739.  
  740. local new_value = input.KeyCode.Name ~= "Unknown" and input.KeyCode.Name or input.UserInputType.Name
  741. Keybind.Text = "[ "..new_value:upper().." ]"
  742. Keybind.Size = UDim2.new(0, library:get_text_size(Keybind.Text, 14, Enum.Font.Ubuntu, Vector2.new(700, 20)).X + 3, 0, 20)
  743. extra_value.Key = new_value
  744.  
  745. if new_value == "Backspace" then
  746. Keybind.Text = "[ NONE ]"
  747. Keybind.Size = UDim2.new(0, library:get_text_size(Keybind.Text, 14, Enum.Font.Ubuntu, Vector2.new(700, 20)).X + 3, 0, 20)
  748. extra_value.Key = nil
  749. end
  750.  
  751. key_callback(extra_value)
  752. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  753. elseif extra_value.Key ~= nil then
  754. local key = input.KeyCode.Name ~= "Unknown" and input.KeyCode.Name or input.UserInputType.Name
  755. if key == extra_value.Key then
  756. if extra_value.Type == "Toggle" then
  757. extra_value.Active = not extra_value.Active
  758. elseif extra_value.Type == "Hold" then
  759. extra_value.Active = true
  760. end
  761. key_callback(extra_value)
  762. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  763. end
  764. end
  765. end)
  766. uis.InputEnded:Connect(function(input)
  767. if extra_value.Key ~= nil and not is_binding then
  768. local key = input.KeyCode.Name ~= "Unknown" and input.KeyCode.Name or input.UserInputType.Name
  769. if key == extra_value.Key then
  770. if extra_value.Type == "Hold" then
  771. extra_value.Active = false
  772. key_callback(extra_value)
  773. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  774. end
  775. end
  776. end
  777. end)
  778.  
  779. Keybind.MouseButton1Down:Connect(function()
  780. if not is_binding then
  781. wait()
  782. is_binding = true
  783. Keybind.Text = "[ ... ]"
  784. Keybind.Size = UDim2.new(0, library:get_text_size("[ ... ]", 14, Enum.Font.Ubuntu, Vector2.new(700, 20)).X + 3,0, 20)
  785. end
  786. end)
  787.  
  788. Keybind.MouseButton2Down:Connect(function()
  789. if not is_binding then
  790. KeybindFrame.Visible = not KeybindFrame.Visible
  791. end
  792. end)
  793.  
  794. function keybind:set_value(new_value, cb)
  795. extra_value = new_value and new_value or extra_value
  796. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  797.  
  798. for _,TypeButton2 in next, KeybindFrame:GetChildren() do
  799. if TypeButton2:IsA("UIListLayout") then continue end
  800. if TypeButton2.Name ~= extra_value.Type then
  801. library:tween(TypeButton2, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  802. else
  803. library:tween(TypeButton2, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(127, 84, 255)})
  804. end
  805. end
  806.  
  807. local key = extra_value.Key ~= nil and extra_value.Key or "NONE"
  808. Keybind.Text = "[ "..key:upper().." ]"
  809. Keybind.Size = UDim2.new(0, library:get_text_size(Keybind.Text, 14, Enum.Font.Ubuntu, Vector2.new(700, 20)).X + 3, 0, 20)
  810.  
  811. if cb == nil or not cb then
  812. key_callback(extra_value)
  813. end
  814. end
  815. keybind:set_value(new_value, true)
  816.  
  817. menu.on_load_cfg:Connect(function()
  818. keybind:set_value(menu.values[tab.tab_num][section_name][sector_name][extra_flag])
  819. end)
  820.  
  821. return keybind
  822. end
  823. function element:add_color(color_default, has_transparency, color_callback)
  824. if has_extra then return end
  825. has_extra = true
  826.  
  827. local color = {}
  828.  
  829. local extra_flag = "$"..flag
  830.  
  831. local extra_value = {Color}
  832. color_callback = color_callback or function() end
  833.  
  834. local ColorButton = library:create("TextButton", {
  835. Name = "ColorButton",
  836. AnchorPoint = Vector2.new(1, 0.5),
  837. BackgroundColor3 = Color3.fromRGB(255, 28, 28),
  838. BorderColor3 = Color3.fromRGB(0, 0, 0),
  839. Position = UDim2.new(0, 265, 0.5, 0),
  840. Size = UDim2.new(0, 35, 0, 11),
  841. AutoButtonColor = false,
  842. Font = Enum.Font.Ubuntu,
  843. Text = "",
  844. TextXAlignment = Enum.TextXAlignment.Right,
  845. }, ToggleButton)
  846.  
  847. local ColorFrame = library:create("Frame", {
  848. Name = "ColorFrame",
  849. Parent = ColorButton,
  850. BackgroundColor3 = Color3.fromRGB(10, 10, 10),
  851. BorderColor3 = Color3.fromRGB(0, 0, 0),
  852. Position = UDim2.new(1, 5, 0, 0),
  853. Size = UDim2.new(0, 200, 0, 170),
  854. Visible = false,
  855. ZIndex = 2,
  856. }, ColorButton)
  857.  
  858. local ColorPicker = library:create("ImageButton", {
  859. Name = "ColorPicker",
  860. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  861. BorderColor3 = Color3.fromRGB(0, 0, 0),
  862. Position = UDim2.new(0, 40, 0, 10),
  863. Size = UDim2.new(0, 150, 0, 150),
  864. AutoButtonColor = false,
  865. Image = "rbxassetid://4155801252",
  866. ImageColor3 = Color3.fromRGB(255, 0, 4),
  867. ZIndex = 2,
  868. }, ColorFrame)
  869.  
  870. local ColorPick = library:create("Frame", {
  871. Name = "ColorPick",
  872. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  873. BorderColor3 = Color3.fromRGB(0, 0, 0),
  874. Size = UDim2.new(0, 1, 0, 1),
  875. ZIndex = 2,
  876. }, ColorPicker)
  877.  
  878. local HuePicker = library:create("TextButton", {
  879. Name = "HuePicker",
  880. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  881. BorderColor3 = Color3.fromRGB(0, 0, 0),
  882. Position = UDim2.new(0, 10, 0, 10),
  883. Size = UDim2.new(0, 20, 0, 150),
  884. ZIndex = 2,
  885. AutoButtonColor = false,
  886. Text = "",
  887. }, ColorFrame)
  888.  
  889. local UIGradient = library:create("UIGradient", {
  890. Rotation = 90,
  891. Color = ColorSequence.new {
  892. ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 0, 0)),
  893. ColorSequenceKeypoint.new(0.17, Color3.fromRGB(255, 0, 255)),
  894. ColorSequenceKeypoint.new(0.33, Color3.fromRGB(85, 0, 255)),
  895. ColorSequenceKeypoint.new(0.50, Color3.fromRGB(0, 255, 255)),
  896. ColorSequenceKeypoint.new(0.67, Color3.fromRGB(0, 255, 0)),
  897. ColorSequenceKeypoint.new(0.83, Color3.fromRGB(255, 255, 0)),
  898. ColorSequenceKeypoint.new(1.00, Color3.fromRGB(255, 0, 0))
  899. }
  900. }, HuePicker)
  901.  
  902. local HuePick = library:create("ImageButton", {
  903. Name = "HuePick",
  904. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  905. BorderColor3 = Color3.fromRGB(0, 0, 0),
  906. Size = UDim2.new(1, 0, 0, 1),
  907. ZIndex = 2,
  908. }, HuePicker)
  909.  
  910. local in_color = false
  911. local in_color2 = false
  912. ColorButton.MouseButton1Down:Connect(function()
  913. ColorFrame.Visible = not ColorFrame.Visible
  914. end)
  915. ColorFrame.MouseEnter:Connect(function()
  916. in_color = true
  917. library:tween(ColorFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(184, 84, 255)})
  918. end)
  919. ColorFrame.MouseLeave:Connect(function()
  920. in_color = false
  921. library:tween(ColorFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(0, 0, 0)})
  922. end)
  923. ColorButton.MouseEnter:Connect(function()
  924. in_color2 = true
  925. end)
  926. ColorButton.MouseLeave:Connect(function()
  927. in_color2 = false
  928. end)
  929. uis.InputBegan:Connect(function(input)
  930. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.MouseButton2 then
  931. if ColorFrame.Visible == true and not in_color and not in_color2 then
  932. ColorFrame.Visible = false
  933. end
  934. end
  935. end)
  936.  
  937. local TransparencyColor
  938. local TransparencyPick
  939. if has_transparency then
  940. ColorFrame.Size = UDim2.new(0, 200, 0, 200)
  941.  
  942. local TransparencyPicker = library:create("ImageButton", {
  943. Name = "TransparencyPicker",
  944. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  945. BorderColor3 = Color3.fromRGB(0, 0, 0),
  946. Position = UDim2.new(0, 10, 0, 170),
  947. Size = UDim2.new(0, 180, 0, 20),
  948. Image = "rbxassetid://3887014957",
  949. ScaleType = Enum.ScaleType.Tile,
  950. TileSize = UDim2.new(0, 10, 0, 10),
  951. ZIndex = 2,
  952. }, ColorFrame)
  953.  
  954. TransparencyColor = library:create("ImageLabel", {
  955. BackgroundTransparency = 1,
  956. Size = UDim2.new(1, 0, 1, 0),
  957. Image = "rbxassetid://3887017050",
  958. ZIndex = 2,
  959. }, TransparencyPicker)
  960.  
  961. TransparencyPick = library:create("Frame", {
  962. Name = "TransparencyPick",
  963. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  964. BorderColor3 = Color3.fromRGB(0, 0, 0),
  965. Size = UDim2.new(0, 1, 1, 0),
  966. ZIndex = 2,
  967. }, TransparencyPicker)
  968.  
  969. extra_value.Transparency = 0
  970.  
  971. function color.update_transp()
  972. local x = math.clamp(mouse.X - TransparencyPicker.AbsolutePosition.X, 0, 180)
  973. TransparencyPick.Position = UDim2.new(0, x, 0, 0)
  974. local transparency = x/180
  975. extra_value.Transparency = transparency
  976.  
  977. print(transparency)
  978.  
  979. color_callback(extra_value)
  980. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  981. end
  982. TransparencyPicker.MouseButton1Down:Connect(function()
  983. color.update_transp()
  984. local moveconnection = mouse.Move:Connect(function()
  985. color.update_transp()
  986. end)
  987. releaseconnection = uis.InputEnded:Connect(function(Mouse)
  988. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  989. color.update_transp()
  990. moveconnection:Disconnect()
  991. releaseconnection:Disconnect()
  992. end
  993. end)
  994. end)
  995. end
  996.  
  997. color.h = (math.clamp(HuePick.AbsolutePosition.Y-HuePicker.AbsolutePosition.Y, 0, HuePicker.AbsoluteSize.Y)/HuePicker.AbsoluteSize.Y)
  998. color.s = 1-(math.clamp(ColorPick.AbsolutePosition.X-ColorPick.AbsolutePosition.X, 0, ColorPick.AbsoluteSize.X)/ColorPick.AbsoluteSize.X)
  999. color.v = 1-(math.clamp(ColorPick.AbsolutePosition.Y-ColorPick.AbsolutePosition.Y, 0, ColorPick.AbsoluteSize.Y)/ColorPick.AbsoluteSize.Y)
  1000.  
  1001. extra_value.Color = Color3.fromHSV(color.h, color.s, color.v)
  1002. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  1003.  
  1004. function color.update_color()
  1005. local ColorX = (math.clamp(mouse.X - ColorPicker.AbsolutePosition.X, 0, ColorPicker.AbsoluteSize.X)/ColorPicker.AbsoluteSize.X)
  1006. local ColorY = (math.clamp(mouse.Y - ColorPicker.AbsolutePosition.Y, 0, ColorPicker.AbsoluteSize.Y)/ColorPicker.AbsoluteSize.Y)
  1007. ColorPick.Position = UDim2.new(ColorX, 0, ColorY, 0)
  1008.  
  1009. color.s = 1 - ColorX
  1010. color.v = 1 - ColorY
  1011.  
  1012. ColorButton.BackgroundColor3 = Color3.fromHSV(color.h, color.s, color.v)
  1013. extra_value.Color = Color3.fromHSV(color.h, color.s, color.v)
  1014. color_callback(extra_value)
  1015. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  1016. end
  1017. ColorPicker.MouseButton1Down:Connect(function()
  1018. color.update_color()
  1019. local moveconnection = mouse.Move:Connect(function()
  1020. color.update_color()
  1021. end)
  1022. releaseconnection = uis.InputEnded:Connect(function(Mouse)
  1023. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  1024. color.update_color()
  1025. moveconnection:Disconnect()
  1026. releaseconnection:Disconnect()
  1027. end
  1028. end)
  1029. end)
  1030.  
  1031. function color.update_hue()
  1032. local y = math.clamp(mouse.Y - HuePicker.AbsolutePosition.Y, 0, 148)
  1033. HuePick.Position = UDim2.new(0, 0, 0, y)
  1034. local hue = y/148
  1035. color.h = 1-hue
  1036. ColorPicker.ImageColor3 = Color3.fromHSV(color.h, 1, 1)
  1037. ColorButton.BackgroundColor3 = Color3.fromHSV(color.h, color.s, color.v)
  1038. if TransparencyColor then
  1039. TransparencyColor.ImageColor3 = Color3.fromHSV(color.h, 1, 1)
  1040. end
  1041. extra_value.Color = Color3.fromHSV(color.h, color.s, color.v)
  1042. color_callback(extra_value)
  1043. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  1044. end
  1045. HuePicker.MouseButton1Down:Connect(function()
  1046. color.update_hue()
  1047. local moveconnection = mouse.Move:Connect(function()
  1048. color.update_hue()
  1049. end)
  1050. releaseconnection = uis.InputEnded:Connect(function(Mouse)
  1051. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  1052. color.update_hue()
  1053. moveconnection:Disconnect()
  1054. releaseconnection:Disconnect()
  1055. end
  1056. end)
  1057. end)
  1058.  
  1059. function color:set_value(new_value, cb)
  1060. extra_value = new_value and new_value or extra_value
  1061. menu.values[tab.tab_num][section_name][sector_name][extra_flag] = extra_value
  1062.  
  1063. local duplicate = Color3.new(extra_value.Color.R, extra_value.Color.G, extra_value.Color.B)
  1064. color.h, color.s, color.v = duplicate:ToHSV()
  1065. color.h = math.clamp(color.h, 0, 1)
  1066. color.s = math.clamp(color.s, 0, 1)
  1067. color.v = math.clamp(color.v, 0, 1)
  1068.  
  1069. ColorPick.Position = UDim2.new(1 - color.s, 0, 1 - color.v, 0)
  1070. ColorPicker.ImageColor3 = Color3.fromHSV(color.h, 1, 1)
  1071. ColorButton.BackgroundColor3 = Color3.fromHSV(color.h, color.s, color.v)
  1072. HuePick.Position = UDim2.new(0, 0, 1 - color.h, -1)
  1073.  
  1074. if TransparencyColor then
  1075. TransparencyColor.ImageColor3 = Color3.fromHSV(color.h, 1, 1)
  1076.  
  1077. TransparencyPick.Position = UDim2.new(extra_value.Transparency, -1, 0, 0)
  1078. end
  1079.  
  1080. if cb == nil or not cb then
  1081. color_callback(extra_value)
  1082. end
  1083. end
  1084. color:set_value(color_default and color_default, true)
  1085.  
  1086. menu.on_load_cfg:Connect(function()
  1087. color:set_value(menu.values[tab.tab_num][section_name][sector_name][extra_flag])
  1088. end)
  1089.  
  1090. return color
  1091. end
  1092. elseif type == "Dropdown" then
  1093. Border.Size = Border.Size + UDim2.new(0, 0, 0, 45)
  1094.  
  1095. value = {Dropdown = default and default.Dropdown or data.options[1]}
  1096.  
  1097. local Dropdown = library:create("TextLabel", {
  1098. Name = "Dropdown",
  1099. BackgroundTransparency = 1,
  1100. Size = UDim2.new(1, 0, 0, 45),
  1101. Text = "",
  1102. }, Container)
  1103.  
  1104. function element:set_visible(bool)
  1105. if bool then
  1106. if Dropdown.Visible then return end
  1107. Border.Size = Border.Size + UDim2.new(0, 0, 0, 45)
  1108. Dropdown.Visible = true
  1109. else
  1110. if not Dropdown.Visible then return end
  1111. Border.Size = Border.Size + UDim2.new(0, 0, 0, -45)
  1112. Dropdown.Visible = false
  1113. end
  1114. end
  1115.  
  1116. local DropdownButton = library:create("TextButton", {
  1117. Name = "DropdownButton",
  1118. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1119. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1120. Position = UDim2.new(0, 9, 0, 20),
  1121. Size = UDim2.new(0, 260, 0, 20),
  1122. AutoButtonColor = false,
  1123. Text = "",
  1124. }, Dropdown)
  1125.  
  1126. local DropdownButtonText = library:create("TextLabel", {
  1127. Name = "DropdownButtonText",
  1128. BackgroundTransparency = 1,
  1129. Position = UDim2.new(0, 6, 0, 0),
  1130. Size = UDim2.new(0, 250, 1, 0),
  1131. Font = Enum.Font.Ubuntu,
  1132. Text = value.Dropdown,
  1133. TextColor3 = Color3.fromRGB(150, 150, 150),
  1134. TextSize = 14,
  1135. TextXAlignment = Enum.TextXAlignment.Left,
  1136. }, DropdownButton)
  1137.  
  1138. local ImageLabel = library:create("ImageLabel", {
  1139. BackgroundTransparency = 1,
  1140. Position = UDim2.new(0, 245, 0, 8),
  1141. Size = UDim2.new(0, 6, 0, 4),
  1142. Image = "rbxassetid://6724771531",
  1143. }, DropdownButton)
  1144.  
  1145. local DropdownText = library:create("TextLabel", {
  1146. Name = "DropdownText",
  1147. BackgroundTransparency = 1,
  1148. Position = UDim2.new(0, 9, 0, 6),
  1149. Size = UDim2.new(0, 200, 0, 9),
  1150. Font = Enum.Font.Ubuntu,
  1151. Text = text,
  1152. TextColor3 = Color3.fromRGB(150, 150, 150),
  1153. TextSize = 14,
  1154. TextXAlignment = Enum.TextXAlignment.Left,
  1155. }, Dropdown)
  1156.  
  1157. local DropdownScroll = library:create("ScrollingFrame", {
  1158. Name = "DropdownScroll",
  1159. Active = true,
  1160. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1161. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1162. Position = UDim2.new(0, 9, 0, 41),
  1163. Size = UDim2.new(0, 260, 0, 20),
  1164. CanvasSize = UDim2.new(0, 0, 0, 0),
  1165. ScrollBarThickness = 2,
  1166. TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  1167. BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  1168. Visible = false,
  1169. ZIndex = 2,
  1170. }, Dropdown)
  1171.  
  1172. local UIListLayout = library:create("UIListLayout", {
  1173. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  1174. SortOrder = Enum.SortOrder.LayoutOrder,
  1175. }, DropdownScroll)
  1176.  
  1177. local options_num = #data.options
  1178. if options_num >= 4 then
  1179. DropdownScroll.Size = UDim2.new(0, 260, 0, 80)
  1180. for i = 1, options_num do
  1181. DropdownScroll.CanvasSize = DropdownScroll.CanvasSize + UDim2.new(0, 0, 0, 20)
  1182. end
  1183. else
  1184. DropdownScroll.Size = UDim2.new(0, 260, 0, 20 * options_num)
  1185. end
  1186.  
  1187. local in_drop = false
  1188. local in_drop2 = false
  1189. local dropdown_open = false
  1190. DropdownButton.MouseButton1Down:Connect(function()
  1191. DropdownScroll.Visible = not DropdownScroll.Visible
  1192. dropdown_open = DropdownScroll.Visible
  1193.  
  1194. if not dropdown_open then
  1195. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1196. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1197. else
  1198. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1199. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1200. end
  1201. end)
  1202. Dropdown.MouseEnter:Connect(function()
  1203. in_drop = true
  1204. end)
  1205. Dropdown.MouseLeave:Connect(function()
  1206. in_drop = false
  1207. end)
  1208. DropdownScroll.MouseEnter:Connect(function()
  1209. in_drop2 = true
  1210. end)
  1211. DropdownScroll.MouseLeave:Connect(function()
  1212. in_drop2 = false
  1213. end)
  1214. uis.InputBegan:Connect(function(input)
  1215. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.MouseButton2 then
  1216. if DropdownScroll.Visible == true and not in_drop and not in_drop2 then
  1217. DropdownScroll.Visible = false
  1218. DropdownScroll.CanvasPosition = Vector2.new(0,0)
  1219.  
  1220. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1221. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1222. end
  1223. end
  1224. end)
  1225.  
  1226. function element:set_value(new_value, cb)
  1227. value = new_value and new_value or value
  1228. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  1229.  
  1230. DropdownButtonText.Text = new_value.Dropdown
  1231.  
  1232. if cb == nil or not cb then
  1233. do_callback()
  1234. end
  1235. end
  1236.  
  1237. local dropdown_is_first = true
  1238. for _,v in next, data.options do
  1239. local Button = library:create("TextButton", {
  1240. Name = v,
  1241. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1242. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1243. BorderSizePixel = 0,
  1244. Position = UDim2.new(0, 0, 0, 20),
  1245. Size = UDim2.new(1, 0, 0, 20),
  1246. AutoButtonColor = false,
  1247. Font = Enum.Font.SourceSans,
  1248. Text = "",
  1249. ZIndex = 2,
  1250. }, DropdownScroll)
  1251.  
  1252. local ButtonText = library:create("TextLabel", {
  1253. Name = "ButtonText",
  1254. BackgroundTransparency = 1,
  1255. Position = UDim2.new(0, 8, 0, 0),
  1256. Size = UDim2.new(0, 245, 1, 0),
  1257. Font = Enum.Font.Ubuntu,
  1258. Text = v,
  1259. TextColor3 = Color3.fromRGB(150, 150, 150),
  1260. TextSize = 14,
  1261. TextXAlignment = Enum.TextXAlignment.Left,
  1262. ZIndex = 2,
  1263. }, Button)
  1264.  
  1265. local Decoration = library:create("Frame", {
  1266. Name = "Decoration",
  1267. BackgroundColor3 = Color3.fromRGB(147, 84, 255),
  1268. BorderSizePixel = 0,
  1269. Size = UDim2.new(0, 1, 1, 0),
  1270. Visible = false,
  1271. ZIndex = 2,
  1272. }, Button)
  1273.  
  1274. Button.MouseEnter:Connect(function()
  1275. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1276. Decoration.Visible = true
  1277. end)
  1278. Button.MouseLeave:Connect(function()
  1279. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1280. Decoration.Visible = false
  1281. end)
  1282. Button.MouseButton1Down:Connect(function()
  1283. DropdownScroll.Visible = false
  1284. DropdownButtonText.Text = v
  1285. value.Dropdown = v
  1286.  
  1287. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1288. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1289.  
  1290. do_callback()
  1291. end)
  1292.  
  1293. if dropdown_is_first then
  1294. dropdown_is_first = false
  1295. end
  1296. end
  1297. element:set_value(value, true)
  1298. elseif type == "Combo" then
  1299. Border.Size = Border.Size + UDim2.new(0, 0, 0, 45)
  1300.  
  1301. value = {Combo = default and default.Combo or {}}
  1302.  
  1303. local Dropdown = library:create("TextLabel", {
  1304. Name = "Dropdown",
  1305. BackgroundTransparency = 1,
  1306. Size = UDim2.new(1, 0, 0, 45),
  1307. Text = "",
  1308. }, Container)
  1309.  
  1310. function element:set_visible(bool)
  1311. if bool then
  1312. if Dropdown.Visible then return end
  1313. Border.Size = Border.Size + UDim2.new(0, 0, 0, 45)
  1314. Dropdown.Visible = true
  1315. else
  1316. if not Dropdown.Visible then return end
  1317. Border.Size = Border.Size + UDim2.new(0, 0, 0, -45)
  1318. Dropdown.Visible = false
  1319. end
  1320. end
  1321.  
  1322. local DropdownButton = library:create("TextButton", {
  1323. Name = "DropdownButton",
  1324. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1325. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1326. Position = UDim2.new(0, 9, 0, 20),
  1327. Size = UDim2.new(0, 260, 0, 20),
  1328. AutoButtonColor = false,
  1329. Text = "",
  1330. }, Dropdown)
  1331.  
  1332. local DropdownButtonText = library:create("TextLabel", {
  1333. Name = "DropdownButtonText",
  1334. BackgroundTransparency = 1,
  1335. Position = UDim2.new(0, 6, 0, 0),
  1336. Size = UDim2.new(0, 250, 1, 0),
  1337. Font = Enum.Font.Ubuntu,
  1338. Text = value.Dropdown,
  1339. TextColor3 = Color3.fromRGB(150, 150, 150),
  1340. TextSize = 14,
  1341. TextXAlignment = Enum.TextXAlignment.Left,
  1342. }, DropdownButton)
  1343.  
  1344. local ImageLabel = library:create("ImageLabel", {
  1345. BackgroundTransparency = 1,
  1346. Position = UDim2.new(0, 245, 0, 8),
  1347. Size = UDim2.new(0, 6, 0, 4),
  1348. Image = "rbxassetid://6724771531",
  1349. }, DropdownButton)
  1350.  
  1351. local DropdownText = library:create("TextLabel", {
  1352. Name = "DropdownText",
  1353. BackgroundTransparency = 1,
  1354. Position = UDim2.new(0, 9, 0, 6),
  1355. Size = UDim2.new(0, 200, 0, 9),
  1356. Font = Enum.Font.Ubuntu,
  1357. Text = text,
  1358. TextColor3 = Color3.fromRGB(150, 150, 150),
  1359. TextSize = 14,
  1360. TextXAlignment = Enum.TextXAlignment.Left,
  1361. }, Dropdown)
  1362.  
  1363. local DropdownScroll = library:create("ScrollingFrame", {
  1364. Name = "DropdownScroll",
  1365. Active = true,
  1366. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1367. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1368. Position = UDim2.new(0, 9, 0, 41),
  1369. Size = UDim2.new(0, 260, 0, 20),
  1370. CanvasSize = UDim2.new(0, 0, 0, 0),
  1371. ScrollBarThickness = 2,
  1372. TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  1373. BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  1374. Visible = false,
  1375. ZIndex = 2,
  1376. }, Dropdown)
  1377.  
  1378. local UIListLayout = library:create("UIListLayout", {
  1379. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  1380. SortOrder = Enum.SortOrder.LayoutOrder,
  1381. }, DropdownScroll)
  1382.  
  1383. local options_num = #data.options
  1384. if options_num >= 4 then
  1385. DropdownScroll.Size = UDim2.new(0, 260, 0, 80)
  1386. for i = 1, options_num do
  1387. DropdownScroll.CanvasSize = DropdownScroll.CanvasSize + UDim2.new(0, 0, 0, 20)
  1388. end
  1389. else
  1390. DropdownScroll.Size = UDim2.new(0, 260, 0, 20 * options_num)
  1391. end
  1392.  
  1393. local in_drop = false
  1394. local in_drop2 = false
  1395. local dropdown_open = false
  1396. DropdownButton.MouseButton1Down:Connect(function()
  1397. DropdownScroll.Visible = not DropdownScroll.Visible
  1398. dropdown_open = DropdownScroll.Visible
  1399.  
  1400. if not dropdown_open then
  1401. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1402. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1403. else
  1404. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1405. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1406. end
  1407. end)
  1408. Dropdown.MouseEnter:Connect(function()
  1409. in_drop = true
  1410. end)
  1411. Dropdown.MouseLeave:Connect(function()
  1412. in_drop = false
  1413. end)
  1414. DropdownScroll.MouseEnter:Connect(function()
  1415. in_drop2 = true
  1416. end)
  1417. DropdownScroll.MouseLeave:Connect(function()
  1418. in_drop2 = false
  1419. end)
  1420. uis.InputBegan:Connect(function(input)
  1421. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.MouseButton2 then
  1422. if DropdownScroll.Visible == true and not in_drop and not in_drop2 then
  1423. DropdownScroll.Visible = false
  1424. DropdownScroll.CanvasPosition = Vector2.new(0,0)
  1425.  
  1426. library:tween(DropdownText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1427. library:tween(DropdownButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1428. end
  1429. end
  1430. end)
  1431.  
  1432. function element.update_text()
  1433. local options = {}
  1434. for i,v in next, data.options do
  1435. if table.find(value.Combo, v) then
  1436. table.insert(options, v)
  1437. end
  1438. end
  1439. local new_text = ""
  1440. if #options == 0 then
  1441. new_text = "..."
  1442. elseif #options == 1 then
  1443. new_text = options[1]
  1444. else
  1445. for i,v in next, options do
  1446. if i == 1 then
  1447. new_text = v
  1448. else
  1449. if i > 3 then
  1450. if i < 5 then
  1451. new_text = new_text..", ..."
  1452. end
  1453. else
  1454. new_text = new_text..", "..v
  1455. end
  1456. end
  1457. end
  1458. end
  1459.  
  1460. DropdownButtonText.Text = new_text
  1461. end
  1462.  
  1463. function element:set_value(new_value, cb)
  1464. value = new_value and new_value or value
  1465. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  1466.  
  1467. element.update_text()
  1468.  
  1469. for _,DropButton in next, DropdownScroll:GetChildren() do
  1470. if not DropButton:IsA("TextButton") then continue end
  1471. local ButtonText = DropButton.ButtonText
  1472. if table.find(value.Combo, ButtonText.Text) then
  1473. DropButton.Decoration.Visible = true
  1474. ButtonText.TextColor3 = Color3.fromRGB(255, 255, 255)
  1475. else
  1476. DropButton.Decoration.Visible = false
  1477. ButtonText.TextColor3 = Color3.fromRGB(150, 150, 150)
  1478. end
  1479. end
  1480.  
  1481. if cb == nil or not cb then
  1482. do_callback()
  1483. end
  1484. end
  1485.  
  1486. local dropdown_is_first = true
  1487. for _,v in next, data.options do
  1488. local Button = library:create("TextButton", {
  1489. Name = v,
  1490. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1491. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1492. BorderSizePixel = 0,
  1493. Position = UDim2.new(0, 0, 0, 20),
  1494. Size = UDim2.new(1, 0, 0, 20),
  1495. AutoButtonColor = false,
  1496. Font = Enum.Font.SourceSans,
  1497. Text = "",
  1498. ZIndex = 2,
  1499. }, DropdownScroll)
  1500.  
  1501. local ButtonText = library:create("TextLabel", {
  1502. Name = "ButtonText",
  1503. BackgroundTransparency = 1,
  1504. Position = UDim2.new(0, 8, 0, 0),
  1505. Size = UDim2.new(0, 245, 1, 0),
  1506. Font = Enum.Font.Ubuntu,
  1507. Text = v,
  1508. TextColor3 = Color3.fromRGB(150, 150, 150),
  1509. TextSize = 14,
  1510. TextXAlignment = Enum.TextXAlignment.Left,
  1511. ZIndex = 2,
  1512. }, Button)
  1513.  
  1514. local Decoration = library:create("Frame", {
  1515. Name = "Decoration",
  1516. BackgroundColor3 = Color3.fromRGB(118, 84, 255),
  1517. BorderSizePixel = 0,
  1518. Size = UDim2.new(0, 1, 1, 0),
  1519. Visible = false,
  1520. ZIndex = 2,
  1521. }, Button)
  1522.  
  1523. local mouse_in = false
  1524. Button.MouseEnter:Connect(function()
  1525. mouse_in = true
  1526. if not table.find(value.Combo, v) then
  1527. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(200, 200, 200)})
  1528. end
  1529. end)
  1530. Button.MouseLeave:Connect(function()
  1531. mouse_in = false
  1532. if not table.find(value.Combo, v) then
  1533. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1534. end
  1535. end)
  1536. Button.MouseButton1Down:Connect(function()
  1537. if table.find(value.Combo, v) then
  1538. table.remove(value.Combo, table.find(value.Combo, v))
  1539. Decoration.Visible = false
  1540. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1541. else
  1542. table.insert(value.Combo, v)
  1543. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1544. Decoration.Visible = true
  1545. end
  1546.  
  1547. element.update_text()
  1548.  
  1549. do_callback()
  1550. end)
  1551.  
  1552. if dropdown_is_first then
  1553. dropdown_is_first = false
  1554. end
  1555. end
  1556. element:set_value(value, true)
  1557. elseif type == "Button" then
  1558. Border.Size = Border.Size + UDim2.new(0, 0, 0, 30)
  1559.  
  1560. local ButtonFrame = library:create("Frame", {
  1561. Name = "ButtonFrame",
  1562. BackgroundTransparency = 1,
  1563. Position = UDim2.new(0, 0, 0, 0),
  1564. Size = UDim2.new(1, 0, 0, 30),
  1565. }, Container)
  1566.  
  1567. local Button = library:create("TextButton", {
  1568. Name = "Button",
  1569. AnchorPoint = Vector2.new(0.5, 0.5),
  1570. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1571. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1572. Position = UDim2.new(0.5, 0, 0.5, 0),
  1573. Size = UDim2.new(0, 215, 0, 20),
  1574. AutoButtonColor = false,
  1575. Font = Enum.Font.Ubuntu,
  1576. Text = text,
  1577. TextColor3 = Color3.fromRGB(150, 150, 150),
  1578. TextSize = 14,
  1579. }, ButtonFrame)
  1580.  
  1581. Button.MouseEnter:Connect(function()
  1582. library:tween(Button, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1583. end)
  1584. Button.MouseLeave:Connect(function()
  1585. library:tween(Button, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1586. end)
  1587. Button.MouseButton1Down:Connect(function()
  1588. Button.BorderColor3 = Color3.fromRGB(155, 84, 255)
  1589. library:tween(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(0, 0, 0)})
  1590. do_callback()
  1591. end)
  1592. elseif type == "TextBox" then
  1593. Border.Size = Border.Size + UDim2.new(0, 0, 0, 30)
  1594.  
  1595. value = {Text = data.default and data.default or ""}
  1596.  
  1597. local ButtonFrame = library:create("Frame", {
  1598. Name = "ButtonFrame",
  1599. BackgroundTransparency = 1,
  1600. Position = UDim2.new(0, 0, 0, 0),
  1601. Size = UDim2.new(1, 0, 0, 30),
  1602. }, Container)
  1603.  
  1604. function element:set_visible(bool)
  1605. if bool then
  1606. if ButtonFrame.Visible then return end
  1607. Border.Size = Border.Size + UDim2.new(0, 0, 0, 30)
  1608. ButtonFrame.Visible = true
  1609. else
  1610. if not ButtonFrame.Visible then return end
  1611. Border.Size = Border.Size + UDim2.new(0, 0, 0, -30)
  1612. ButtonFrame.Visible = false
  1613. end
  1614. end
  1615.  
  1616. local TextBox = library:create("TextBox", {
  1617. Name = "Button",
  1618. AnchorPoint = Vector2.new(0.5, 0.5),
  1619. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1620. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1621. Position = UDim2.new(0.5, 0, 0.5, 0),
  1622. Size = UDim2.new(0, 215, 0, 20),
  1623. Font = Enum.Font.Ubuntu,
  1624. Text = text,
  1625. TextColor3 = Color3.fromRGB(150, 150, 150),
  1626. TextSize = 14,
  1627. PlaceholderText = text,
  1628. ClearTextOnFocus = false,
  1629. }, ButtonFrame)
  1630.  
  1631. TextBox.MouseEnter:Connect(function()
  1632. library:tween(TextBox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1633. end)
  1634. TextBox.MouseLeave:Connect(function()
  1635. library:tween(TextBox, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1636. end)
  1637. TextBox:GetPropertyChangedSignal("Text"):Connect(function()
  1638. if string.len(TextBox.Text) > 15 then
  1639. TextBox.Text = string.sub(TextBox.Text, 1, 15)
  1640. end
  1641. if TextBox.Text ~= value.Text then
  1642. value.Text = TextBox.Text
  1643. do_callback()
  1644. end
  1645. end)
  1646. uis.TextBoxFocused:connect(function()
  1647. if uis:GetFocusedTextBox() == TextBox then
  1648. library:tween(TextBox, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(135, 84, 255)})
  1649. end
  1650. end)
  1651. uis.TextBoxFocusReleased:connect(function()
  1652. library:tween(TextBox, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(0, 0, 0)})
  1653. end)
  1654.  
  1655.  
  1656. function element:set_value(new_value, cb)
  1657. value = new_value or value
  1658.  
  1659. TextBox.Text = value.Text
  1660.  
  1661. if cb == nil or not cb then
  1662. do_callback()
  1663. end
  1664. end
  1665. element:set_value(value, true)
  1666. elseif type == "Scroll" then
  1667. local scrollsize = data.scrollsize and data.scrollsize or 5
  1668.  
  1669. Border.Size = Border.Size + UDim2.new(0, 0, 0, scrollsize * 20 + 10)
  1670.  
  1671. value = {Scroll = data.options[1]}
  1672.  
  1673. local Scroll = library:create("Frame", {
  1674. Name = "Scroll",
  1675. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1676. BackgroundTransparency = 1,
  1677. Position = UDim2.new(0, 0, 0, 0),
  1678. Size = UDim2.new(1, 0, 0, scrollsize * 20 + 10),
  1679. }, Container)
  1680.  
  1681. function element:set_visible(bool)
  1682. if bool then
  1683. if Scroll.Visible then return end
  1684. Scroll.Size = Border.Size + UDim2.new(0, 0, 0, scrollsize * 20 + 10)
  1685. Scroll.Visible = true
  1686. else
  1687. if not Scroll.Visible then return end
  1688. Scroll.Size = Border.Size + UDim2.new(0, 0, 0, -scrollsize * 20 + 10)
  1689. Scroll.Visible = false
  1690. end
  1691. end
  1692.  
  1693. local ScrollFrame = library:create("ScrollingFrame", {
  1694. Name = "ScrollFrame",
  1695. Active = true,
  1696. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1697. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1698. Position = UDim2.new(0.5, 0, 0, 5),
  1699. Size = UDim2.new(0, 215, 0, scrollsize * 20),
  1700. BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  1701. CanvasSize = UDim2.new(0, 0, 0, #data.options * 20),
  1702. ScrollBarThickness = 2,
  1703. TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png",
  1704. AnchorPoint = Vector2.new(0.5, 0),
  1705. ScrollBarImageColor3 = Color3.fromRGB(135, 84, 255),
  1706. }, Scroll)
  1707. ScrollFrame.MouseEnter:Connect(function()
  1708. library:tween(ScrollFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(50, 50, 50)})
  1709. end)
  1710. ScrollFrame.MouseLeave:Connect(function()
  1711. library:tween(ScrollFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {BorderColor3 = Color3.fromRGB(0, 0, 0)})
  1712. end)
  1713.  
  1714. local UIListLayout = library:create("UIListLayout", {
  1715. HorizontalAlignment = Enum.HorizontalAlignment.Center,
  1716. SortOrder = Enum.SortOrder.LayoutOrder,
  1717. }, ScrollFrame)
  1718.  
  1719. local scroll_is_first = true
  1720. for _,v in next, data.options do
  1721. local Button = library:create("TextButton", {
  1722. Name = v,
  1723. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1724. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1725. BorderSizePixel = 0,
  1726. Position = UDim2.new(0, 0, 0, 20),
  1727. Size = UDim2.new(1, 0, 0, 20),
  1728. AutoButtonColor = false,
  1729. Font = Enum.Font.SourceSans,
  1730. Text = "",
  1731. TextColor3 = Color3.fromRGB(0, 0, 0),
  1732. TextSize = 14,
  1733. }, ScrollFrame)
  1734.  
  1735. local ButtonText = library:create("TextLabel", {
  1736. Name = "ButtonText",
  1737. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1738. BackgroundTransparency = 1,
  1739. Position = UDim2.new(0, 7, 0, 0),
  1740. Size = UDim2.new(0, 210, 1, 0),
  1741. Font = Enum.Font.Ubuntu,
  1742. Text = v,
  1743. TextColor3 = Color3.fromRGB(150, 150, 150),
  1744. TextSize = 14,
  1745. TextXAlignment = Enum.TextXAlignment.Left,
  1746. }, Button)
  1747.  
  1748. local Decoration = library:create("Frame", {
  1749. Name = "Decoration",
  1750. Parent = Button,
  1751. BackgroundColor3 = Color3.fromRGB(150, 84, 255),
  1752. BorderSizePixel = 0,
  1753. Size = UDim2.new(0, 1, 1, 0),
  1754. Visible = false,
  1755. }, Button)
  1756.  
  1757. local mouse_in = false
  1758. Button.MouseEnter:Connect(function()
  1759. mouse_in = true
  1760. if value.Scroll ~= v then
  1761. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(200, 200, 200)})
  1762. end
  1763. end)
  1764. Button.MouseLeave:Connect(function()
  1765. mouse_in = false
  1766. if value.Scroll ~= v then
  1767. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1768. end
  1769. end)
  1770. Button.MouseButton1Down:Connect(function()
  1771. for _,Button2 in next, ScrollFrame:GetChildren() do
  1772. if not Button2:IsA("TextButton") then continue end
  1773. Button2.Decoration.Visible = false
  1774. library:tween(Button2.ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1775. end
  1776.  
  1777. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  1778.  
  1779. Decoration.Visible = true
  1780. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1781.  
  1782. value.Scroll = v
  1783.  
  1784. do_callback()
  1785. end)
  1786.  
  1787. if scroll_is_first then
  1788. scroll_is_first = false
  1789. Decoration.Visible = true
  1790. ButtonText.TextColor3 = Color3.fromRGB(255, 255, 255)
  1791. end
  1792. end
  1793.  
  1794. function element:add_value(v)
  1795. if ScrollFrame:FindFirstChild(v) then return end
  1796.  
  1797. ScrollFrame.CanvasSize = ScrollFrame.CanvasSize + UDim2.new(0, 0, 0, 20)
  1798.  
  1799. local Button = library:create("TextButton", {
  1800. Name = v,
  1801. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1802. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1803. BorderSizePixel = 0,
  1804. Position = UDim2.new(0, 0, 0, 20),
  1805. Size = UDim2.new(1, 0, 0, 20),
  1806. AutoButtonColor = false,
  1807. Font = Enum.Font.SourceSans,
  1808. Text = "",
  1809. TextColor3 = Color3.fromRGB(0, 0, 0),
  1810. TextSize = 14,
  1811. }, ScrollFrame)
  1812.  
  1813. local ButtonText = library:create("TextLabel", {
  1814. Name = "ButtonText",
  1815. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1816. BackgroundTransparency = 1,
  1817. Position = UDim2.new(0, 7, 0, 0),
  1818. Size = UDim2.new(0, 210, 1, 0),
  1819. Font = Enum.Font.Ubuntu,
  1820. Text = v,
  1821. TextColor3 = Color3.fromRGB(150, 150, 150),
  1822. TextSize = 14,
  1823. TextXAlignment = Enum.TextXAlignment.Left,
  1824. }, Button)
  1825.  
  1826. local Decoration = library:create("Frame", {
  1827. Name = "Decoration",
  1828. Parent = Button,
  1829. BackgroundColor3 = Color3.fromRGB(170, 84, 255),
  1830. BorderSizePixel = 0,
  1831. Size = UDim2.new(0, 1, 1, 0),
  1832. Visible = false,
  1833. }, Button)
  1834.  
  1835. local mouse_in = false
  1836. Button.MouseEnter:Connect(function()
  1837. mouse_in = true
  1838. if value.Scroll ~= v then
  1839. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(200, 200, 200)})
  1840. end
  1841. end)
  1842. Button.MouseLeave:Connect(function()
  1843. mouse_in = false
  1844. if value.Scroll ~= v then
  1845. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1846. end
  1847. end)
  1848. Button.MouseButton1Down:Connect(function()
  1849. for _,Button2 in next, ScrollFrame:GetChildren() do
  1850. if not Button2:IsA("TextButton") then continue end
  1851. Button2.Decoration.Visible = false
  1852. library:tween(Button2.ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1853. end
  1854.  
  1855. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  1856.  
  1857. Decoration.Visible = true
  1858. library:tween(ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1859.  
  1860. value.Scroll = v
  1861.  
  1862. do_callback()
  1863. end)
  1864.  
  1865. if scroll_is_first then
  1866. scroll_is_first = false
  1867. Decoration.Visible = true
  1868. ButtonText.TextColor3 = Color3.fromRGB(255, 255, 255)
  1869. end
  1870. end
  1871.  
  1872. function element:set_value(new_value, cb)
  1873. value = new_value or value
  1874.  
  1875. for _,Button2 in next, ScrollFrame:GetChildren() do
  1876. if not Button2:IsA("TextButton") then continue end
  1877. Button2.Decoration.Visible = false
  1878. library:tween(Button2.ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1879. end
  1880. ScrollFrame[value.Scroll].Decoration.Visible = true
  1881. library:tween(ScrollFrame[value.Scroll].ButtonText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1882.  
  1883. if cb == nil or not cb then
  1884. do_callback()
  1885. end
  1886. end
  1887. element:set_value(value, true)
  1888. elseif type == "Slider" then
  1889. Border.Size = Border.Size + UDim2.new(0, 0, 0, 35)
  1890.  
  1891. value = {Slider = default and default.default or 0}
  1892.  
  1893. local min, max = default and default.min or 0, default and default.max or 100
  1894.  
  1895. local Slider = library:create("Frame", {
  1896. Name = "Slider",
  1897. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1898. BackgroundTransparency = 1,
  1899. Size = UDim2.new(1, 0, 0, 35),
  1900. }, Container)
  1901.  
  1902. function element:set_visible(bool)
  1903. if bool then
  1904. if Slider.Visible then return end
  1905. Border.Size = Border.Size + UDim2.new(0, 0, 0, 35)
  1906. Slider.Visible = true
  1907. else
  1908. if not Slider.Visible then return end
  1909. Border.Size = Border.Size + UDim2.new(0, 0, 0, -35)
  1910. Slider.Visible = false
  1911. end
  1912. end
  1913.  
  1914. local SliderText = library:create("TextLabel", {
  1915. Name = "SliderText",
  1916. BackgroundTransparency = 1,
  1917. Position = UDim2.new(0, 9, 0, 6),
  1918. Size = UDim2.new(0, 200, 0, 9),
  1919. Font = Enum.Font.Ubuntu,
  1920. Text = text,
  1921. TextColor3 = Color3.fromRGB(150, 150, 150),
  1922. TextSize = 14,
  1923. TextXAlignment = Enum.TextXAlignment.Left,
  1924. }, Slider)
  1925.  
  1926. local SliderButton = library:create("TextButton", {
  1927. Name = "SliderButton",
  1928. BackgroundColor3 = Color3.fromRGB(25, 25, 25),
  1929. BorderColor3 = Color3.fromRGB(0, 0, 0),
  1930. Position = UDim2.new(0, 9, 0, 20),
  1931. Size = UDim2.new(0, 260, 0, 10),
  1932. AutoButtonColor = false,
  1933. Font = Enum.Font.SourceSans,
  1934. Text = "",
  1935. }, Slider)
  1936.  
  1937. local SliderFrame = library:create("Frame", {
  1938. Name = "SliderFrame",
  1939. BackgroundColor3 = Color3.fromRGB(255, 255, 255),
  1940. BorderSizePixel = 0,
  1941. Size = UDim2.new(0, 100, 1, 0),
  1942. }, SliderButton)
  1943.  
  1944. local UIGradient = library:create("UIGradient", {
  1945. Color = ColorSequence.new{ColorSequenceKeypoint.new(0, Color3.fromRGB(162, 79, 239)), ColorSequenceKeypoint.new(1, Color3.fromRGB(56, 67, 163))},
  1946. Rotation = 90,
  1947. }, SliderFrame)
  1948.  
  1949. local SliderValue = library:create("TextLabel", {
  1950. Name = "SliderValue",
  1951. BackgroundTransparency = 1,
  1952. Position = UDim2.new(0, 69, 0, 6),
  1953. Size = UDim2.new(0, 200, 0, 9),
  1954. Font = Enum.Font.Ubuntu,
  1955. Text = value.Slider,
  1956. TextColor3 = Color3.fromRGB(150, 150, 150),
  1957. TextSize = 14,
  1958. TextXAlignment = Enum.TextXAlignment.Right,
  1959. }, Slider)
  1960.  
  1961. local is_sliding = false
  1962. local mouse_in = false
  1963. Slider.MouseEnter:Connect(function()
  1964. library:tween(SliderText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1965. library:tween(SliderValue, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(255, 255, 255)})
  1966.  
  1967. mouse_in = true
  1968. end)
  1969. Slider.MouseLeave:Connect(function()
  1970. if not is_sliding then
  1971. library:tween(SliderText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1972. library:tween(SliderValue, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  1973. end
  1974.  
  1975. mouse_in = false
  1976. end)
  1977. SliderButton.MouseButton1Down:Connect(function()
  1978. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 260), 1, 0)
  1979.  
  1980. local val = math.floor((((max - min) / 260) * SliderFrame.AbsoluteSize.X) + min)
  1981. if val ~= value.Slider then
  1982. SliderValue.Text = val
  1983. value.Slider = val
  1984. do_callback()
  1985. end
  1986.  
  1987. is_sliding = true
  1988.  
  1989. move_connection = mouse.Move:Connect(function()
  1990. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 260), 1, 0)
  1991.  
  1992. local val = math.floor((((max - min) / 260) * SliderFrame.AbsoluteSize.X) + min)
  1993. if val ~= value.Slider then
  1994. SliderValue.Text = val
  1995. value.Slider = val
  1996. do_callback()
  1997. end
  1998. end)
  1999. release_connection = uis.InputEnded:Connect(function(Mouse)
  2000. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  2001. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 260), 1, 0)
  2002.  
  2003. local val = math.floor((((max - min) / 260) * SliderFrame.AbsoluteSize.X) + min)
  2004. if val ~= value.Slider then
  2005. SliderValue.Text = val
  2006. value.Slider = val
  2007. do_callback()
  2008. end
  2009.  
  2010. is_sliding = false
  2011.  
  2012. if not mouse_in then
  2013. library:tween(SliderText, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  2014. library:tween(SliderValue, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {TextColor3 = Color3.fromRGB(150, 150, 150)})
  2015. end
  2016.  
  2017. move_connection:Disconnect()
  2018. release_connection:Disconnect()
  2019. end
  2020. end)
  2021. end)
  2022.  
  2023. function element:set_value(new_value, cb)
  2024. value = new_value and new_value or value
  2025. menu.values[tab.tab_num][section_name][sector_name][flag] = value
  2026.  
  2027. local new_size = (value.Slider - min) / (max-min)
  2028. SliderFrame.Size = UDim2.new(new_size, 0, 1, 0)
  2029. SliderValue.Text = value.Slider
  2030.  
  2031. if cb == nil or not cb then
  2032. do_callback()
  2033. end
  2034. end
  2035. element:set_value(value, true)
  2036. end
  2037.  
  2038. menu.on_load_cfg:Connect(function()
  2039. if type ~= "Button" and type ~= "Scroll" then
  2040. element:set_value(menu.values[tab.tab_num][section_name][sector_name][flag])
  2041. end
  2042. end)
  2043.  
  2044. return element
  2045. end
  2046.  
  2047. return sector
  2048. end
  2049.  
  2050. return section
  2051. end
  2052.  
  2053. return tab
  2054. end
  2055.  
  2056. return menu
  2057. end
  2058.  
  2059. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement