Advertisement
matekaOSF2

Untitled

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