joefromsansnite

Untitled

Oct 3rd, 2021
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.53 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4. local themes = {
  5. BloodTheme = {
  6. Text = Color3.fromRGB(255, 255, 255),
  7. Menu = Color3.fromRGB(10, 10, 10),
  8. Buttons = Color3.fromRGB(255, 0, 0),
  9. Background = Color3.fromRGB(20, 20, 20),
  10. UIHolder = Color3.fromRGB(10, 10, 10),
  11. TextBox = Color3.fromRGB(255, 0, 0),
  12. Slider = Color3.fromRGB(5, 5, 5),
  13. Scrollbar = Color3.fromRGB(0, 0, 0)
  14. },
  15. LightTheme = {
  16. Text = Color3.fromRGB(1, 1, 1),
  17. Menu = Color3.fromRGB(200, 200, 200),
  18. Buttons = Color3.fromRGB(175, 175, 175),
  19. Background = Color3.fromRGB(185, 185, 185),
  20. UIHolder = Color3.fromRGB(155, 155, 155),
  21. TextBox = Color3.fromRGB(175, 175, 175),
  22. Slider = Color3.fromRGB(135, 135, 135),
  23. Scrollbar = Color3.fromRGB(255, 255, 255)
  24. }
  25. }
  26. local uis = game:GetService("UserInputService")
  27.  
  28. local player = game.Players.LocalPlayer
  29. local mouse = player:GetMouse()
  30.  
  31. local ScreenGui = Instance.new("ScreenGui")
  32. local Menu = Instance.new("Frame")
  33. local Background = Instance.new("Frame")
  34. local SideButtons = Instance.new("ScrollingFrame")
  35. local Frames = Instance.new("Frame")
  36. local Exit = Instance.new("TextButton")
  37. local Title = Instance.new("TextLabel")
  38. local UIGridLayout = Instance.new("UIGridLayout")
  39.  
  40. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  41. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  42.  
  43. Menu.Name = "Menu"
  44. Menu.Parent = ScreenGui
  45. Menu.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  46. Menu.BorderSizePixel = 0
  47. Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  48. Menu.Size = UDim2.new(0, 450, 0, 15)
  49.  
  50. Background.Name = "Background"
  51. Background.Parent = Menu
  52. Background.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  53. Background.BorderSizePixel = 0
  54. Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  55. Background.Size = UDim2.new(0, 450, 0, 290)
  56.  
  57. Frames.Name = "Frames"
  58. Frames.Parent = Background
  59. Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  60. Frames.BackgroundTransparency = 1.000
  61. Frames.BorderSizePixel = 0
  62. Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  63. Frames.Size = UDim2.new(0, 330, 0, 290)
  64.  
  65. SideButtons.Name = "SideButtons"
  66. SideButtons.Parent = Background
  67. SideButtons.Active = true
  68. SideButtons.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  69. SideButtons.BorderSizePixel = 0
  70. SideButtons.Size = UDim2.new(0, 120, 0, 290)
  71. SideButtons.ScrollBarThickness = 8
  72. SideButtons.BackgroundTransparency = 1
  73. SideButtons.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  74.  
  75. UIGridLayout.Parent = SideButtons
  76. UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  77. UIGridLayout.CellSize = UDim2.new(0, 120, 0, 35)
  78.  
  79. Exit.Name = "Exit"
  80. Exit.Parent = Menu
  81. Exit.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  82. Exit.BorderSizePixel = 0
  83. Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  84. Exit.Size = UDim2.new(0, 15, 0, 15)
  85. Exit.Font = Enum.Font.Code
  86. Exit.Text = "X"
  87. Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  88. Exit.TextSize = 14.000
  89.  
  90. Title.Name = "Title"
  91. Title.Parent = Menu
  92. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  93. Title.BackgroundTransparency = 1.000
  94. Title.BorderSizePixel = 0
  95. Title.Size = UDim2.new(0, 435, 0, 15)
  96. Title.Font = Enum.Font.Code
  97. Title.Text = title
  98. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  99. Title.TextScaled = true
  100. Title.TextSize = 14.000
  101. Title.TextWrapped = true
  102.  
  103. function library:Color(args)
  104. for i,v in pairs(ScreenGui:GetDescendants()) do
  105. if v:IsA("TextButton")or v:IsA("TextLabel") then
  106. v.TextColor3 = args.Text
  107. elseif v:IsA("TextBox") then
  108. v.TextColor3 = args.Text
  109. v.PlaceholderColor3 = args.Text
  110. end
  111. if v.Name == "Menu" then
  112. v.BackgroundColor3 = args.Menu
  113. end
  114. if v:IsA("TextButton") then
  115. v.BackgroundColor3 = args.Buttons
  116. end
  117. if v.Name == "Background" then
  118. v.BackgroundColor3 = args.Background
  119. end
  120. if v.Name == "UIHolder" then
  121. v.BackgroundColor3 = args.UIHolder
  122. end
  123. if v:IsA("TextBox") then
  124. v.BackgroundColor3 = args.TextBox
  125. end
  126. if v.Name == "Slider" then
  127. v.BackgroundColor3 = args.Slider
  128. end
  129. if v:IsA("ScrollingFrame") then
  130. v.ScrollBarImageColor3 = args.Scrollbar
  131. end
  132. end
  133. end
  134. function library:Keybind(key, callback)
  135. uis.InputBegan:Connect(function(input, gameProcessedEvent)
  136. if input.KeyCode == Enum.KeyCode[key] then
  137. callback()
  138. end
  139. end)
  140. end
  141. function library:ToggleVisibility(bool)
  142. Menu.Visible = bool
  143. end
  144. function library:SetTheme(theme)
  145. if themes[theme] then
  146. library:Color(themes[theme])
  147. else
  148. library:Color(themes.LightTheme)
  149. end
  150. end
  151.  
  152. local library2 = {}
  153.  
  154. function library2:NewTab(text)
  155. local TextButton = Instance.new("TextButton")
  156. local ScrollingFrame = Instance.new("ScrollingFrame")
  157. local UIGridLayout_2 = Instance.new("UIGridLayout")
  158.  
  159. TextButton.Parent = SideButtons
  160. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  161. TextButton.BorderSizePixel = 0
  162. TextButton.Size = UDim2.new(0, 200, 0, 50)
  163. TextButton.Font = Enum.Font.SourceSans
  164. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  165. TextButton.TextSize = 14.000
  166. TextButton.Text = text
  167.  
  168. ScrollingFrame.Parent = Frames
  169. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  170. ScrollingFrame.BackgroundTransparency = 1.000
  171. ScrollingFrame.BorderSizePixel = 0
  172. ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  173. ScrollingFrame.ScrollBarThickness = 8
  174. ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  175.  
  176. UIGridLayout_2.Parent = ScrollingFrame
  177. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  178. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  179.  
  180. local function hideFrames()
  181. for i,v in pairs(Frames:GetChildren()) do
  182. v.Visible = false
  183. end
  184. end
  185.  
  186. hideFrames()
  187.  
  188. ScrollingFrame.Visible = true
  189.  
  190. TextButton.MouseButton1Down:Connect(function()
  191. hideFrames()
  192.  
  193. ScrollingFrame.Visible = true
  194. end)
  195.  
  196. local library3 = {}
  197.  
  198. function library3:NewButton(text, callback)
  199. local UIHolder = Instance.new("Frame")
  200. local TextButton = Instance.new("TextButton")
  201. local UIGridLayout_2 = Instance.new("UIGridLayout")
  202.  
  203. UIGridLayout_2.Parent = ScrollingFrame
  204. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  205. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  206.  
  207. UIHolder.Name = "UIHolder"
  208. UIHolder.Parent = ScrollingFrame
  209. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  210. UIHolder.BorderSizePixel = 0
  211. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  212.  
  213. TextButton.Parent = UIHolder
  214. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  215. TextButton.BorderSizePixel = 0
  216. TextButton.Position = UDim2.new(0.021, 0, 0.12, 0)
  217. TextButton.Size = UDim2.new(0, 308, 0, 37)
  218. TextButton.Font = Enum.Font.Code
  219. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  220. TextButton.TextSize = 14.000
  221. TextButton.Text = text
  222.  
  223. if type(callback) == "function" then
  224. TextButton.MouseButton1Down:Connect(callback)
  225. end
  226. end
  227. function library3:NewTextBox(text, callback)
  228. local UIHolder = Instance.new("Frame")
  229. local UIGridLayout_2 = Instance.new("UIGridLayout")
  230.  
  231. UIGridLayout_2.Parent = ScrollingFrame
  232. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  233. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  234.  
  235. UIHolder.Name = "UIHolder"
  236. UIHolder.Parent = ScrollingFrame
  237. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  238. UIHolder.BorderSizePixel = 0
  239. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  240.  
  241. local TextBox = Instance.new("TextBox")
  242. TextBox.Parent = UIHolder
  243. TextBox.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  244. TextBox.Position = UDim2.new(0.021, 0, 0.12, 0)
  245. TextBox.Size = UDim2.new(0, 308, 0, 37)
  246. TextBox.BorderSizePixel = 0
  247. TextBox.Font = Enum.Font.SourceSans
  248. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  249. TextBox.TextSize = 14.000
  250. TextBox.PlaceholderText = text
  251.  
  252. if type(callback) == "function" then
  253. TextBox.FocusLost:Connect(function()
  254. callback(TextBox.Text)
  255. end)
  256. end
  257. end
  258.  
  259. function library3:NewSlider(text, min, max, callback)
  260. local holding = false
  261. local val = 0
  262.  
  263. local Slider = Instance.new("Frame")
  264. local TextButton_2 = Instance.new("TextButton")
  265. local UICorner = Instance.new("UICorner")
  266. local TextLabel = Instance.new("TextLabel")
  267. local TextLabel_2 = Instance.new("TextLabel")
  268. local UICorner_2 = Instance.new("UICorner")
  269. local UIHolder = Instance.new("Frame")
  270. local UIGridLayout_2 = Instance.new("UIGridLayout")
  271.  
  272. UIGridLayout_2.Parent = ScrollingFrame
  273. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  274. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  275.  
  276. UIHolder.Name = "UIHolder"
  277. UIHolder.Parent = ScrollingFrame
  278. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  279. UIHolder.BorderSizePixel = 0
  280. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  281.  
  282. Slider.Name = "Slider"
  283. Slider.Parent = UIHolder
  284. Slider.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  285. Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  286. Slider.Size = UDim2.new(0, 228, 0, 12)
  287.  
  288. TextButton_2.Parent = Slider
  289. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  290. TextButton_2.BorderSizePixel = 0
  291. TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  292. TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  293. TextButton_2.Font = Enum.Font.Code
  294. TextButton_2.Text = ""
  295. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  296. TextButton_2.TextSize = 14.000
  297.  
  298. UICorner.CornerRadius = UDim.new(8, 0)
  299. UICorner.Parent = TextButton_2
  300.  
  301. TextLabel.Parent = Slider
  302. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  303. TextLabel.BackgroundTransparency = 1.000
  304. TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  305. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  306. TextLabel.Font = Enum.Font.Code
  307. TextLabel.Text = text
  308. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  309. TextLabel.TextSize = 14.000
  310.  
  311. TextLabel_2.Parent = Slider
  312. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  313. TextLabel_2.BackgroundTransparency = 1.000
  314. TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  315. TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  316. TextLabel_2.Font = Enum.Font.Code
  317. TextLabel_2.Text = "0"
  318. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  319. TextLabel_2.TextSize = 14.000
  320.  
  321. UICorner_2.CornerRadius = UDim.new(16, 0)
  322. UICorner_2.Parent = Slider
  323.  
  324. TextButton_2.MouseButton1Down:Connect(function()
  325. holding = true
  326. while holding do
  327. local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  328. local clampedX = math.clamp(xLocation, 0, 1)
  329.  
  330. val = math.ceil( min + (clampedX * (max-min)) )
  331.  
  332. TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  333. TextLabel_2.Text = tostring(val)
  334.  
  335. callback(val)
  336. wait()
  337. end
  338. end)
  339. TextButton_2.MouseButton1Up:Connect(function()
  340. holding = false
  341. end)
  342. mouse.Button1Up:Connect(function()
  343. holding = false
  344. end)
  345. end
  346. return library3
  347. end
  348.  
  349. local function setDraggable()
  350. Menu.Active = true
  351. Menu.Draggable = true
  352. end
  353.  
  354. local function exitButton()
  355. ScreenGui:Destroy()
  356. end
  357.  
  358. setDraggable()
  359. Exit.MouseButton1Click:Connect(exitButton)
  360.  
  361. return library2
  362. end
  363.  
  364. return library
  365.  
  366. -- Library:NewWindow(title):NewTab(text): NewButton(text, callback)
  367. -- NewTextBox(defaultText, callback)
  368. -- NewSlider(text, min, max, callback)
Advertisement
Add Comment
Please, Sign In to add comment