Advertisement
matekaOSF2

Untitled

Dec 10th, 2020 (edited)
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.21 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. BtnFrames.Parent = func
  85. BtnFrames.BackgroundColor3 = Color3.new(0.184314, 0.184314, 0.184314)
  86. BtnFrames.BorderSizePixel = 0
  87. BtnFrames.Position = UDim2.new(0, 0, 0.966999531, 0)
  88.  
  89. UIListLayout.Parent = BtnFrames
  90. UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  91. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  92. UIListLayout.Padding = UDim.new(0, 5)
  93.  
  94. Underline.Name = "Underline"
  95. Underline.Parent = func
  96. Underline.BackgroundColor3 = Color3.new(0.490196, 1, 0.788235)
  97. Underline.BorderSizePixel = 0
  98. Underline.Position = UDim2.new(0, 0, 0.95348835, 0)
  99. Underline.Size = UDim2.new(0, 177, 0, 3)
  100.  
  101. function library:Resize()
  102. local y = 0;
  103. for i, v in next, BtnFrames:GetChildren() do
  104. if not v:IsA('UIListLayout') then
  105. y = y + v.AbsoluteSize.Y;
  106. end
  107. end
  108.  
  109. BtnFrames.Size = UDim2.new(1, 0, 0, y+12.5)
  110. end
  111.  
  112. local epicLibrary = {}
  113.  
  114. function epicLibrary:Button(text, callback)
  115. local Button = Instance.new("TextButton")
  116. text = text or "Button"
  117. callback = callback or function() end;
  118.  
  119. Button.Name = "Button"
  120. Button.Parent = BtnFrames
  121. Button.BackgroundColor3 = Color3.new(0.282353, 0.282353, 0.282353)
  122. Button.BorderSizePixel = 0
  123. Button.Position = UDim2.new(0.00651116669, 0, -0.135416672, 0)
  124. Button.Size = UDim2.new(0, 165, 0, 38)
  125. Button.Font = Enum.Font.SourceSansBold
  126. Button.Text = text
  127. Button.TextColor3 = Color3.new(1, 1, 1)
  128. Button.TextSize = 14
  129. Button.MouseButton1Click:Connect(callback)
  130. UITextSize(Button)
  131.  
  132. library:Resize()
  133. return Button
  134. end
  135.  
  136. function epicLibrary:Box(text, callback)
  137. local Box = Instance.new("TextBox")
  138. text = text or "Box"
  139. callback = callback or function() end;
  140.  
  141. Box.Name = "Box"
  142. Box.Parent = BtnFrames
  143. Box.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  144. Box.BorderSizePixel = 0
  145. Box.Position = UDim2.new(0.0340568386, 0, 0.236666664, 0)
  146. Box.Size = UDim2.new(0, 164, 0, 19)
  147. Box.Font = Enum.Font.SourceSansBold
  148. Box.PlaceholderColor3 = Color3.new(1, 1, 1)
  149. Box.Text = ""
  150. Box.TextColor3 = Color3.new(1, 1, 1)
  151. Box.TextSize = 14
  152. UITextSize(Box);
  153.  
  154. Box.FocusLost:Connect(function(...)
  155. callback(...)
  156. end)
  157.  
  158. library:Resize()
  159. return Box
  160. end
  161.  
  162. function epicLibrary:Slider(text, min, max, callback)
  163. local mouse = game.Players.LocalPlayer:GetMouse()
  164. local uis = game:GetService("UserInputService")
  165. local Value = 0;
  166. local Slider = Instance.new("Frame")
  167. local Title = Instance.new("TextLabel")
  168. local NumberValue = Instance.new("TextLabel")
  169. local SliderButton = Instance.new("TextButton")
  170. local SliderFrame = Instance.new("Frame")
  171. text = text or "Slider"
  172. min = min or 0
  173. max = max or 100
  174. callback = callback or function() end;
  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.Position = UDim2.new(0.0397727266, 0, 0.316666663, 0)
  181. Slider.Size = UDim2.new(0, 162, 0, 63)
  182.  
  183. Title.Name = "Title"
  184. Title.Parent = Slider
  185. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  186. Title.BackgroundTransparency = 1
  187. Title.Position = UDim2.new(0.0432098769, 0, 0, 0)
  188. Title.Size = UDim2.new(0, 119, 0, 20)
  189. Title.Font = Enum.Font.SourceSansBold
  190. Title.Text = text
  191. Title.TextColor3 = Color3.new(1, 1, 1)
  192. Title.TextSize = 14
  193. Title.TextXAlignment = Enum.TextXAlignment.Left
  194. UITextSize(Title)
  195.  
  196. NumberValue.Name = "NumberValue"
  197. NumberValue.Parent = Slider
  198. NumberValue.BackgroundColor3 = Color3.new(1, 1, 1)
  199. NumberValue.BackgroundTransparency = 1
  200. NumberValue.Position = UDim2.new(0.777777731, 0, 0, 0)
  201. NumberValue.Size = UDim2.new(0, 34, 0, 20)
  202. NumberValue.Font = Enum.Font.SourceSansBold
  203. NumberValue.Text = "0"
  204. NumberValue.TextColor3 = Color3.new(1, 1, 1)
  205. NumberValue.TextSize = 14
  206. UITextSize(NumberValue)
  207.  
  208. SliderButton.Name = "SliderButton"
  209. SliderButton.Parent = Slider
  210. SliderButton.BackgroundColor3 = Color3.new(0.129412, 0.129412, 0.129412)
  211. SliderButton.BorderSizePixel = 0
  212. SliderButton.Position = UDim2.new(0.0308641493, 0, 0.499673754, 0)
  213. SliderButton.Size = UDim2.new(0, 152, 0, 20)
  214. SliderButton.Font = Enum.Font.SourceSans
  215. SliderButton.Text = ""
  216. SliderButton.TextColor3 = Color3.new(0, 0, 0)
  217. SliderButton.TextSize = 14
  218.  
  219. SliderFrame.Name = "SliderFrame"
  220. SliderFrame.Parent = SliderButton
  221. SliderFrame.BackgroundColor3 = Color3.new(0.894118, 0.384314, 0.270588)
  222. SliderFrame.BorderSizePixel = 0
  223. SliderFrame.Size = UDim2.new(0, 0, 0, 19)
  224.  
  225. SliderButton.MouseButton1Down:Connect(function()
  226. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0
  227. pcall(function()
  228. callback(Value)
  229. end)
  230. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  231.  
  232. SliderFrame:GetPropertyChangedSignal("Size"):Connect(function()
  233. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min)) or 0
  234. NumberValue.Text = Value
  235. pcall(function()
  236. callback(Value)
  237. end)
  238. end)
  239.  
  240. moveconnection = mouse.Move:Connect(function()
  241. NumberValue.Text = Value
  242. Value = math.floor((((tonumber(max) - tonumber(min)) / 152) * SliderFrame.AbsoluteSize.X) + tonumber(min))
  243. pcall(function()
  244. callback(Value)
  245. end)
  246. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  247. end)
  248.  
  249. releaseconnection = uis.InputEnded:Connect(function(Mouse)
  250. if Mouse.UserInputType == Enum.UserInputType.MouseButton1 then
  251. Value = math.floor((((tonumber(max) - tonumber(min)) / 146) * SliderFrame.AbsoluteSize.X) + tonumber(min))
  252. pcall(function()
  253. callback(Value)
  254. end)
  255. SliderFrame.Size = UDim2.new(0, math.clamp(mouse.X - SliderFrame.AbsolutePosition.X, 0, 152), 0, 20)
  256. moveconnection:Disconnect()
  257. releaseconnection:Disconnect()
  258. end
  259. end)
  260. end)
  261.  
  262. library:Resize()
  263. return Slider
  264. end
  265.  
  266. function epicLibrary:Toggle(text, callback)
  267. local Toggle = Instance.new("TextLabel")
  268. local Toggable = Instance.new("TextButton")
  269. local toggled = false
  270. text = text or "Toggle"
  271. callback = callback or function() end;
  272.  
  273. Toggle.Name = "Toggle"
  274. Toggle.Parent = BtnFrames
  275. Toggle.BackgroundColor3 = Color3.new(1, 1, 1)
  276. Toggle.BackgroundTransparency = 1
  277. Toggle.Position = UDim2.new(0.0255681816, 0, 0.143333331, 0)
  278. Toggle.Size = UDim2.new(0, 166, 0, 23)
  279. Toggle.Font = Enum.Font.SourceSansBold
  280. Toggle.TextColor3 = Color3.new(1, 1, 1)
  281. Toggle.TextSize = 14
  282. Toggle.TextXAlignment = Enum.TextXAlignment.Right
  283. UITextSize(Toggle)
  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 = ""
  293. Toggable.TextColor3 = Color3.new(1, 1, 1)
  294. Toggable.TextSize = 14
  295. Toggable.MouseButton1Down: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.fromRGB(0, 255, 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.  
  313. library:Resize()
  314. return Toggle
  315. end
  316.  
  317. return epicLibrary
  318. end
  319.  
  320. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement