Advertisement
FantasticFurries

Untitled

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