Advertisement
joefromsansnite

Untitled

Oct 3rd, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.58 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 gameProcessedEvent then
  137. return
  138. end
  139. if input.KeyCode == Enum.KeyCode[key] then
  140. callback()
  141. end
  142. end)
  143. end
  144. function library:ToggleVisibility(bool)
  145. Menu.Visible = bool
  146. end
  147. function library:SetTheme(theme)
  148. if themes[theme] then
  149. library:Color(themes[theme])
  150. else
  151. library:Color(themes.LightTheme)
  152. end
  153. end
  154.  
  155. local library2 = {}
  156.  
  157. function library2:NewTab(text)
  158. local TextButton = Instance.new("TextButton")
  159. local ScrollingFrame = Instance.new("ScrollingFrame")
  160. local UIGridLayout_2 = Instance.new("UIGridLayout")
  161.  
  162. TextButton.Parent = SideButtons
  163. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  164. TextButton.BorderSizePixel = 0
  165. TextButton.Size = UDim2.new(0, 200, 0, 50)
  166. TextButton.Font = Enum.Font.SourceSans
  167. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  168. TextButton.TextSize = 14.000
  169. TextButton.Text = text
  170.  
  171. ScrollingFrame.Parent = Frames
  172. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  173. ScrollingFrame.BackgroundTransparency = 1.000
  174. ScrollingFrame.BorderSizePixel = 0
  175. ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  176. ScrollingFrame.ScrollBarThickness = 8
  177. ScrollingFrame.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  178.  
  179. UIGridLayout_2.Parent = ScrollingFrame
  180. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  181. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  182.  
  183. local function hideFrames()
  184. for i,v in pairs(Frames:GetChildren()) do
  185. v.Visible = false
  186. end
  187. end
  188.  
  189. hideFrames()
  190.  
  191. ScrollingFrame.Visible = true
  192.  
  193. TextButton.MouseButton1Down:Connect(function()
  194. hideFrames()
  195.  
  196. ScrollingFrame.Visible = true
  197. end)
  198.  
  199. local library3 = {}
  200.  
  201. function library3:NewButton(text, callback)
  202. local UIHolder = Instance.new("Frame")
  203. local TextButton = Instance.new("TextButton")
  204. local UIGridLayout_2 = Instance.new("UIGridLayout")
  205.  
  206. UIGridLayout_2.Parent = ScrollingFrame
  207. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  208. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  209.  
  210. UIHolder.Name = "UIHolder"
  211. UIHolder.Parent = ScrollingFrame
  212. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  213. UIHolder.BorderSizePixel = 0
  214. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  215.  
  216. TextButton.Parent = UIHolder
  217. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  218. TextButton.BorderSizePixel = 0
  219. TextButton.Position = UDim2.new(0.021, 0, 0.12, 0)
  220. TextButton.Size = UDim2.new(0, 308, 0, 37)
  221. TextButton.Font = Enum.Font.Code
  222. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  223. TextButton.TextSize = 14.000
  224. TextButton.Text = text
  225.  
  226. if type(callback) == "function" then
  227. TextButton.MouseButton1Down:Connect(callback)
  228. end
  229. end
  230. function library3:NewTextBox(text, callback)
  231. local UIHolder = Instance.new("Frame")
  232. local UIGridLayout_2 = Instance.new("UIGridLayout")
  233.  
  234. UIGridLayout_2.Parent = ScrollingFrame
  235. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  236. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  237.  
  238. UIHolder.Name = "UIHolder"
  239. UIHolder.Parent = ScrollingFrame
  240. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  241. UIHolder.BorderSizePixel = 0
  242. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  243.  
  244. local TextBox = Instance.new("TextBox")
  245. TextBox.Parent = UIHolder
  246. TextBox.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  247. TextBox.Position = UDim2.new(0.021, 0, 0.12, 0)
  248. TextBox.Size = UDim2.new(0, 308, 0, 37)
  249. TextBox.BorderSizePixel = 0
  250. TextBox.Font = Enum.Font.SourceSans
  251. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  252. TextBox.TextSize = 14.000
  253. TextBox.PlaceholderText = text
  254.  
  255. if type(callback) == "function" then
  256. TextBox.FocusLost:Connect(function()
  257. callback(TextBox.Text)
  258. end)
  259. end
  260. end
  261.  
  262. function library3:NewSlider(text, min, max, callback)
  263. local holding = false
  264. local val = 0
  265.  
  266. local Slider = Instance.new("Frame")
  267. local TextButton_2 = Instance.new("TextButton")
  268. local UICorner = Instance.new("UICorner")
  269. local TextLabel = Instance.new("TextLabel")
  270. local TextLabel_2 = Instance.new("TextLabel")
  271. local UICorner_2 = Instance.new("UICorner")
  272. local UIHolder = Instance.new("Frame")
  273. local UIGridLayout_2 = Instance.new("UIGridLayout")
  274.  
  275. UIGridLayout_2.Parent = ScrollingFrame
  276. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  277. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  278.  
  279. UIHolder.Name = "UIHolder"
  280. UIHolder.Parent = ScrollingFrame
  281. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  282. UIHolder.BorderSizePixel = 0
  283. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  284.  
  285. Slider.Name = "Slider"
  286. Slider.Parent = UIHolder
  287. Slider.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  288. Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  289. Slider.Size = UDim2.new(0, 228, 0, 12)
  290.  
  291. TextButton_2.Parent = Slider
  292. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  293. TextButton_2.BorderSizePixel = 0
  294. TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  295. TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  296. TextButton_2.Font = Enum.Font.Code
  297. TextButton_2.Text = ""
  298. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  299. TextButton_2.TextSize = 14.000
  300.  
  301. UICorner.CornerRadius = UDim.new(8, 0)
  302. UICorner.Parent = TextButton_2
  303.  
  304. TextLabel.Parent = Slider
  305. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  306. TextLabel.BackgroundTransparency = 1.000
  307. TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  308. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  309. TextLabel.Font = Enum.Font.Code
  310. TextLabel.Text = text
  311. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  312. TextLabel.TextSize = 14.000
  313.  
  314. TextLabel_2.Parent = Slider
  315. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  316. TextLabel_2.BackgroundTransparency = 1.000
  317. TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  318. TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  319. TextLabel_2.Font = Enum.Font.Code
  320. TextLabel_2.Text = "0"
  321. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  322. TextLabel_2.TextSize = 14.000
  323.  
  324. UICorner_2.CornerRadius = UDim.new(16, 0)
  325. UICorner_2.Parent = Slider
  326.  
  327. TextButton_2.MouseButton1Down:Connect(function()
  328. holding = true
  329. while holding do
  330. local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  331. local clampedX = math.clamp(xLocation, 0, 1)
  332.  
  333. val = math.ceil( min + (clampedX * (max-min)) )
  334.  
  335. TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  336. TextLabel_2.Text = tostring(val)
  337.  
  338. callback(val)
  339. wait()
  340. end
  341. end)
  342. TextButton_2.MouseButton1Up:Connect(function()
  343. holding = false
  344. end)
  345. mouse.Button1Up:Connect(function()
  346. holding = false
  347. end)
  348. end
  349. return library3
  350. end
  351.  
  352. local function setDraggable()
  353. Menu.Active = true
  354. Menu.Draggable = true
  355. end
  356.  
  357. local function exitButton()
  358. ScreenGui:Destroy()
  359. end
  360.  
  361. setDraggable()
  362. Exit.MouseButton1Click:Connect(exitButton)
  363.  
  364. return library2
  365. end
  366.  
  367. return library
  368.  
  369. -- Library:NewWindow(title):NewTab(text): NewButton(text, callback)
  370. -- NewTextBox(defaultText, callback)
  371. -- NewSlider(text, min, max, callback)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement