joefromsansnite

Untitled

Oct 7th, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.95 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4. -- Variables
  5. title = (title == nil) and "Title" or title
  6.  
  7. local uis = game:GetService("UserInputService")
  8. local tweenService = game:GetService("TweenService")
  9.  
  10. local player = game.Players.LocalPlayer
  11. local mouse = player:GetMouse()
  12.  
  13.  
  14. -- Gui
  15. local ScreenGui = Instance.new("ScreenGui")
  16. local Menu = Instance.new("Frame")
  17. local Background = Instance.new("Frame")
  18. local SideContainer = Instance.new("ScrollingFrame")
  19. local UIListLayout = Instance.new("UIListLayout")
  20. local Frames = Instance.new("Frame")
  21. local Exit = Instance.new("TextButton")
  22. local Title = Instance.new("TextLabel")
  23.  
  24. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  25. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  26.  
  27. Menu.Name = "Menu"
  28. Menu.Parent = ScreenGui
  29. Menu.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  30. Menu.BorderSizePixel = 0
  31. Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  32. Menu.Size = UDim2.new(0, 450, 0, 15)
  33.  
  34. Background.Name = "Background"
  35. Background.Parent = Menu
  36. Background.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  37. Background.BorderSizePixel = 0
  38. Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  39. Background.Size = UDim2.new(0, 450, 0, 290)
  40.  
  41. SideContainer.Name = "SideContainer"
  42. SideContainer.Parent = Background
  43. SideContainer.Active = true
  44. SideContainer.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  45. SideContainer.BorderSizePixel = 0
  46. SideContainer.Size = UDim2.new(0, 120, 0, 290)
  47. SideContainer.ScrollBarThickness = 8
  48. SideContainer.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  49.  
  50. UIListLayout.Parent = SideContainer
  51. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  52. UIListLayout.Padding = UDim.new(0, 5)
  53.  
  54. Frames.Name = "Frames"
  55. Frames.Parent = Background
  56. Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  57. Frames.BackgroundTransparency = 1
  58. Frames.BorderSizePixel = 0
  59. Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  60. Frames.Size = UDim2.new(0, 330, 0, 290)
  61.  
  62. Exit.Name = "Exit"
  63. Exit.Parent = Menu
  64. Exit.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  65. Exit.BorderSizePixel = 0
  66. Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  67. Exit.Size = UDim2.new(0, 15, 0, 15)
  68. Exit.Font = Enum.Font.Code
  69. Exit.Text = "X"
  70. Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  71. Exit.TextSize = 14.000
  72. Exit.AutoButtonColor = false
  73.  
  74. Title.Name = "Title"
  75. Title.Parent = Menu
  76. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77. Title.BackgroundTransparency = 1.000
  78. Title.BorderSizePixel = 0
  79. Title.Size = UDim2.new(0, 435, 0, 15)
  80. Title.Font = Enum.Font.Code
  81. Title.Text = title
  82. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  83. Title.TextScaled = true
  84. Title.TextSize = 14.000
  85. Title.TextWrapped = true
  86.  
  87. -- Local functions
  88. local function setDraggable()
  89. Menu.Active = true
  90. Menu.Draggable = true
  91. end
  92. local function exitButton()
  93. ScreenGui:Destroy()
  94. end
  95.  
  96. local function createContainer(parent)
  97. local Container = Instance.new("Frame")
  98. local UICorner = Instance.new("UICorner")
  99.  
  100. Container.Parent = parent
  101. Container.Name = "Container"
  102. Container.BackgroundTransparency = 0
  103. Container.BackgroundColor3 = Color3.fromRGB(15, 15, 15)
  104. Container.BorderSizePixel = 0
  105. Container.Size = UDim2.new(0, 301, 0, 46)
  106. UICorner.Parent = Container
  107.  
  108. return Container
  109. end
  110. local function hideFrames()
  111. for i,v in pairs(Frames:GetChildren()) do
  112. v.Visible = false
  113. end
  114. end
  115. local function resetTabColor()
  116. for i, v in pairs(SideContainer:GetChildren()) do
  117. if v:IsA("TextButton") then
  118. v.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  119. end
  120. end
  121. end
  122. local function buttonClickEffect(parent)
  123. parent.ClipsDescendants = true
  124.  
  125. local mouseLocation = uis:GetMouseLocation()
  126. local absolutePosition = parent.AbsolutePosition
  127.  
  128. local effectXPosition = UDim2.new(0, mouseLocation.X-absolutePosition.X, 0, (mouseLocation.Y-absolutePosition.Y)-36)
  129.  
  130. local ButtonEffect = Instance.new("ImageLabel")
  131.  
  132. ButtonEffect.Name = "ButtonEffect"
  133. ButtonEffect.Parent = parent
  134. ButtonEffect.AnchorPoint = Vector2.new(0.5, 0.5)
  135. ButtonEffect.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  136. ButtonEffect.BackgroundTransparency = 1.000
  137. ButtonEffect.BorderSizePixel = 0
  138. ButtonEffect.Position = UDim2.new(0, 0, 0, 0)
  139. ButtonEffect.Size = UDim2.new(0, 25, 0, 25)
  140. ButtonEffect.Image = "rbxassetid://7658630902"
  141. ButtonEffect.ImageTransparency = 0.500
  142. ButtonEffect.Position = effectXPosition
  143.  
  144. ButtonEffect:TweenSize(UDim2.new(0, 175, 0, 175))
  145.  
  146. spawn(function()
  147. for i = 0.5, 1.05, 0.05 do
  148. ButtonEffect.ImageTransparency = i
  149. if i >= 1 then
  150. ButtonEffect:Destroy()
  151. end
  152. wait()
  153. end
  154. end)
  155. end
  156. local function dropdownEffect(ui, visible, rot1, rot2)
  157. local properties = (visible == true) and {
  158. Rotation = rot1
  159. } or {
  160. Rotation = rot2
  161. }
  162.  
  163. local info = TweenInfo.new(0.5)
  164. local tween = tweenService:Create(ui, info, properties)
  165.  
  166. tween:Play()
  167. end
  168.  
  169.  
  170. local library2 = {}
  171.  
  172. function library2:Keybind(key, callback)
  173. key = (key == nil) and "E" or key
  174.  
  175. uis.InputBegan:Connect(function(input, gameProcessedEvent)
  176. if gameProcessedEvent then
  177. return
  178. end
  179. if type(callback) == "function" then
  180. if type(key) == "string" then
  181. if input.KeyCode == Enum.KeyCode[key] then
  182. callback()
  183. end
  184. elseif type(key) == "table" then
  185. for i,v in pairs(key) do
  186. if input.KeyCode == Enum.KeyCode[v] then
  187. callback()
  188. end
  189. end
  190. end
  191.  
  192. end
  193. end)
  194. end
  195. function library2:ToggleVisibility(bool)
  196. Menu.Visible = bool
  197. end
  198.  
  199. function library2:NewTab(text)
  200. text = (type(text) ~= "string") and "Tab" or text
  201.  
  202. local TextButton = Instance.new("TextButton")
  203. local ScrollingFrame = Instance.new("ScrollingFrame")
  204. local UIListLayout = Instance.new("UIListLayout")
  205. local UICorner = Instance.new("UICorner")
  206.  
  207. TextButton.Parent = SideContainer
  208. TextButton.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  209. TextButton.BorderSizePixel = 0
  210. TextButton.Size = UDim2.new(0, 114, 0, 35)
  211. TextButton.Font = Enum.Font.SourceSans
  212. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  213. TextButton.TextSize = 14.000
  214. TextButton.Text = text
  215. TextButton.AutoButtonColor = false
  216. TextButton.ClipsDescendants = true
  217.  
  218. ScrollingFrame.Parent = Frames
  219. ScrollingFrame.AnchorPoint = Vector2.new(0.5, 0.5)
  220. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  221. ScrollingFrame.BackgroundTransparency = 1.000
  222. ScrollingFrame.BorderSizePixel = 0
  223. ScrollingFrame.Size = UDim2.new(0, 310, 0, 270)
  224. ScrollingFrame.Position = UDim2.new(0, 165, 0, 140)
  225. ScrollingFrame.ScrollBarThickness = 8
  226. ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  227. ScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  228.  
  229. UIListLayout.Parent = ScrollingFrame
  230. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  231. UIListLayout.Padding = UDim.new(0, 10)
  232.  
  233. UICorner.Parent = TextButton
  234.  
  235. hideFrames()
  236. TextButton.MouseButton1Down:Connect(function()
  237. buttonClickEffect(TextButton)
  238. hideFrames()
  239. resetTabColor()
  240.  
  241. ScrollingFrame.Visible = true
  242. TextButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  243. end)
  244.  
  245. local library3 = {}
  246.  
  247. function library3:NewSection(text)
  248. text = (type(text) ~= "string") and "Section" or text
  249.  
  250. local Section = Instance.new("Frame")
  251. local UIListLayout = Instance.new("UIListLayout")
  252. local UICorner = Instance.new("UICorner")
  253. local SectionText = Instance.new("TextLabel")
  254. local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
  255. local SectionDropdown = Instance.new("TextButton")
  256. local arrow_drop = Instance.new("ImageButton")
  257.  
  258. Section.Name = "Section"
  259. Section.Parent = ScrollingFrame
  260. Section.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  261. Section.BorderSizePixel = 0
  262. Section.Size = UDim2.new(0, 305, 0, 50)
  263. Section.AutomaticSize = Enum.AutomaticSize.Y
  264.  
  265. UIListLayout.Parent = Section
  266. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  267. UIListLayout.Padding = UDim.new(0, 5)
  268.  
  269. SectionText.Name = "SectionText"
  270. SectionText.Parent = Section
  271. SectionText.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  272. SectionText.BorderSizePixel = 0
  273. SectionText.Size = UDim2.new(0, 301, 0, 54)
  274. SectionText.Font = Enum.Font.Code
  275. SectionText.Text = text
  276. SectionText.TextColor3 = Color3.fromRGB(255, 255, 255)
  277. SectionText.TextSize = 25.000
  278.  
  279. UIAspectRatioConstraint.Parent = SectionText
  280. UIAspectRatioConstraint.AspectRatio = 10.000
  281.  
  282. arrow_drop.Name = "arrow_drop_up"
  283. arrow_drop.Parent = SectionText
  284. arrow_drop.AnchorPoint = Vector2.new(0.5, 0.5)
  285. arrow_drop.BackgroundTransparency = 1.000
  286. arrow_drop.Position = UDim2.new(0.0333333351, 5, 0.5, 0)
  287. arrow_drop.Rotation = 180.000
  288. arrow_drop.Size = UDim2.new(0, 33, 0, 45)
  289. arrow_drop.Image = "rbxassetid://3926307971"
  290. arrow_drop.ImageRectOffset = Vector2.new(164, 484)
  291. arrow_drop.ImageRectSize = Vector2.new(36, 36)
  292.  
  293. UICorner.Parent = Section
  294. UICorner.CornerRadius = UDim.new(0, 10)
  295.  
  296. arrow_drop.MouseButton1Down:Connect(function()
  297. local visible = true
  298.  
  299. for i,v in pairs(Section:GetChildren()) do
  300. if v:IsA("Frame") then
  301. v.Visible = not v.Visible
  302. visible = v.Visible
  303. end
  304. end
  305.  
  306. dropdownEffect(arrow_drop, visible, 180, 90)
  307. end)
  308.  
  309. local library4 = {}
  310.  
  311. function library4:NewButton(text, callback)
  312. text = (type(text) ~= "string") and "Button" or text
  313.  
  314. local TextButton = Instance.new("TextButton")
  315. local UICorner = Instance.new("UICorner")
  316. local Container = createContainer(Section)
  317.  
  318. TextButton.Parent = Container
  319. TextButton.AnchorPoint = Vector2.new(0.5, 0.5)
  320. TextButton.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  321. TextButton.BorderSizePixel = 0
  322. TextButton.Position = UDim2.new(0.5, 0, 0.5, 0)
  323. TextButton.Size = UDim2.new(0, 291, 0, 37)
  324. TextButton.AutoButtonColor = false
  325. TextButton.Font = Enum.Font.Code
  326. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  327. TextButton.TextSize = 14.000
  328. TextButton.Text = text
  329. TextButton.ClipsDescendants = true
  330.  
  331. UICorner.CornerRadius = UDim.new(0, 8)
  332. UICorner.Parent = TextButton
  333.  
  334. TextButton.MouseButton1Down:Connect(function()
  335. buttonClickEffect(TextButton)
  336.  
  337. if type(callback) == "function" then
  338. callback()
  339. else
  340. print("Clicked!")
  341. end
  342. end)
  343. end
  344. function library4:NewTextBox(text, callback)
  345. text = (type(text) ~= "string") and "Placeholder" or text
  346.  
  347. local Container = createContainer(Section)
  348. local TextBox = Instance.new("TextBox")
  349.  
  350. TextBox.Parent = Container
  351. TextBox.AnchorPoint = Vector2.new(0.5, 0.5)
  352. TextBox.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  353. TextBox.Position = UDim2.new(0.5, 0, 0.5, 0)
  354. TextBox.Size = UDim2.new(0, 291, 0, 37)
  355. TextBox.BorderSizePixel = 0
  356. TextBox.Font = Enum.Font.SourceSans
  357. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  358. TextBox.TextSize = 14.000
  359. TextBox.PlaceholderText = text
  360. TextBox.Text = text
  361.  
  362. UICorner.CornerRadius = UDim.new(0, 8)
  363. UICorner.Parent = TextBox
  364.  
  365. TextBox.FocusLost:Connect(function()
  366. if type(callback) == "function" then
  367. callback(TextBox.Text)
  368. else
  369. print("Lost Focus")
  370. end
  371. end)
  372. end
  373. function library4:NewSlider(text, min, max, callback)
  374. text = (type(text) ~= "string") and "Slider" or text
  375. min = min == nil and 0 or min
  376. max = max == nil and 10 or max
  377.  
  378. local holding = false
  379. local val = 0
  380.  
  381. local Slider = Instance.new("Frame")
  382. local TextButton_2 = Instance.new("TextButton")
  383. local UICorner = Instance.new("UICorner")
  384. local TextLabel = Instance.new("TextLabel")
  385. local TextLabel_2 = Instance.new("TextLabel")
  386. local UICorner_2 = Instance.new("UICorner")
  387. local Container = createContainer(Section)
  388.  
  389. Slider.Name = "Slider"
  390. Slider.Parent = Container
  391. Slider.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  392. Slider.Position = UDim2.new(0.5, 0, 0.5, 0)
  393. Slider.Size = UDim2.new(0, 228, 0, 12)
  394. Slider.AnchorPoint = Vector2.new(0.5, 0.5)
  395.  
  396. TextButton_2.Parent = Slider
  397. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  398. TextButton_2.BorderSizePixel = 0
  399. TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  400. TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  401. TextButton_2.Font = Enum.Font.Code
  402. TextButton_2.Text = ""
  403. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  404. TextButton_2.TextSize = 14.000
  405.  
  406. UICorner.CornerRadius = UDim.new(16, 0)
  407. UICorner.Parent = TextButton_2
  408.  
  409. TextLabel.Parent = Slider
  410. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  411. TextLabel.BackgroundTransparency = 1.000
  412. TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  413. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  414. TextLabel.Font = Enum.Font.Code
  415. TextLabel.Text = text
  416. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  417. TextLabel.TextSize = 14.000
  418.  
  419. TextLabel_2.Parent = Slider
  420. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  421. TextLabel_2.BackgroundTransparency = 1.000
  422. TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  423. TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  424. TextLabel_2.Font = Enum.Font.Code
  425. TextLabel_2.Text = "0"
  426. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  427. TextLabel_2.TextSize = 14.000
  428.  
  429. UICorner_2.CornerRadius = UDim.new(16, 0)
  430. UICorner_2.Parent = Slider
  431.  
  432. TextButton_2.MouseButton1Down:Connect(function()
  433. holding = true
  434. while holding do
  435. local mouseLocation = uis:GetMouseLocation()
  436. local absolutePosition = Slider.AbsolutePosition
  437. local absoluteSize = Slider.AbsoluteSize
  438.  
  439. local xLocation = (mouseLocation.X - absolutePosition.X) / absoluteSize.X
  440. local clampedX = math.clamp(xLocation, 0, 1)
  441.  
  442. val = math.ceil( min + (clampedX * (max-min)) )
  443.  
  444. TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  445. TextLabel_2.Text = tostring(val)
  446.  
  447. if type(callback) == "function" then
  448. callback(val)
  449. else
  450. print("Slider Value: "..val)
  451. end
  452. wait()
  453. end
  454. end)
  455.  
  456. TextButton_2.MouseButton1Up:Connect(function()
  457. holding = false
  458. end)
  459. mouse.Button1Up:Connect(function()
  460. holding = false
  461. end)
  462. end
  463. function library4:NewToggle(text, callback)
  464. text = (type(text) ~= "string") and "Toggle" or text
  465.  
  466. local toggled = false
  467. local debounce = false
  468.  
  469. local Frame = Instance.new("Frame")
  470. local UICorner = Instance.new("UICorner")
  471. local TextLabel = Instance.new("TextLabel")
  472. local TextButton_2 = Instance.new("TextButton")
  473. local UICorner_2 = Instance.new("UICorner")
  474. local Container = createContainer(Section)
  475.  
  476. Frame.Parent = Container
  477. Frame.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  478. Frame.Position = UDim2.new(0.5, 0, 0.65, 0)
  479. Frame.Size = UDim2.new(0, 50, 0, 20)
  480. Frame.Name = "Toggle"
  481. Frame.AnchorPoint = Vector2.new(0.5, 0.5)
  482.  
  483. UICorner.CornerRadius = UDim.new(16, 0)
  484. UICorner.Parent = Frame
  485.  
  486. TextLabel.Parent = Frame
  487. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  488. TextLabel.BackgroundTransparency = 1.000
  489. TextLabel.Position = UDim2.new(-1.51859653, 0, -1.10000002, 0)
  490. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  491. TextLabel.Font = Enum.Font.Code
  492. TextLabel.Text = text
  493. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  494. TextLabel.TextSize = 14.000
  495.  
  496. TextButton_2.Parent = Frame
  497. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  498. TextButton_2.Position = UDim2.new(0, 0, 2.98023224e-08, 0)
  499. TextButton_2.Size = UDim2.new(0, 20, 0, 20)
  500. TextButton_2.Font = Enum.Font.SourceSans
  501. TextButton_2.Text = ""
  502. TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  503. TextButton_2.TextSize = 14.000
  504. TextButton_2.Name = "ToggleButton"
  505.  
  506. UICorner_2.CornerRadius = UDim.new(16, 0)
  507. UICorner_2.Parent = TextButton_2
  508.  
  509. TextButton_2.MouseButton1Down:Connect(function()
  510. if debounce == false then
  511. debounce = true
  512.  
  513. toggled = not toggled
  514.  
  515. local color = toggled == true and Color3.fromRGB(255, 255, 0) or Color3.fromRGB(255, 0, 0)
  516. local position = toggled == true and UDim2.new(0.6, 0, 0, 0) or UDim2.new(0, 0, 0, 0)
  517.  
  518. TextButton_2:TweenPosition(position)
  519. TextButton_2.BackgroundColor3 = color
  520.  
  521. if type(callback) == "function" then
  522. callback(toggled)
  523. else
  524. print("Toggled: "..tostring(toggled))
  525. end
  526.  
  527. wait(1)
  528. debounce = false
  529. end
  530. end)
  531. end
  532.  
  533. function library4:NewDropdown(text, items, callback)
  534. text = (type(text) ~= "string") and "Dropdown" or text
  535. items = (type(items) ~= "table") and {} or items
  536.  
  537. local Dropdown = Instance.new("Frame")
  538. local TextLabel = Instance.new("TextLabel")
  539. local TextLabel_2 = Instance.new("TextLabel")
  540. local arrow_drop = Instance.new("ImageButton")
  541. local Items = Instance.new("ScrollingFrame")
  542. local UIListLayout = Instance.new("UIListLayout")
  543. local UICorner_2 = Instance.new("UICorner")
  544. local Container = createContainer(Section)
  545.  
  546. Dropdown.Name = "Dropdown"
  547. Dropdown.Parent = Container
  548. Dropdown.AnchorPoint = Vector2.new(0.5, 0.675)
  549. Dropdown.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  550. Dropdown.Position = UDim2.new(0.5, 0, 0.765, 0)
  551. Dropdown.Size = UDim2.new(0, 143, 0, 22)
  552.  
  553. TextLabel.Parent = Dropdown
  554. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  555. TextLabel.BackgroundTransparency = 1.000
  556. TextLabel.Size = UDim2.new(0, 125, 0, 22)
  557. TextLabel.Font = Enum.Font.Code
  558. TextLabel.Text = "Selected: "
  559. TextLabel.TextScaled = true
  560. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  561. TextLabel.TextSize = 14.000
  562.  
  563. TextLabel_2.Parent = Dropdown
  564. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  565. TextLabel_2.BackgroundTransparency = 1.000
  566. TextLabel_2.Position = UDim2.new(0.0212121084, 0, -0.954545438, 0)
  567. TextLabel_2.Size = UDim2.new(0, 135, 0, 13)
  568. TextLabel_2.Font = Enum.Font.Code
  569. TextLabel_2.Text = text
  570. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  571. TextLabel_2.TextSize = 14.000
  572.  
  573. arrow_drop.Name = "arrow_drop_down"
  574. arrow_drop.Parent = Dropdown
  575. arrow_drop.AnchorPoint = Vector2.new(0.5, 0.5)
  576. arrow_drop.BackgroundTransparency = 1.000
  577. arrow_drop.Position = UDim2.new(0.883020937, 0, 0.463999987, 0)
  578. arrow_drop.Size = UDim2.new(0, 22, 0, 22)
  579. arrow_drop.ZIndex = 2
  580. arrow_drop.Image = "rbxassetid://3926307971"
  581. arrow_drop.ImageRectOffset = Vector2.new(324, 524)
  582. arrow_drop.ImageRectSize = Vector2.new(36, 36)
  583.  
  584. Items.Name = "Items"
  585. Items.Parent = Dropdown
  586. Items.Active = true
  587. Items.BackgroundColor3 = Color3.fromRGB(10, 10, 10)
  588. Items.BorderSizePixel = 0
  589. Items.Position = UDim2.new(0, 0, 1, 0)
  590. Items.Size = UDim2.new(0, 143, 0, 69)
  591. Items.Visible = false
  592. Items.CanvasSize = UDim2.new(0, 0, 10, 0)
  593. Items.AutomaticCanvasSize = Enum.AutomaticSize.Y
  594.  
  595. UIListLayout.Parent = Items
  596.  
  597. UICorner_2.Parent = Dropdown
  598.  
  599. local function setContainerSize()
  600. Dropdown.Position = (Items.Visible == true) and UDim2.new(0.5, 0, 0.3, 0) or UDim2.new(0.5, 0, 0.765, 0)
  601. Container.Size = (Items.Visible == true) and UDim2.new(0, 301, 0, 114) or UDim2.new(0, 301, 0, 46)
  602. end
  603.  
  604. arrow_drop.MouseButton1Down:Connect(function()
  605. Items.Visible = not Items.Visible
  606.  
  607. setContainerSize()
  608.  
  609. dropdownEffect(arrow_drop, Items.Visible, 180, 0)
  610. end)
  611.  
  612. local function removeItems()
  613. for _, item in pairs(Items:GetChildren()) do
  614. item:Destroy()
  615. end
  616. end
  617. local function createItems(newItems)
  618. for _, item in pairs(newItems) do
  619. print(typeof(item))
  620. local name = (typeof(item) == "Instance") and item.Name or item
  621.  
  622. local ItemButton = Instance.new("TextButton")
  623. local UICorner = Instance.new("UICorner")
  624.  
  625. ItemButton.Name = "ItemButton"
  626. ItemButton.Parent = Items
  627. ItemButton.BackgroundColor3 = Color3.fromRGB(5, 5, 5)
  628. ItemButton.Position = UDim2.new(0, 0, 0, 0)
  629. ItemButton.Size = UDim2.new(0, 132, 0, 26)
  630. ItemButton.AutoButtonColor = false
  631. ItemButton.Font = Enum.Font.Code
  632. ItemButton.Text = name
  633. ItemButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  634. ItemButton.TextSize = 14.000
  635.  
  636. UICorner.Parent = ItemButton
  637.  
  638. ItemButton.MouseButton1Down:Connect(function()
  639. buttonClickEffect(ItemButton)
  640.  
  641. TextLabel.Text = "Selected: "..name
  642. Items.Visible = false
  643. dropdownEffect(arrow_drop, Items.Visible, 180, 0)
  644. setContainerSize()
  645.  
  646. if type(callback) == "function" then
  647. callback(name)
  648. end
  649. end)
  650. end
  651. end
  652.  
  653. createItems(items)
  654.  
  655. local l5 = {}
  656.  
  657. function l5:Update(items)
  658. removeItems()
  659. createItems(items)
  660. end
  661.  
  662. return l5
  663. end
  664.  
  665. return library4
  666. end
  667. return library3
  668. end
  669.  
  670.  
  671. -- Call functions
  672. setDraggable()
  673. Exit.MouseButton1Click:Connect(exitButton)
  674.  
  675. return library2
  676. end
  677.  
  678. return library
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690. -- library:NewWindow(string: title):NewTab(string: text): NewSection:(string: title): NewButton(string: text, funciton: callback)
  691. -- Color(dictionary: color) NewSlider(string: text, number: min, number: max, function: callback)
  692. -- Keybind(string: key) NewTextBox(string: placeholderText, function: callback)
  693. -- SetTheme(string: theme) NewToggle(string: text, function: callback)
  694. -- ToggleVisibility(boolean: visible)
Advertisement
Add Comment
Please, Sign In to add comment