Advertisement
joefromsansnite

Untitled

Oct 1st, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.11 KB | None | 0 0
  1. local library = {}
  2.  
  3. function library:NewWindow(title)
  4. local uis = game:GetService("UserInputService")
  5.  
  6. local player = game.Players.LocalPlayer
  7. local mouse = player:GetMouse()
  8.  
  9. local ScreenGui = Instance.new("ScreenGui")
  10. local Menu = Instance.new("Frame")
  11. local Background = Instance.new("Frame")
  12. local SideButtons = Instance.new("ScrollingFrame")
  13. local UIGridLayout = Instance.new("UIGridLayout")
  14. local Frames = Instance.new("Frame")
  15. local Exit = Instance.new("TextButton")
  16. local Title = Instance.new("TextLabel")
  17.  
  18. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  19. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  20.  
  21. Menu.Name = "Menu"
  22. Menu.Parent = ScreenGui
  23. Menu.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  24. Menu.BorderSizePixel = 0
  25. Menu.Position = UDim2.new(0.265135705, 0, 0.329052985, 0)
  26. Menu.Size = UDim2.new(0, 450, 0, 15)
  27.  
  28. Background.Name = "Background"
  29. Background.Parent = Menu
  30. Background.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  31. Background.BorderSizePixel = 0
  32. Background.Position = UDim2.new(0, 0, 0.999998987, 0)
  33. Background.Size = UDim2.new(0, 450, 0, 290)
  34.  
  35. SideButtons.Name = "SideButtons"
  36. SideButtons.Parent = Background
  37. SideButtons.Active = true
  38. SideButtons.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  39. SideButtons.BorderSizePixel = 0
  40. SideButtons.Size = UDim2.new(0, 120, 0, 290)
  41.  
  42. UIGridLayout.Parent = SideButtons
  43. UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
  44. UIGridLayout.CellSize = UDim2.new(0, 120, 0, 35)
  45.  
  46. Frames.Name = "Frames"
  47. Frames.Parent = Background
  48. Frames.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  49. Frames.BackgroundTransparency = 1.000
  50. Frames.BorderSizePixel = 0
  51. Frames.Position = UDim2.new(0.266666681, 0, 0, 0)
  52. Frames.Size = UDim2.new(0, 330, 0, 290)
  53.  
  54. Exit.Name = "Exit"
  55. Exit.Parent = Menu
  56. Exit.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  57. Exit.BorderSizePixel = 0
  58. Exit.Position = UDim2.new(0.967000008, 0, 0, 0)
  59. Exit.Size = UDim2.new(0, 15, 0, 15)
  60. Exit.Font = Enum.Font.SourceSans
  61. Exit.Text = "X"
  62. Exit.TextColor3 = Color3.fromRGB(255, 255, 255)
  63. Exit.TextSize = 14.000
  64.  
  65. Title.Name = "Title"
  66. Title.Parent = Menu
  67. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  68. Title.BackgroundTransparency = 1.000
  69. Title.BorderSizePixel = 0
  70. Title.Size = UDim2.new(0, 435, 0, 15)
  71. Title.Font = Enum.Font.SourceSans
  72. Title.Text = title
  73. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  74. Title.TextSize = 14.000
  75.  
  76. local library2 = {}
  77.  
  78. function library2:NewTab(text)
  79. local TextButton = Instance.new("TextButton")
  80. local ScrollingFrame = Instance.new("ScrollingFrame")
  81. local UIGridLayout_2 = Instance.new("UIGridLayout")
  82.  
  83. TextButton.Parent = SideButtons
  84. TextButton.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  85. TextButton.BorderSizePixel = 0
  86. TextButton.Size = UDim2.new(0, 200, 0, 50)
  87. TextButton.Font = Enum.Font.SourceSans
  88. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  89. TextButton.TextSize = 14.000
  90. TextButton.Text = text
  91.  
  92. ScrollingFrame.Parent = Frames
  93. ScrollingFrame.Active = true
  94. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(60, 50, 50)
  95. ScrollingFrame.BorderSizePixel = 0
  96. ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  97.  
  98. UIGridLayout_2.Parent = ScrollingFrame
  99. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  100. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  101.  
  102. TextButton.MouseButton1Down:Connect(function()
  103. for i,v in pairs(Frames:GetChildren()) do
  104. v.Visible = false
  105. end
  106.  
  107. ScrollingFrame.Visible = true
  108. end)
  109.  
  110. local library3 = {}
  111.  
  112. function library3:NewButton(text, callback)
  113. local UIHolder = Instance.new("Frame")
  114.  
  115. UIHolder.Name = "UIHolder"
  116. UIHolder.Parent = ScrollingFrame
  117. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  118. UIHolder.BorderSizePixel = 0
  119. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  120.  
  121. local TextButton_2 = Instance.new("TextButton")
  122. TextButton_2.Parent = UIHolder
  123. TextButton_2.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  124. TextButton_2.Position = UDim2.new(0.0199999996, 0, 0.100000001, 0)
  125. TextButton_2.Size = UDim2.new(0, 302, 0, 40)
  126. TextButton_2.Font = Enum.Font.SourceSans
  127. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  128. TextButton_2.TextSize = 14.000
  129. TextButton_2.Text = text
  130.  
  131. if type(callback) == "function" then
  132. TextButton_2.MouseButton1Down:Connect(callback)
  133. end
  134. end
  135. function library3:NewTextbox(text, callback)
  136. local UIHolder = Instance.new("Frame")
  137.  
  138. UIHolder.Name = "UIHolder"
  139. UIHolder.Parent = ScrollingFrame
  140. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  141. UIHolder.BorderSizePixel = 0
  142. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  143.  
  144. local TextBox = Instance.new("TextBox")
  145. TextBox.Parent = UIHolder
  146. TextBox.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  147. TextBox.Position = UDim2.new(0.0199999996, 0, 0.100000001, 0)
  148. TextBox.Size = UDim2.new(0, 302, 0, 40)
  149. TextBox.Font = Enum.Font.SourceSans
  150. TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  151. TextBox.TextSize = 14.000
  152. TextBox.Text = text
  153.  
  154. if type(callback) == "function" then
  155. TextBox.FocusLost:Connect(function()
  156. callback(TextBox.Text)
  157. end)
  158. end
  159. end
  160.  
  161. function library3:NewSlider(text, min, max, callback)
  162. local holding = false
  163. local val = 0
  164.  
  165. local Slider = Instance.new("Frame")
  166. local TextButton_2 = Instance.new("TextButton")
  167. local TextLabel = Instance.new("TextLabel")
  168. local TextLabel_2 = Instance.new("TextLabel")
  169. local UIHolder = Instance.new("Frame")
  170.  
  171. UIHolder.Name = "UIHolder"
  172. UIHolder.Parent = ScrollingFrame
  173. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  174. UIHolder.BorderSizePixel = 0
  175. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  176.  
  177. Slider.Name = "Slider"
  178. Slider.Parent = UIHolder
  179. Slider.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  180. Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  181. Slider.Size = UDim2.new(0, 228, 0, 12)
  182.  
  183. TextButton_2.Parent = Slider
  184. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  185. TextButton_2.BorderSizePixel = 0
  186. TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  187. TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  188. TextButton_2.Font = Enum.Font.SourceSans
  189. TextButton_2.Text = ""
  190. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  191. TextButton_2.TextSize = 14.000
  192.  
  193. TextLabel.Parent = Slider
  194. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  195. TextLabel.BackgroundTransparency = 1.000
  196. TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  197. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  198. TextLabel.Font = Enum.Font.SourceSans
  199. TextLabel.Text = "slider"
  200. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  201. TextLabel.TextSize = 14.000
  202.  
  203. TextLabel_2.Parent = Slider
  204. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  205. TextLabel_2.BackgroundTransparency = 1.000
  206. TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  207. TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  208. TextLabel_2.Font = Enum.Font.SourceSans
  209. TextLabel_2.Text = "0"
  210. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  211. TextLabel_2.TextSize = 14.000
  212.  
  213. TextButton_2.MouseButton1Down:Connect(function()
  214. holding = true
  215. while holding do
  216. local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  217. local clampedX = math.clamp(xLocation, 0, 1)
  218.  
  219. val = math.ceil( min + (clampedX * (max-min)) )
  220.  
  221. TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  222. TextLabel_2.Text = tostring(val)
  223.  
  224. callback(val)
  225. wait()
  226. end
  227. end)
  228. TextButton_2.MouseButton1Up:Connect(function()
  229. holding = false
  230. end)
  231. mouse.Button1Up:Connect(function()
  232. holding = false
  233. end)
  234. end
  235. return library3
  236. end
  237.  
  238. local function setDraggable()
  239. Menu.Active = true
  240. Menu.Draggable = true
  241. end
  242.  
  243. local function exitButton()
  244. ScreenGui:Destroy()
  245. end
  246.  
  247. setDraggable()
  248. Exit.MouseButton1Click:Connect(exitButton)
  249.  
  250. return library2
  251. end
  252.  
  253. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement