joefromsansnite

Untitled

Oct 1st, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.08 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.  
  91. ScrollingFrame.Parent = Frames
  92. ScrollingFrame.Active = true
  93. ScrollingFrame.BackgroundColor3 = Color3.fromRGB(60, 50, 50)
  94. ScrollingFrame.BorderSizePixel = 0
  95. ScrollingFrame.Size = UDim2.new(0, 330, 0, 290)
  96.  
  97. UIGridLayout_2.Parent = ScrollingFrame
  98. UIGridLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  99. UIGridLayout_2.CellSize = UDim2.new(0, 330, 0, 50)
  100.  
  101. TextButton.MouseButton1Down:Connect(function()
  102. for i,v in pairs(Frames:GetChildren()) do
  103. v.Visible = false
  104. end
  105.  
  106. ScrollingFrame.Visible = true
  107. end)
  108.  
  109. local library3 = {}
  110.  
  111. function library3:NewButton(text, callback)
  112. local UIHolder = Instance.new("Frame")
  113.  
  114. UIHolder.Name = "UIHolder"
  115. UIHolder.Parent = ScrollingFrame
  116. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  117. UIHolder.BorderSizePixel = 0
  118. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  119.  
  120. local TextButton_2 = Instance.new("TextButton")
  121. TextButton_2.Parent = UIHolder
  122. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  123. TextButton_2.Position = UDim2.new(0.0199999996, 0, 0.100000001, 0)
  124. TextButton_2.Size = UDim2.new(0, 302, 0, 40)
  125. TextButton_2.Font = Enum.Font.SourceSans
  126. TextButton_2.TextColor3 = Color3.fromRGB(0, 0, 0)
  127. TextButton_2.TextSize = 14.000
  128. TextButton_2.Text = text
  129.  
  130. if type(callback) == "function" then
  131. TextButton_2.MouseButton1Down:Connect(callback)
  132. end
  133. end
  134. function library3:NewTextbox(text, callback)
  135. local UIHolder = Instance.new("Frame")
  136.  
  137. UIHolder.Name = "UIHolder"
  138. UIHolder.Parent = ScrollingFrame
  139. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  140. UIHolder.BorderSizePixel = 0
  141. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  142.  
  143. local TextBox = Instance.new("TextBox")
  144. TextBox.Parent = UIHolder
  145. TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  146. TextBox.Position = UDim2.new(0.0199999996, 0, 0.100000001, 0)
  147. TextBox.Size = UDim2.new(0, 302, 0, 40)
  148. TextBox.Font = Enum.Font.SourceSans
  149. TextBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  150. TextBox.TextSize = 14.000
  151. TextBox.Text = text
  152.  
  153. if type(callback) == "function" then
  154. TextBox.FocusLost:Connect(function()
  155. callback(TextBox.Text)
  156. end)
  157. end
  158. end
  159.  
  160. function library3:NewSlider(text, min, max, callback)
  161. local holding = false
  162. local val = 0
  163.  
  164. local Slider = Instance.new("Frame")
  165. local TextButton_2 = Instance.new("TextButton")
  166. local TextLabel = Instance.new("TextLabel")
  167. local TextLabel_2 = Instance.new("TextLabel")
  168. local UIHolder = Instance.new("Frame")
  169.  
  170. UIHolder.Name = "UIHolder"
  171. UIHolder.Parent = ScrollingFrame
  172. UIHolder.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  173. UIHolder.BorderSizePixel = 0
  174. UIHolder.Size = UDim2.new(0, 100, 0, 100)
  175.  
  176. Slider.Name = "Slider"
  177. Slider.Parent = UIHolder
  178. Slider.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
  179. Slider.Position = UDim2.new(0.130303025, 0, 0.379999995, 0)
  180. Slider.Size = UDim2.new(0, 228, 0, 12)
  181.  
  182. TextButton_2.Parent = Slider
  183. TextButton_2.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
  184. TextButton_2.BorderSizePixel = 0
  185. TextButton_2.Position = UDim2.new(0.473684192, 0, 0, 0)
  186. TextButton_2.Size = UDim2.new(0, 12, 0, 12)
  187. TextButton_2.Font = Enum.Font.SourceSans
  188. TextButton_2.Text = ""
  189. TextButton_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  190. TextButton_2.TextSize = 14.000
  191.  
  192. TextLabel.Parent = Slider
  193. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  194. TextLabel.BackgroundTransparency = 1.000
  195. TextLabel.Position = UDim2.new(0.0614035092, 0, -1.58333337, 0)
  196. TextLabel.Size = UDim2.new(0, 200, 0, 19)
  197. TextLabel.Font = Enum.Font.SourceSans
  198. TextLabel.Text = "slider"
  199. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  200. TextLabel.TextSize = 14.000
  201.  
  202. TextLabel_2.Parent = Slider
  203. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  204. TextLabel_2.BackgroundTransparency = 1.000
  205. TextLabel_2.Position = UDim2.new(0.0614035092, 0, 0.999999881, 0)
  206. TextLabel_2.Size = UDim2.new(0, 200, 0, 19)
  207. TextLabel_2.Font = Enum.Font.SourceSans
  208. TextLabel_2.Text = "0"
  209. TextLabel_2.TextColor3 = Color3.fromRGB(255, 255, 255)
  210. TextLabel_2.TextSize = 14.000
  211.  
  212. TextButton_2.MouseButton1Down:Connect(function()
  213. holding = true
  214. while holding do
  215. local xLocation = (uis:GetMouseLocation().X - Slider.AbsolutePosition.X) / Slider.AbsoluteSize.X
  216. local clampedX = math.clamp(xLocation, 0, 1)
  217.  
  218. val = math.ceil( min + (clampedX * (max-min)) )
  219.  
  220. TextButton_2.Position = UDim2.new(clampedX, 0, 0, 0)
  221. TextLabel_2.Text = tostring(val)
  222.  
  223. callback(val)
  224. wait()
  225. end
  226. end)
  227. TextButton_2.MouseButton1Up:Connect(function()
  228. holding = false
  229. end)
  230. mouse.Button1Up:Connect(function()
  231. holding = false
  232. end)
  233. end
  234. return library3
  235. end
  236.  
  237. local function setDraggable()
  238. Menu.Active = true
  239. Menu.Draggable = true
  240. end
  241.  
  242. local function exitButton()
  243. ScreenGui:Destroy()
  244. end
  245.  
  246. setDraggable()
  247. Exit.MouseButton1Click:Connect(exitButton)
  248.  
  249. return library2
  250. end
  251.  
  252. return library
Advertisement
Add Comment
Please, Sign In to add comment