Advertisement
matekaOSF2

Untitled

Dec 9th, 2020 (edited)
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.54 KB | None | 0 0
  1. local library = {
  2. windowcount = 0;
  3. }
  4.  
  5. function library:CreateWindow(text)
  6. library.windowcount = library.windowcount + 1
  7. text = text or "Window"
  8.  
  9. local HaxxLib = Instance.new("ScreenGui")
  10. local Frame = Instance.new("Frame")
  11. local func = Instance.new("Frame")
  12. local TextLabel = Instance.new("TextLabel")
  13. local MinBtn = Instance.new("TextButton")
  14. local Diamond = Instance.new("ImageLabel")
  15. local Panel = Instance.new("Frame")
  16. local BtnFrames = Instance.new("Frame")
  17. local UIListLayout = Instance.new("UIListLayout")
  18. local Underline = Instance.new("Frame")
  19.  
  20. HaxxLib.Name = "HaxxLib"
  21. HaxxLib.Parent = game.CoreGui
  22. HaxxLib.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  23. HaxxLib.ResetOnSpawn = false
  24.  
  25. Frame.Parent = HaxxLib
  26. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  27. Frame.BackgroundTransparency = 1
  28. Frame.BorderColor3 = Color3.new(0.105882, 0.164706, 0.207843)
  29. Frame.Position = UDim2.new(0, (15 + ((200 * self.windowcount) - 200)), 0, 15)
  30. Frame.Size = UDim2.new(0, 1920, 0, 496)
  31.  
  32. func.Name = "func"
  33. func.Parent = Frame
  34. func.Active = true
  35. func.BackgroundColor3 = Color3.new(0.184314, 0.184314, 0.184314)
  36. func.BorderSizePixel = 0
  37. func.Draggable = true
  38. func.Position = UDim2.new(0.0124454685, 0, 0.0345371962, 0)
  39. func.Selectable = true
  40. func.Size = UDim2.new(0, 177, 0, 43)
  41.  
  42. TextLabel.Parent = func
  43. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  44. TextLabel.BackgroundTransparency = 1
  45. TextLabel.Position = UDim2.new(0.231792897, 0, 0.224843681, 0)
  46. TextLabel.Size = UDim2.new(0, 93, 0, 15)
  47. TextLabel.Font = Enum.Font.SourceSansBold
  48. TextLabel.Text = text
  49. TextLabel.TextColor3 = Color3.new(0.490196, 1, 0.788235)
  50. TextLabel.TextScaled = true
  51. TextLabel.TextSize = 14
  52. TextLabel.TextWrapped = true
  53.  
  54. MinBtn.Name = "MinBtn"
  55. MinBtn.Parent = func
  56. MinBtn.BackgroundColor3 = Color3.new(1, 1, 1)
  57. MinBtn.BackgroundTransparency = 1
  58. MinBtn.Position = UDim2.new(0.754991829, 0, -0.0223813951, 0)
  59. MinBtn.Size = UDim2.new(0, 54, 0, 34)
  60. MinBtn.Font = Enum.Font.SourceSansBold
  61. MinBtn.Text = "-"
  62. MinBtn.TextColor3 = Color3.new(0.490196, 1, 0.788235)
  63. MinBtn.TextScaled = true
  64. MinBtn.TextSize = 14
  65. MinBtn.TextWrapped = true
  66.  
  67. Diamond.Name = "Diamond"
  68. Diamond.Parent = func
  69. Diamond.BackgroundColor3 = Color3.new(1, 1, 1)
  70. Diamond.BackgroundTransparency = 1
  71. Diamond.Position = UDim2.new(0.0254812501, 0, 0.0999122635, 0)
  72. Diamond.Size = UDim2.new(0.172413319, 0, 0.141544059, 0)
  73. Diamond.SizeConstraint = Enum.SizeConstraint.RelativeXX
  74. Diamond.Image = "rbxassetid://4851247883"
  75. Diamond.ScaleType = Enum.ScaleType.Fit
  76.  
  77. Panel.Name = "Panel"
  78. Panel.Parent = func
  79. Panel.BackgroundColor3 = Color3.new(0.184314, 0.184314, 0.184314)
  80. Panel.BorderSizePixel = 0
  81. Panel.Position = UDim2.new(0, 0, 0.966999829, 0)
  82. Panel.Size = UDim2.new(0, 177, 0, 395)
  83.  
  84. BtnFrames.Name = "BtnFrames"
  85. BtnFrames.Parent = Panel
  86. BtnFrames.BackgroundColor3 = Color3.new(1, 1, 1)
  87. BtnFrames.BackgroundTransparency = 1
  88. BtnFrames.Position = UDim2.new(0, 0, 0.014581793, 0)
  89. BtnFrames.Size = UDim2.new(0, 0, 0, 0)
  90.  
  91. UIListLayout.Parent = BtnFrames
  92. UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  93. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  94. UIListLayout.Padding = UDim.new(0, 5)
  95.  
  96. Underline.Name = "Underline"
  97. Underline.Parent = func
  98. Underline.BackgroundColor3 = Color3.new(0.490196, 1, 0.788235)
  99. Underline.BorderSizePixel = 0
  100. Underline.Position = UDim2.new(0, 0, 0.95348835, 0)
  101. Underline.Size = UDim2.new(0, 177, 0, 3)
  102.  
  103. local epicLibrary = {}
  104.  
  105. function epicLibrary:Button(text, callback)
  106. local Button = Instance.new("TextButton")
  107. local UITextSizeConstraint = Instance.new("UITextSizeConstraint")
  108. text = text or "Button"
  109. callback = callback or function() end;
  110.  
  111. Button.Name = "Button"
  112. Button.Parent = BtnFrames
  113. Button.BackgroundColor3 = Color3.new(0.282353, 0.282353, 0.282353)
  114. Button.BorderSizePixel = 0
  115. Button.Size = UDim2.new(0, 165, 0, 38)
  116. Button.Font = Enum.Font.SourceSansBold
  117. Button.Text = text
  118. Button.TextColor3 = Color3.new(1, 1, 1)
  119. Button.TextSize = 14
  120.  
  121. Button.MouseButton1Click:Connect(callback)
  122.  
  123. UITextSizeConstraint.MinTextSize = 14
  124. UITextSizeConstraint.MaxTextSize = 14
  125. UITextSizeConstraint.Parent = Button
  126. BtnFrames.Size = BtnFrames.Size + UDim2.new(0, 165, 0, 38)
  127. return Button;
  128. end
  129.  
  130. function epicLibrary:Box(text, callback)
  131. local UITextSizeConstraint = Instance.new("UITextSizeConstraint")
  132. local Box = Instance.new("TextBox")
  133. text = text or "Box"
  134. callback = callback or function() end;
  135.  
  136. Box.Name = "Box"
  137. Box.Parent = BtnFrames
  138. Box.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  139. Box.BorderSizePixel = 0
  140. Box.Size = UDim2.new(0, 164, 0, 19)
  141. Box.Font = Enum.Font.SourceSansBold
  142. Box.PlaceholderColor3 = Color3.new(1, 1, 1)
  143. Box.PlaceholderText = text
  144. Box.TextColor3 = Color3.new(1, 1, 1)
  145. Box.TextSize = 14
  146.  
  147. box.FocusLost:connect(function(...)
  148. callback(box, ...)
  149. end)
  150.  
  151. UITextSizeConstraint.MinTextSize = 14
  152. UITextSizeConstraint.MaxTextSize = 14
  153. UITextSizeConstraint.Parent = Box
  154. BtnFrames.Size = BtnFrames.Size + UDim2.new(0, 164, 0, 19)
  155. return Box;
  156. end
  157.  
  158. function epicLibrary:Slider(text, min, max, callback)
  159. BtnFrames.Size = BtnFrames.Size + UDim2.new(0, 162, 0, 63)
  160. local mouse = game.Players.LocalPlayer:GetMouse()
  161. local uis = game:GetService("UserInputService")
  162. local Value = 0;
  163. text = text or "Slider"
  164. min = min or 0
  165. max = max or 100
  166. callback = callback or function() end;
  167.  
  168. local Slider = Instance.new("Frame")
  169. local Title = Instance.new("TextLabel")
  170. local UITextSizeConstraint_2 = Instance.new("UITextSizeConstraint")
  171. local NumberValue = Instance.new("TextLabel")
  172. local UITextSizeConstraint_3 = Instance.new("UITextSizeConstraint")
  173. local SliderButton = Instance.new("TextButton")
  174. local SliderFrame = Instance.new("Frame")
  175.  
  176. Slider.Name = "Slider"
  177. Slider.Parent = BtnFrames
  178. Slider.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  179. Slider.BorderSizePixel = 0
  180. Slider.Size = UDim2.new(0, 162, 0, 63)
  181.  
  182. Title.Name = "Title"
  183. Title.Parent = Slider
  184. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  185. Title.BackgroundTransparency = 1
  186. Title.Position = UDim2.new(0.0432098769, 0, 0, 0)
  187. Title.Size = UDim2.new(0, 119, 0, 20)
  188. Title.Font = Enum.Font.SourceSansBold
  189. Title.TextColor3 = Color3.new(1, 1, 1)
  190. Title.Text = text
  191. Title.TextSize = 14
  192. Title.TextXAlignment = Enum.TextXAlignment.Left
  193.  
  194. UITextSizeConstraint_2.Parent = Title
  195. UITextSizeConstraint_2.MaxTextSize = 14
  196. UITextSizeConstraint_2.MinTextSize = 14
  197.  
  198. NumberValue.Name = "NumberValue"
  199. NumberValue.Parent = Slider
  200. NumberValue.BackgroundColor3 = Color3.new(1, 1, 1)
  201. NumberValue.BackgroundTransparency = 1
  202. NumberValue.Position = UDim2.new(0.777777731, 0, 0, 0)
  203. NumberValue.Size = UDim2.new(0, 34, 0, 20)
  204. NumberValue.Font = Enum.Font.SourceSansBold
  205. NumberValue.Text = 0
  206. NumberValue.TextColor3 = Color3.new(1, 1, 1)
  207. NumberValue.TextSize = 14
  208.  
  209. UITextSizeConstraint_3.Parent = NumberValue
  210. UITextSizeConstraint_3.MaxTextSize = 14
  211. UITextSizeConstraint_3.MinTextSize = 14
  212.  
  213. SliderButton.Name = "SliderButton"
  214. SliderButton.Parent = Slider
  215. SliderButton.BackgroundColor3 = Color3.new(0.129412, 0.129412, 0.129412)
  216. SliderButton.BorderSizePixel = 0
  217. SliderButton.Position = UDim2.new(0.0308641493, 0, 0.499673754, 0)
  218. SliderButton.Size = UDim2.new(0, 152, 0, 20)
  219. SliderButton.Font = Enum.Font.SourceSans
  220. SliderButton.Text = ""
  221. SliderButton.TextColor3 = Color3.new(0, 0, 0)
  222. SliderButton.TextSize = 14
  223.  
  224. SliderFrame.Name = "SliderFrame"
  225. SliderFrame.Parent = SliderButton
  226. SliderFrame.BackgroundColor3 = Color3.new(0.894118, 0.384314, 0.270588)
  227. SliderFrame.BorderSizePixel = 0
  228. SliderFrame.Size = UDim2.new(0, 0, 0, 19)
  229.  
  230. SliderButton.MouseButton1Down:Connect(function()
  231. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0
  232. pcall(function()
  233. callback(Value)
  234. end)
  235. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  236.  
  237. SliderFrame:GetPropertyChangedSignal("Size"):Connect(function()
  238. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0
  239. NumberValue.Text = Value
  240. pcall(function()
  241. callback(Value)
  242. end)
  243. end)
  244.  
  245. moveconnection = mouse.Move:Connect(function()
  246. NumberValue.Text = Value
  247. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min))
  248. pcall(function()
  249. callback(Value)
  250. end)
  251. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  252. end)
  253.  
  254. releaseconnection = uis.InputEnded:Connect(function(Mouse)
  255. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  256. Value = math.floor((((tonumber(max) - tonumber(min)) / 146) * SliderFrame.AbsoluteSize.X) + tonumber(min))
  257. pcall(function()
  258. callback(Value)
  259. end)
  260. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  261. moveconnection:Disconnect()
  262. releaseconnection:Disconnect()
  263. end
  264. end)
  265. end)
  266.  
  267. return SliderButton;
  268. end
  269.  
  270. function epicLibrary:Toggle(text, callback)
  271. local toggled = false
  272. text = text or "Toggle"
  273. callback = callback or function() end;
  274.  
  275. Toggle.Name = "Toggle"
  276. Toggle.Parent = BtnFrames
  277. Toggle.BackgroundColor3 = Color3.new(1, 1, 1)
  278. Toggle.BackgroundTransparency = 1
  279. Toggle.Size = UDim2.new(0, 166, 0, 23)
  280. Toggle.Font = Enum.Font.SourceSansBold
  281. Toggle.TextColor3 = Color3.new(1, 1, 1)
  282. Toggle.TextSize = 14
  283. Toggle.TextXAlignment = Enum.TextXAlignment.Right
  284.  
  285. Toggable.Name = "Toggable"
  286. Toggable.Parent = Toggle
  287. Toggable.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  288. Toggable.BorderSizePixel = 0
  289. Toggable.Position = UDim2.new(0.00598797807, 0, 0, 0)
  290. Toggable.Size = UDim2.new(0, 23, 0, 23)
  291. Toggable.Font = Enum.Font.SourceSans
  292. Toggable.Text = text
  293. Toggable.TextColor3 = Color3.new(1, 1, 1)
  294. Toggable.TextSize = 14
  295. Toggable.MouseButton1Click:Connect(function()
  296. if toggled then
  297. toggled = false
  298. Toggable.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  299. else
  300. toggled = true
  301. Toggable.BackgroundColor3 = Color3.new(0.333333, 1, 0)
  302. end
  303. end)
  304.  
  305. spawn(function()
  306. while wait() do
  307. if toggled then
  308. callback();
  309. end
  310. end
  311. end)
  312. end
  313.  
  314. return epicLibrary
  315. end
  316.  
  317. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement