joefromsansnite

Untitled

Oct 4th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.67 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4. -- Variables
  5. local themes = {
  6. BloodTheme = {
  7. Text = Color3.fromRGB(255, 255, 255),
  8. Menu = Color3.fromRGB(10, 10, 10),
  9. Buttons = Color3.fromRGB(255, 0, 0),
  10. Background = Color3.fromRGB(20, 20, 20),
  11. Container = Color3.fromRGB(10, 10, 10),
  12. ButtonsContainer = Color3.fromRGB(15, 15, 15),
  13. BackFrame = Color3.fromRGB(5, 5, 5),
  14. Scrollbar = Color3.fromRGB(0, 0, 0)
  15. },
  16. LightTheme = {
  17. Text = Color3.fromRGB(1, 1, 1),
  18. Menu = Color3.fromRGB(200, 200, 200),
  19. Buttons = Color3.fromRGB(175, 175, 175),
  20. Background = Color3.fromRGB(185, 185, 185),
  21. Container = Color3.fromRGB(155, 155, 155),
  22. ButtonsContainer = Color3.fromRGB(155, 155, 155),
  23. BackFrame = Color3.fromRGB(135, 135, 135),
  24. Scrollbar = Color3.fromRGB(255, 255, 255),
  25. }
  26. }
  27.  
  28. title = (title == nil) and "Title" or title
  29.  
  30. local uis = game:GetService("UserInputService")
  31.  
  32. local player = game.Players.LocalPlayer
  33. local mouse = player:GetMouse()
  34.  
  35.  
  36. -- Gui
  37. local ScreenGui = Instance.new("ScreenGui")
  38. local Menu = Instance.new("Frame")
  39. local Background = Instance.new("Frame")
  40. local SideContainer = Instance.new("ScrollingFrame")
  41. local UIGridLayout = Instance.new("UIGridLayout")
  42. local Frames = Instance.new("Frame")
  43. local Exit = Instance.new("TextButton")
  44. local Title = Instance.new("TextLabel")
  45.  
  46. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  47. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  48.  
  49. Menu.Name = "Menu"
  50. Menu.Parent = ScreenGui
  51. Menu.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  52. Menu.BorderSizePixel = 0
  53. Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  54. Menu.Size = UDim2.new(0, 450, 0, 15)
  55.  
  56. Background.Name = "Background"
  57. Background.Parent = Menu
  58. Background.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  59. Background.BorderSizePixel = 0
  60. Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  61. Background.Size = UDim2.new(0, 450, 0, 290)
  62.  
  63. SideContainer.Name = "SideContainer"
  64. SideContainer.Parent = Background
  65. SideContainer.Active = true
  66. SideContainer.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  67. SideContainer.BorderSizePixel = 0
  68. SideContainer.Size = UDim2.new(0, 120, 0, 290)
  69. SideContainer.ScrollBarThickness = 8
  70.  
  71. UIGridLayout.Parent = SideContainer
  72. UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  73. UIGridLayout.CellSize = UDim2.new(0, 120, 0, 35)
  74.  
  75. Frames.Name = "Frames"
  76. Frames.Parent = Background
  77. Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  78. Frames.BackgroundTransparency = 1.000
  79. Frames.BorderSizePixel = 0
  80. Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  81. Frames.Size = UDim2.new(0, 330, 0, 290)
  82.  
  83. Exit.Name = "Exit"
  84. Exit.Parent = Menu
  85. Exit.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  86. Exit.BorderSizePixel = 0
  87. Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  88. Exit.Size = UDim2.new(0, 15, 0, 15)
  89. Exit.Font = Enum.Font.Code
  90. Exit.Text = "X"
  91. Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  92. Exit.TextSize = 14.000
  93.  
  94. Title.Name = "Title"
  95. Title.Parent = Menu
  96. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  97. Title.BackgroundTransparency = 1.000
  98. Title.BorderSizePixel = 0
  99. Title.Size = UDim2.new(0, 435, 0, 15)
  100. Title.Font = Enum.Font.Code
  101. Title.Text = title
  102. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  103. Title.TextScaled = true
  104. Title.TextSize = 14.000
  105. Title.TextWrapped = true
  106.  
  107. -- Local functions
  108. local function createContainer()
  109. local Container = Instance.new("Frame")
  110. Container.Name = "Container"
  111. Container.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  112. Container.BorderSizePixel = 0
  113. Container.Size = UDim2.new(0, 100, 0, 100)
  114.  
  115. return Container
  116. end
  117. local function setDraggable()
  118. Menu.Active = true
  119. Menu.Draggable = true
  120. end
  121. local function exitButton()
  122. ScreenGui:Destroy()
  123. end
  124. local function hideFrames()
  125. for i,v in pairs(Frames:GetChildren()) do
  126. v.Visible = false
  127. end
  128. end
  129. -- Functions
  130. -- Color
  131. --[[
  132. function library:Color(args)
  133. for i,v in pairs(ScreenGui:GetDescendants()) do
  134. if v:IsA("TextButton")or v:IsA("TextLabel") then
  135. v.TextColor3 = args.Text
  136. elseif v:IsA("TextBox") then
  137. v.TextColor3 = args.Text
  138. v.PlaceholderColor3 = args.Text
  139. end
  140. if v.Name == "Menu" then
  141. v.BackgroundColor3 = args.Menu
  142. end
  143. if v:IsA("TextButton") then
  144. v.BackgroundColor3 = args.Buttons
  145. end
  146. if v.Name == "Background" then
  147. v.BackgroundColor3 = args.Background
  148. end
  149. if v.Name == "Container" then
  150. v.BackgroundColor3 = args.Container
  151. end
  152. if v.Name == "ButtonsContainer" then
  153. v.BackgroundColor3 = args.ButtonsContainer
  154. end
  155. if v:IsA("Frame") and v.Name == "Slider" or v.Name == "Toggle" or v:IsA("TextBox") then
  156. v.BackgroundColor3 = args.BackFrame
  157. end
  158. if v:IsA("ScrollingFrame") then
  159. v.ScrollBarImageColor3 = args.Scrollbar
  160. end
  161. end
  162. end
  163. ]]
  164.  
  165. -- SetTheme
  166. --[[
  167. function library:SetTheme(theme)
  168. if themes[theme] then
  169. library:Color(themes[theme])
  170. else
  171. library:Color(themes.LightTheme)
  172. end
  173. end
  174. ]]
  175. function library:Keybind(key, callback)
  176. uis.InputBegan:Connect(function(input, gameProcessedEvent)
  177. if gameProcessedEvent then
  178. return
  179. end
  180. if input.KeyCode == Enum.KeyCode[key] then
  181. callback()
  182. end
  183. end)
  184. end
  185. function library:ToggleVisibility(bool)
  186. Menu.Visible = bool
  187. end
  188.  
  189. local library2 = {}
  190.  
  191. function library2:NewTab(text)
  192. text = (text == nil) and "Tab" or text
  193.  
  194. local TextButton = Instance.new("TextButton")
  195. local ScrollingFrame = Instance.new("ScrollingFrame")
  196. local UIGridLayout_2 = Instance.new("UIGridLayout")
  197.  
  198. TextButton.Parent = SideContainer
  199. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  200. TextButton.BorderSizePixel = 0
  201. TextButton.Size = UDim2.new(0, 200, 0, 50)
  202. TextButton.Font = Enum.Font.SourceSans
  203. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  204. TextButton.TextSize = 14.000
  205. TextButton.Text = text
  206.  
  207. ScrollingFrame.Parent = Frames
  208. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  209. ScrollingFrame.BackgroundTransparency = 1.000
  210. ScrollingFrame.BorderSizePixel = 0
  211. ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  212. ScrollingFrame.ScrollBarThickness = 8
  213. ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  214. ScrollingFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y
  215.  
  216. UIGridLayout_2.Parent = ScrollingFrame
  217. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  218. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  219. UIGridLayout_2.CellPadding = UDim2.new(0, 5, 0, 0)
  220.  
  221. hideFrames()
  222. ScrollingFrame.Visible = true
  223.  
  224. TextButton.MouseButton1Down:Connect(function()
  225. hideFrames()
  226.  
  227. ScrollingFrame.Visible = true
  228. end)
  229.  
  230. local library3 = {}
  231.  
  232. function library3:NewSection(text)
  233. text = (text == nil) and "Section" or text
  234.  
  235. local function getSize()
  236. local s = 0
  237. local a = 0
  238.  
  239. local childrenInFrame = ScrollingFrame:GetChildren()
  240.  
  241. for i, v in pairs(childrenInFrame) do
  242. if v.Name == "Section" then
  243. for i_, v_ in pairs(v:GetChildren()) do
  244. if v_:IsA("Frame") then
  245. local gridLayoutSize = v.UIGridLayout.CellSize.Y.Offset
  246.  
  247. --if not v_:IsA("UIGridLayout") then
  248. a += 1
  249. print(a, gridLayoutSize)
  250.  
  251. s += gridLayoutSize * a
  252. --end
  253. end
  254. end
  255. end
  256. end
  257.  
  258. return s
  259. end
  260. print(getSize())
  261. local Section = Instance.new("Frame")
  262. local UIGridLayout_2 = Instance.new("UIGridLayout")
  263. local SectionText = Instance.new("TextLabel")
  264. local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
  265. local SectionDropdown = Instance.new("TextButton")
  266.  
  267. Section.Name = "Section"
  268. Section.Parent = ScrollingFrame
  269. Section.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  270. Section.BorderSizePixel = 0
  271. Section.Size = UDim2.new(0, 330, 0, 50)
  272. --Section.Position += #ScrollingFrame:GetChildren() > 1 and UDim2.new(0, 0, 0, getSize()) or UDim2.new(0, 0, 0, 0)
  273.  
  274. UIGridLayout_2.Parent = Section
  275. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  276. UIGridLayout_2.CellPadding = UDim2.new(0, 5, 0, 0)
  277. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  278.  
  279. SectionText.Name = "SectionText"
  280. SectionText.Parent = Section
  281. SectionText.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  282. SectionText.BorderSizePixel = 0
  283. SectionText.Size = UDim2.new(0, 200, 0, 50)
  284. SectionText.Font = Enum.Font.Code
  285. SectionText.Text = text
  286. SectionText.TextColor3 = Color3.fromRGB(255, 255, 255)
  287. SectionText.TextSize = 25.000
  288.  
  289. UIAspectRatioConstraint.Parent = SectionText
  290. UIAspectRatioConstraint.AspectRatio = 10.000
  291.  
  292. SectionDropdown.Name = "SectionDropdown"
  293. SectionDropdown.Parent = SectionText
  294. SectionDropdown.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  295. SectionDropdown.BackgroundTransparency = 1.000
  296. SectionDropdown.Position = UDim2.new(0, 0, -0.257575303, 0)
  297. SectionDropdown.Size = UDim2.new(0, 62, 0, 50)
  298. SectionDropdown.Font = Enum.Font.SourceSans
  299. SectionDropdown.Text = "⛛"
  300. SectionDropdown.TextColor3 = Color3.fromRGB(255, 255, 255)
  301. SectionDropdown.TextSize = 35.000
  302.  
  303. SectionDropdown.MouseButton1Down:Connect(function()
  304. for i,v in pairs(Section:GetChildren()) do
  305. if v:IsA("Frame") then
  306. v.Visible = not v.Visible
  307. end
  308. end
  309. end)
  310.  
  311. local library4 = {}
  312.  
  313. function library4:NewButton(text, callback)
  314. text = (text == nil) and "Button" or text
  315.  
  316. local TextButton = Instance.new("TextButton")
  317. local Container = createContainer()
  318.  
  319. --Container.Parent = Section
  320. Container.Parent = ScrollingFrame
  321.  
  322. TextButton.Parent = Container
  323. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  324. TextButton.BorderSizePixel = 0
  325. TextButton.Position = UDim2.new(0.021, 0, 0.12, 0)
  326. TextButton.Size = UDim2.new(0, 308, 0, 37)
  327. TextButton.Font = Enum.Font.Code
  328. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  329. TextButton.TextSize = 14.000
  330. TextButton.Text = text
  331.  
  332. if type(callback) == "function" then
  333. TextButton.MouseButton1Down:Connect(callback)
  334. end
  335. end
  336. function library4:NewTextBox(text, callback)
  337. text = (text == nil) and "Placeholder" or text
  338.  
  339. local Container = createContainer()
  340.  
  341. --Container.Parent = Section
  342. Container.Parent = ScrollingFrame
  343.  
  344. local TextBox = Instance.new("TextBox")
  345. TextBox.Parent = Container
  346. TextBox.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  347. TextBox.Position = UDim2.new(0.021, 0, 0.12, 0)
  348. TextBox.Size = UDim2.new(0, 308, 0, 37)
  349. TextBox.BorderSizePixel = 0
  350. TextBox.Font = Enum.Font.SourceSans
  351. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  352. TextBox.TextSize = 14.000
  353. TextBox.PlaceholderText = text
  354. TextBox.Text = text
  355.  
  356. if type(callback) == "function" then
  357. TextBox.FocusLost:Connect(function()
  358. callback(TextBox.Text)
  359. end)
  360. end
  361. end
  362. function library4:NewSlider(text, min, max, callback)
  363. text = (text == nil) and "Slider" or text
  364. min = min == nil and 0 or min
  365. max = max == nil and 10 or max
  366.  
  367. local holding = false
  368. local val = 0
  369.  
  370. local Slider = Instance.new("Frame")
  371. local TextButton_2 = Instance.new("TextButton")
  372. local UICorner = Instance.new("UICorner")
  373. local TextLabel = Instance.new("TextLabel")
  374. local TextLabel_2 = Instance.new("TextLabel")
  375. local UICorner_2 = Instance.new("UICorner")
  376. local Container = createContainer()
  377.  
  378. --Container.Parent = Section
  379. Container.Parent = ScrollingFrame
  380.  
  381. Slider.Name = "Slider"
  382. Slider.Parent = Container
  383. Slider.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  384. Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  385. Slider.Size = UDim2.new(0, 228, 0, 12)
  386.  
  387. TextButton_2.Parent = Slider
  388. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  389. TextButton_2.BorderSizePixel = 0
  390. TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  391. TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  392. TextButton_2.Font = Enum.Font.Code
  393. TextButton_2.Text = ""
  394. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  395. TextButton_2.TextSize = 14.000
  396.  
  397. UICorner.CornerRadius = UDim.new(8, 0)
  398. UICorner.Parent = TextButton_2
  399.  
  400. TextLabel.Parent = Slider
  401. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  402. TextLabel.BackgroundTransparency = 1.000
  403. TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  404. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  405. TextLabel.Font = Enum.Font.Code
  406. TextLabel.Text = text
  407. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  408. TextLabel.TextSize = 14.000
  409.  
  410. TextLabel_2.Parent = Slider
  411. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  412. TextLabel_2.BackgroundTransparency = 1.000
  413. TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  414. TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  415. TextLabel_2.Font = Enum.Font.Code
  416. TextLabel_2.Text = "0"
  417. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  418. TextLabel_2.TextSize = 14.000
  419.  
  420. UICorner_2.CornerRadius = UDim.new(16, 0)
  421. UICorner_2.Parent = Slider
  422.  
  423. TextButton_2.MouseButton1Down:Connect(function()
  424. holding = true
  425. while holding do
  426. local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  427. local clampedX = math.clamp(xLocation, 0, 1)
  428.  
  429. val = math.ceil( min + (clampedX * (max-min)) )
  430.  
  431. TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  432. TextLabel_2.Text = tostring(val)
  433.  
  434. if type(callback) == "function" then
  435. callback(val)
  436. end
  437. wait()
  438. end
  439. end)
  440. TextButton_2.MouseButton1Up:Connect(function()
  441. holding = false
  442. end)
  443. mouse.Button1Up:Connect(function()
  444. holding = false
  445. end)
  446. end
  447. function library4:NewToggle(text, callback)
  448. text = (text == nil) and "Toggle" or text
  449.  
  450. local toggled = false
  451. local debounce = false
  452.  
  453. local Frame = Instance.new("Frame")
  454. local UICorner = Instance.new("UICorner")
  455. local TextLabel = Instance.new("TextLabel")
  456. local TextButton_2 = Instance.new("TextButton")
  457. local UICorner_2 = Instance.new("UICorner")
  458. local Container = createContainer()
  459.  
  460. --Container.Parent = Section
  461. Container.Parent = ScrollingFrame
  462.  
  463. Frame.Parent = Container
  464. Frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  465. Frame.Position = UDim2.new(0.399999976, 0, 0.439999998, 0)
  466. Frame.Size = UDim2.new(0, 50, 0, 20)
  467. Frame.Name = "Toggle"
  468.  
  469. UICorner.CornerRadius = UDim.new(16, 0)
  470. UICorner.Parent = Frame
  471.  
  472. TextLabel.Parent = Frame
  473. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  474. TextLabel.BackgroundTransparency = 1.000
  475. TextLabel.Position = UDim2.new(-1.51859653, 0, -1.10000002, 0)
  476. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  477. TextLabel.Font = Enum.Font.Code
  478. TextLabel.Text = text
  479. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  480. TextLabel.TextSize = 14.000
  481.  
  482. TextButton_2.Parent = Frame
  483. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  484. TextButton_2.Position = UDim2.new(0, 0, 2.98023224e-08, 0)
  485. TextButton_2.Size = UDim2.new(0, 20, 0, 20)
  486. TextButton_2.Font = Enum.Font.SourceSans
  487. TextButton_2.Text = ""
  488. TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  489. TextButton_2.TextSize = 14.000
  490. TextButton_2.Name = "ToggleButton"
  491.  
  492. UICorner_2.CornerRadius = UDim.new(16, 0)
  493. UICorner_2.Parent = TextButton_2
  494.  
  495. TextButton_2.MouseButton1Down:Connect(function()
  496. if debounce == false then
  497. debounce = true
  498.  
  499. toggled = not toggled
  500.  
  501. local color = toggled == true and Color3.fromRGB(255, 255, 0) or Color3.fromRGB(255, 0, 0)
  502. local position = toggled == true and UDim2.new(0.6, 0, 0, 0) or UDim2.new(0, 0, 0, 0)
  503.  
  504. TextButton_2:TweenPosition(position)
  505. TextButton_2.BackgroundColor3 = color
  506.  
  507. if type(callback) == "function" then
  508. callback(toggled)
  509. end
  510.  
  511. task.wait(1)
  512. debounce = false
  513. end
  514. end)
  515. end
  516. function library4:__Con() -- for me i test container thingy idk
  517. if player.UserId == 2859647882 then
  518. local __C=createContainer()
  519. __C.Parent=ScrollingFrame
  520. else
  521. error("")
  522. end
  523. end
  524. return library4
  525. end
  526. return library3
  527. end
  528.  
  529.  
  530. -- Call functions
  531. setDraggable()
  532. Exit.MouseButton1Click:Connect(exitButton)
  533.  
  534. return library2
  535. end
  536.  
  537. return library
  538.  
  539. -- library:NewWindow(string: title):NewTab(string: text): NewSection:(string: title): NewButton(string: text, funciton: callback)
  540. -- Color(dictionary: color) NewSlider(string: text, number: min, number: max, function: callback)
  541. -- Keybind(string: key) NewTextBox(string: placeholderText, function: callback)
  542. -- SetTheme(string: theme) NewToggle(string: text, function: callback)
  543. -- ToggleVisibility(boolean: visible) __Con()
  544.  
  545. --[[
  546. Help
  547.  
  548. - to get the library
  549. - library variable - local library = loadstring(game:HttpGet("https://pastebin.com/raw/dCLesXN2))()
  550.  
  551. - to create a window
  552. - local window = library:NewWindow(title)
  553.  
  554. - to create a tab
  555. - local tab = window:NewTab(text)
  556.  
  557. - to create a section
  558. - local section = tab:NewSection(title)
  559.  
  560. - put button variables and other under the new section example:
  561. - local section1 = tab:NewSection(title)
  562. - local button1 = section1:NewButton(text, callback)
  563. -
  564. - local section2 = tab:NewSection(title)
  565. - local button2 = section2:NewButton(text, callback)
  566.  
  567. me suck at explainging aaasdiaojhfu9awwfgbhiae
  568. ]]
Advertisement
Add Comment
Please, Sign In to add comment