9_cVv

TechHog's UI-Library V2 GUI

Jun 23rd, 2021 (edited)
865
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --UI_LIBRARY_V2
  2.  
  3. --objects
  4. local UI_LIBRARY_V2 = Instance.new('ScreenGui')
  5. local main = Instance.new'Frame'
  6. local UICorner = Instance.new'UICorner'
  7. local UIGradient = Instance.new'UIGradient'
  8. local sidebar = Instance.new'Frame'
  9. local UIGradient_2 = Instance.new'UIGradient'
  10. local UICorner_2 = Instance.new'UICorner'
  11. local template = Instance.new'TextButton'
  12. local sidebarhandler = Instance.new'LocalScript'
  13. local UIListLayout = Instance.new'UIListLayout'
  14. local topbar = Instance.new'TextLabel'
  15. local closeButton = Instance.new'ImageButton'
  16. local minimizeButton = Instance.new'ImageButton'
  17. local topsideline = Instance.new'Frame'
  18. local handler = Instance.new'LocalScript'
  19. local smooth_drag = Instance.new'LocalScript'
  20. local rightsideline = Instance.new'Frame'
  21. local sections = Instance.new'ScrollingFrame'
  22. local sectiontemplate = Instance.new'ScrollingFrame'
  23. local UIListLayout_2 = Instance.new'UIListLayout'
  24. local boxtemplate = Instance.new'TextBox'
  25. local buttontemplate = Instance.new'TextButton'
  26. local dropdowntemplate = Instance.new'TextButton'
  27. local indicator = Instance.new'TextLabel'
  28. local container = Instance.new'ScrollingFrame'
  29. local labeltemplate = Instance.new'TextLabel'
  30.  
  31. --properties
  32. UI_LIBRARY_V2.Name = 'UI_LIBRARY_V2'
  33. pcall(function() syn.protect_gui(UI_LIBRARY_V2) end)
  34. pcall(function() UI_LIBRARY_V2.Parent = game:GetService('CoreGui') end)
  35. UI_LIBRARY_V2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  36.  
  37. main.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  38. main.Name = 'main'
  39. main.Parent = UI_LIBRARY_V2
  40. main.Position = UDim2.new(0.263059705, 0, 0.240291268, 0)
  41. main.Size = UDim2.new(0, 557, 0, 368)
  42.  
  43. UICorner.CornerRadius = UDim.new(0, 6)
  44. UICorner.Parent = main
  45.  
  46. UIGradient.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(47.000000998378, 47.000000998378, 47.000000998378)), ColorSequenceKeypoint.new(1, Color3.fromRGB(24.000000469387, 24.000000469387, 24.000000469387))})
  47. UIGradient.Rotation = 90
  48. UIGradient.Parent = main
  49.  
  50. sidebar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  51. sidebar.BorderSizePixel = 0
  52. sidebar.Name = 'sidebar'
  53. sidebar.Parent = main
  54. sidebar.Position = UDim2.new(0, 0, 0.0760869533, 0)
  55. sidebar.Size = UDim2.new(0, 101, 0, 340)
  56.  
  57. UIGradient_2.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(35.000001713634, 35.000001713634, 35.000001713634)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0))})
  58. UIGradient_2.Rotation = 90
  59. UIGradient_2.Parent = sidebar
  60.  
  61. UICorner_2.CornerRadius = UDim.new(0, 4)
  62. UICorner_2.Parent = sidebar
  63.  
  64. template.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  65. template.BackgroundTransparency = 1
  66. template.BorderSizePixel = 0
  67. template.Name = 'template'
  68. template.Parent = sidebar
  69. template.Size = UDim2.new(0, 101, 0, 35)
  70. template.Visible = false
  71. template.Font = Enum.Font.Gotham
  72. template.Text = 'TEMPLATE'
  73. template.TextColor3 = Color3.fromRGB(255, 255, 255)
  74. template.TextScaled = true
  75. template.TextSize = 14
  76. template.TextWrapped = true
  77.  
  78. sidebarhandler.Name = 'sidebarhandler'
  79. sidebarhandler.Parent = sidebar
  80.  
  81. UIListLayout.Parent = sidebar
  82. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  83.  
  84. topbar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  85. topbar.BackgroundTransparency = 1
  86. topbar.BorderSizePixel = 0
  87. topbar.Name = 'topbar'
  88. topbar.Parent = main
  89. topbar.Position = UDim2.new(0, 0, 0.00271739066, 0)
  90. topbar.Size = UDim2.new(0, 557, 0, 27)
  91. topbar.Font = Enum.Font.Gotham
  92. topbar.Text = 'GUI_NAME'
  93. topbar.TextColor3 = Color3.fromRGB(255, 255, 255)
  94. topbar.TextScaled = true
  95. topbar.TextSize = 14
  96. topbar.TextWrapped = true
  97.  
  98. closeButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  99. closeButton.BackgroundTransparency = 1
  100. closeButton.BorderSizePixel = 0
  101. closeButton.Name = 'closeButton'
  102. closeButton.Parent = topbar
  103. closeButton.Position = UDim2.new(0.947791815, 0, -0.03515964, 0)
  104. closeButton.Size = UDim2.new(0, 27, 0, 27)
  105. closeButton.Image = 'rbxassetid://6733242294'
  106.  
  107. minimizeButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  108. minimizeButton.BackgroundTransparency = 1
  109. minimizeButton.BorderSizePixel = 0
  110. minimizeButton.Name = 'minimizeButton'
  111. minimizeButton.Parent = topbar
  112. minimizeButton.Position = UDim2.new(0.890792668, 0, -0.0370370373, 0)
  113. minimizeButton.Size = UDim2.new(0, 24, 0, 27)
  114. minimizeButton.Image = 'rbxassetid://6909762377'
  115.  
  116. topsideline.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  117. topsideline.BorderSizePixel = 0
  118. topsideline.Name = 'topsideline'
  119. topsideline.Parent = topbar
  120. topsideline.Position = UDim2.new(0, 0, 0.996130526, 0)
  121. topsideline.Size = UDim2.new(0, 558, 0, 2)
  122.  
  123. handler.Name = 'handler'
  124. handler.Parent = topbar
  125.  
  126. smooth_drag.Name = 'smooth_drag'
  127. smooth_drag.Parent = main
  128.  
  129. rightsideline.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  130. rightsideline.BorderSizePixel = 0
  131. rightsideline.Name = 'rightsideline'
  132. rightsideline.Parent = main
  133. rightsideline.Position = UDim2.new(0.181328535, 0, 0.0760869533, 0)
  134. rightsideline.Size = UDim2.new(0, 2, 0, 341)
  135.  
  136. sections.Active = true
  137. sections.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  138. sections.BackgroundTransparency = 1
  139. sections.BorderSizePixel = 0
  140. sections.Name = 'sections'
  141. sections.Parent = main
  142. sections.Position = UDim2.new(0.184919208, 0, 0.0788043514, 0)
  143. sections.Size = UDim2.new(0, 454, 0, 339)
  144. sections.CanvasSize = UDim2.new(10, 0, 10, 0)
  145. sections.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  146. sections.ScrollBarImageTransparency = 1
  147. sections.ScrollingEnabled = false
  148.  
  149. sectiontemplate.Active = true
  150. sectiontemplate.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  151. sectiontemplate.BackgroundTransparency = 1
  152. sectiontemplate.BorderSizePixel = 0
  153. sectiontemplate.Name = 'sectiontemplate'
  154. sectiontemplate.Parent = sections
  155. sectiontemplate.Position = UDim2.new(0, 0, 0.0930000022, 0)
  156. sectiontemplate.Size = UDim2.new(0, 454, 0, 340)
  157. sectiontemplate.Visible = false
  158. sectiontemplate.CanvasSize = UDim2.new(0, 0, 10, 0)
  159. sectiontemplate.ScrollBarImageColor3 = Color3.fromRGB(0, 0, 0)
  160.  
  161. UIListLayout_2.Parent = sectiontemplate
  162. UIListLayout_2.SortOrder = Enum.SortOrder.LayoutOrder
  163.  
  164. boxtemplate.BackgroundColor3 = Color3.fromRGB(35.000001713634, 35.000001713634, 35.000001713634)
  165. boxtemplate.BorderSizePixel = 0
  166. boxtemplate.Name = 'boxtemplate'
  167. boxtemplate.Parent = sectiontemplate
  168. boxtemplate.Position = UDim2.new(0, 0, 0.19411765, 0)
  169. boxtemplate.Size = UDim2.new(0, 454, 0, 33)
  170. boxtemplate.Visible = false
  171. boxtemplate.Font = Enum.Font.GothamSemibold
  172. boxtemplate.PlaceholderColor3 = Color3.fromRGB(200.00000327826, 200.00000327826, 200.00000327826)
  173. boxtemplate.PlaceholderText = 'box'
  174. boxtemplate.Text = ''
  175. boxtemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
  176. boxtemplate.TextScaled = true
  177. boxtemplate.TextSize = 14
  178. boxtemplate.TextWrapped = true
  179.  
  180. buttontemplate.BackgroundColor3 = Color3.fromRGB(35.000001713634, 35.000001713634, 35.000001713634)
  181. buttontemplate.BorderSizePixel = 0
  182. buttontemplate.Name = 'buttontemplate'
  183. buttontemplate.Parent = sectiontemplate
  184. buttontemplate.Size = UDim2.new(0, 454, 0, 33)
  185. buttontemplate.Visible = false
  186. buttontemplate.Font = Enum.Font.GothamSemibold
  187. buttontemplate.Text = 'button'
  188. buttontemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
  189. buttontemplate.TextScaled = true
  190. buttontemplate.TextSize = 14
  191. buttontemplate.TextWrapped = true
  192.  
  193. dropdowntemplate.BackgroundColor3 = Color3.fromRGB(35.000001713634, 35.000001713634, 35.000001713634)
  194. dropdowntemplate.BorderSizePixel = 0
  195. dropdowntemplate.Name = 'dropdowntemplate'
  196. dropdowntemplate.Parent = sectiontemplate
  197. dropdowntemplate.Size = UDim2.new(0, 454, 0, 33)
  198. dropdowntemplate.Visible = false
  199. dropdowntemplate.Font = Enum.Font.Gotham
  200. dropdowntemplate.Text = 'dropdown'
  201. dropdowntemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
  202. dropdowntemplate.TextScaled = true
  203. dropdowntemplate.TextSize = 14
  204. dropdowntemplate.TextWrapped = true
  205.  
  206. indicator.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  207. indicator.BackgroundTransparency = 1
  208. indicator.BorderSizePixel = 0
  209. indicator.Name = 'indicator'
  210. indicator.Parent = dropdowntemplate
  211. indicator.Position = UDim2.new(0.702643216, 0, 0, 0)
  212. indicator.Size = UDim2.new(0, 30, 0, 30)
  213. indicator.Visible = false
  214. indicator.Font = Enum.Font.Gotham
  215. indicator.Text = '>'
  216. indicator.TextColor3 = Color3.fromRGB(255, 255, 255)
  217. indicator.TextScaled = true
  218. indicator.TextSize = 14
  219. indicator.TextWrapped = true
  220.  
  221. container.Active = true
  222. container.BackgroundColor3 = Color3.fromRGB(25.000000409782, 25.000000409782, 25.000000409782)
  223. container.BorderSizePixel = 0
  224. container.Name = 'container'
  225. container.Parent = dropdowntemplate
  226. container.Position = UDim2.new(0.000102845581, 0, 1, 0)
  227. container.Size = UDim2.new(0, 453, 0, 33)
  228. container.Visible = false
  229. container.CanvasSize = UDim2.new(0, 0, 0, 0)
  230. container.ScrollBarThickness = 4
  231.  
  232. labeltemplate.BackgroundColor3 = Color3.fromRGB(35.000001713634, 35.000001713634, 35.000001713634)
  233. labeltemplate.BorderSizePixel = 0
  234. labeltemplate.Name = 'labeltemplate'
  235. labeltemplate.Parent = sectiontemplate
  236. labeltemplate.Position = UDim2.new(0, 0, 0.0970588252, 0)
  237. labeltemplate.Size = UDim2.new(0, 454, 0, 33)
  238. labeltemplate.Visible = false
  239. labeltemplate.Font = Enum.Font.GothamBold
  240. labeltemplate.Text = 'label'
  241. labeltemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
  242. labeltemplate.TextScaled = true
  243. labeltemplate.TextSize = 14
  244. labeltemplate.TextWrapped = true
  245.  
  246. --attributes
  247.  
  248. --scripts
  249. function sidebar_sidebarhandleraxrma()
  250. local script = sidebarhandler
  251.  
  252. function tween(a,b,c)
  253.         game:GetService'TweenService':Create(a, TweenInfo.new(b, Enum.EasingStyle.Exponential), c):Play()
  254.     end
  255.    
  256.     function added(b)
  257.         if b then
  258.             if b:IsA'TextButton' then
  259.                 if b ~= script.Parent.template then
  260.                     b.MouseButton1Click:connect(function()
  261.                         for a,section in pairs(script.Parent.Parent.sections:GetChildren()) do
  262.                             if section then
  263.                                 if section.Name == b.Name then
  264.                                     tween(section, .3, {Position = UDim2.new(0, 0, 0, 0)})
  265.                                 else
  266.                                     local y = 0
  267.                                     if math.random(1,2) == 1 then
  268.                                         y = -.093
  269.                                     else
  270.                                         y = .093
  271.                                     end
  272.                                     tween(section, .4, {Position = UDim2.new(0, 0, y, 0)})
  273.                                 end
  274.                             end
  275.                         end
  276.                     end)
  277.                 end
  278.             end
  279.         end
  280.     end
  281.    
  282.     for a,b in pairs(script.Parent:GetChildren()) do
  283.         if b then
  284.             added(b)
  285.         end
  286.     end
  287.     script.Parent.ChildAdded:connect(added)
  288.    
  289.     for a,b in pairs(script.Parent.Parent.sections:GetChildren()) do
  290.         if b then
  291.             b.Visible = false
  292.             b.Position = UDim2.new(.082, 0, 0, 0)
  293.         end
  294.     end
  295. end
  296. coroutine.wrap(sidebar_sidebarhandleraxrma)()
  297. function topbar_handleroqfbc()
  298. local script = handler
  299.  
  300. local minimized = false
  301.     function tween(object, _time, info)
  302.         game:GetService'TweenService':Create(object, TweenInfo.new(_time), info):Play()
  303.     end
  304.     function hp(o, v)
  305.         pcall(function() if o[v] then return true else return false end end)
  306.     end
  307.    
  308.     script.Parent.minimizeButton.MouseButton1Click:connect(function()
  309.         minimized = not minimized
  310.         if minimized then
  311.             tween(script.Parent.Parent, .4, {Size=UDim2.new(0, 557, 0, 27)})
  312.             script.Parent.Parent.sidebar.Visible = false
  313.             script.Parent.Parent.rightsideline.Visible = false
  314.             for a,b in pairs(script.Parent.Parent.sections:GetChildren()) do
  315.                 if b then
  316.                     b.Visible = false
  317.                 end
  318.             end
  319.         else
  320.             tween(script.Parent.Parent, .4, {Size=UDim2.new(0, 557, 0, 368)})
  321.             wait(.25)
  322.             script.Parent.Parent.sidebar.Visible = true
  323.             script.Parent.Parent.rightsideline.Visible = true
  324.             for a,b in pairs(script.Parent.Parent.sections:GetChildren()) do
  325.                 if b then
  326.                     b.Visible = true
  327.                 end
  328.             end
  329.         end
  330.     end)
  331.     script.Parent.closeButton.MouseButton1Click:connect(function()
  332.         tween(script.Parent.Parent, .4, {Size=UDim2.new(0, 557, 0, 27)})
  333.         script.Parent.Parent.sidebar.Visible = false
  334.         script.Parent.Parent.rightsideline.Visible = false
  335.         for a,b in pairs(script.Parent.Parent.sections:GetChildren()) do
  336.             if b then
  337.                 b.Visible = false
  338.             end
  339.         end
  340.         wait(.4)
  341.         script.Parent.Parent.Parent:Destroy()
  342.     end)
  343. end
  344. coroutine.wrap(topbar_handleroqfbc)()
  345. function main_smooth_draglgryf()
  346. local script = smooth_drag
  347.  
  348. function dragify(Frame)
  349.         local dragToggle = nil
  350.         local dragSpeed = .25
  351.         local dragInput = nil
  352.         local dragStart = nil
  353.         local dragPos = nil
  354.        
  355.         function updateInput(input)
  356.             local Delta = input.Position - dragStart
  357.             local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
  358.             game:GetService("TweenService"):Create(Frame, TweenInfo.new(.25), {Position = Position}):Play()
  359.         end
  360.        
  361.         Frame.InputBegan:Connect(function(input)
  362.             if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
  363.                 dragToggle = true
  364.                 dragStart = input.Position
  365.                 startPos = Frame.Position
  366.                 input.Changed:Connect(function()
  367.                     if (input.UserInputState == Enum.UserInputState.End) then
  368.                         dragToggle = false
  369.                     end
  370.                 end)
  371.             end
  372.         end)
  373.        
  374.         Frame.InputChanged:Connect(function(input)
  375.             if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  376.                 dragInput = input
  377.             end
  378.         end)
  379.        
  380.         game:GetService("UserInputService").InputChanged:Connect(function(input)
  381.             if input == dragInput and dragToggle then
  382.                 updateInput(input)
  383.             end
  384.         end)   
  385.     end
  386.    
  387.     dragify(script.Parent)
  388. end
  389. coroutine.wrap(main_smooth_draglgryf)()
  390. return {UI_LIBRARY_V2, sectiontemplate, template, topbar}
RAW Paste Data