Advertisement
matekaOSF2

Untitled

Dec 9th, 2020
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.73 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, 176, 0, 300)
  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.Position = UDim2.new(0.00651116669, 0, -0.135416672, 0)
  116. Button.Size = UDim2.new(0, 165, 0, 38)
  117. Button.Font = Enum.Font.SourceSansBold
  118. Button.Text = text
  119. Button.TextColor3 = Color3.new(1, 1, 1)
  120. Button.TextSize = 14
  121.  
  122. Button.MouseButton1Click:Connect(callback)
  123.  
  124. UITextSizeConstraint.MinTextSize = 14
  125. UITextSizeConstraint.MaxTextSize = 14
  126. UITextSizeConstraint.Parent = Button
  127. BtnFrames.Size = BtnFrames.Size + UDim2.new(0, 165, 0, 38)
  128. return Button;
  129. end
  130.  
  131. function epicLibrary:Box(text, callback)
  132. local UITextSizeConstraint = Instance.new("UITextSizeConstraint")
  133. local Box = Instance.new("TextBox")
  134. text = text or "Box"
  135. callback = callback or function() end;
  136.  
  137. Box.Name = "Box"
  138. Box.Parent = BtnFrames
  139. Box.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  140. Box.BorderSizePixel = 0
  141. Box.Position = UDim2.new(0.0340568386, 0, 0.236666664, 0)
  142. Box.Size = UDim2.new(0, 164, 0, 19)
  143. Box.Font = Enum.Font.SourceSansBold
  144. Box.PlaceholderColor3 = Color3.new(1, 1, 1)
  145. Box.PlaceholderText = text
  146. Box.TextColor3 = Color3.new(1, 1, 1)
  147. Box.TextSize = 14
  148.  
  149. box.FocusLost:connect(function(...)
  150. callback(box, ...)
  151. end)
  152.  
  153. UITextSizeConstraint.MinTextSize = 14
  154. UITextSizeConstraint.MaxTextSize = 14
  155. UITextSizeConstraint.Parent = Box
  156. BtnFrames.Size = BtnFrames.Size + UDim2.new(0, 164, 0, 19)
  157. return Box;
  158. end
  159.  
  160. function epicLibrary:Slider(text, min, max, callback)
  161. local mouse = game.Players.LocalPlayer:GetMouse()
  162. local uis = game:GetService("UserInputService")
  163. local Value = 0;
  164. text = text or "Slider"
  165. min = min or 0
  166. max = max or 100
  167. callback = callback or function() end;
  168.  
  169. local Slider = Instance.new("Frame")
  170. local Title = Instance.new("TextLabel")
  171. local UITextSizeConstraint_2 = Instance.new("UITextSizeConstraint")
  172. local NumberValue = Instance.new("TextLabel")
  173. local UITextSizeConstraint_3 = Instance.new("UITextSizeConstraint")
  174. local SliderButton = Instance.new("TextButton")
  175. local SliderFrame = Instance.new("Frame")
  176.  
  177. Slider.Name = "Slider"
  178. Slider.Parent = BtnFrames
  179. Slider.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  180. Slider.BorderSizePixel = 0
  181. Slider.Position = UDim2.new(0.0397727266, 0, 0.316666663, 0)
  182. Slider.Size = UDim2.new(0, 162, 0, 63)
  183.  
  184. Title.Name = "Title"
  185. Title.Parent = Slider
  186. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  187. Title.BackgroundTransparency = 1
  188. Title.Position = UDim2.new(0.0432098769, 0, 0, 0)
  189. Title.Size = UDim2.new(0, 119, 0, 20)
  190. Title.Font = Enum.Font.SourceSansBold
  191. Title.TextColor3 = Color3.new(1, 1, 1)
  192. Title.Text = text
  193. Title.TextSize = 14
  194. Title.TextXAlignment = Enum.TextXAlignment.Left
  195.  
  196. UITextSizeConstraint_2.Parent = Title
  197. UITextSizeConstraint_2.MaxTextSize = 14
  198. UITextSizeConstraint_2.MinTextSize = 14
  199.  
  200. NumberValue.Name = "NumberValue"
  201. NumberValue.Parent = Slider
  202. NumberValue.BackgroundColor3 = Color3.new(1, 1, 1)
  203. NumberValue.BackgroundTransparency = 1
  204. NumberValue.Position = UDim2.new(0.777777731, 0, 0, 0)
  205. NumberValue.Size = UDim2.new(0, 34, 0, 20)
  206. NumberValue.Font = Enum.Font.SourceSansBold
  207. NumberValue.Text = 0
  208. NumberValue.TextColor3 = Color3.new(1, 1, 1)
  209. NumberValue.TextSize = 14
  210.  
  211. UITextSizeConstraint_3.Parent = NumberValue
  212. UITextSizeConstraint_3.MaxTextSize = 14
  213. UITextSizeConstraint_3.MinTextSize = 14
  214.  
  215. SliderButton.Name = "SliderButton"
  216. SliderButton.Parent = Slider
  217. SliderButton.BackgroundColor3 = Color3.new(0.129412, 0.129412, 0.129412)
  218. SliderButton.BorderSizePixel = 0
  219. SliderButton.Position = UDim2.new(0.0308641493, 0, 0.499673754, 0)
  220. SliderButton.Size = UDim2.new(0, 152, 0, 20)
  221. SliderButton.Font = Enum.Font.SourceSans
  222. SliderButton.Text = ""
  223. SliderButton.TextColor3 = Color3.new(0, 0, 0)
  224. SliderButton.TextSize = 14
  225.  
  226. SliderFrame.Name = "SliderFrame"
  227. SliderFrame.Parent = SliderButton
  228. SliderFrame.BackgroundColor3 = Color3.new(0.894118, 0.384314, 0.270588)
  229. SliderFrame.BorderSizePixel = 0
  230. SliderFrame.Size = UDim2.new(0, 0, 0, 19)
  231.  
  232. SliderButton.MouseButton1Down:Connect(function()
  233. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0
  234. pcall(function()
  235. callback(Value)
  236. end)
  237. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  238.  
  239. SliderFrame:GetPropertyChangedSignal("Size"):Connect(function()
  240. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0
  241. NumberValue.Text = Value
  242. pcall(function()
  243. callback(Value)
  244. end)
  245. end)
  246.  
  247. moveconnection = mouse.Move:Connect(function()
  248. NumberValue.Text = Value
  249. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min))
  250. pcall(function()
  251. callback(Value)
  252. end)
  253. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  254. end)
  255.  
  256. releaseconnection = uis.InputEnded:Connect(function(Mouse)
  257. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  258. Value = math.floor((((tonumber(max) - tonumber(min)) / 146) * SliderFrame.AbsoluteSize.X) + tonumber(min))
  259. pcall(function()
  260. callback(Value)
  261. end)
  262. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  263. moveconnection:Disconnect()
  264. releaseconnection:Disconnect()
  265. end
  266. end)
  267. end)
  268.  
  269. return SliderButton;
  270. end
  271.  
  272. function epicLibrary:Toggle(text, callback)
  273. local toggled = false
  274. text = text or "Toggle"
  275. callback = callback or function() end;
  276.  
  277. Toggle.Name = "Toggle"
  278. Toggle.Parent = BtnFrames
  279. Toggle.BackgroundColor3 = Color3.new(1, 1, 1)
  280. Toggle.BackgroundTransparency = 1
  281. Toggle.Position = UDim2.new(0.0255681816, 0, 0.143333331, 0)
  282. Toggle.Size = UDim2.new(0, 166, 0, 23)
  283. Toggle.Font = Enum.Font.SourceSansBold
  284. Toggle.TextColor3 = Color3.new(1, 1, 1)
  285. Toggle.TextSize = 14
  286. Toggle.TextXAlignment = Enum.TextXAlignment.Right
  287.  
  288. Toggable.Name = "Toggable"
  289. Toggable.Parent = Toggle
  290. Toggable.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  291. Toggable.BorderSizePixel = 0
  292. Toggable.Position = UDim2.new(0.00598797807, 0, 0, 0)
  293. Toggable.Size = UDim2.new(0, 23, 0, 23)
  294. Toggable.Font = Enum.Font.SourceSans
  295. Toggable.Text = text
  296. Toggable.TextColor3 = Color3.new(1, 1, 1)
  297. Toggable.TextSize = 14
  298. Toggable.MouseButton1Click:Connect(function()
  299. if toggled then
  300. toggled = false
  301. Toggable.BackgroundColor3 = Color3.new(0.14902, 0.14902, 0.14902)
  302. else
  303. toggled = true
  304. Toggable.BackgroundColor3 = Color3.new(0.333333, 1, 0)
  305. end
  306. end)
  307.  
  308. spawn(function()
  309. while wait() do
  310. if toggled then
  311. callback();
  312. end
  313. end
  314. end)
  315. end
  316.  
  317. return epicLibrary
  318. end
  319.  
  320. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement