Advertisement
FantasticFurries

Untitled

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