Advertisement
matekaOSF2

ResLIB

Jul 17th, 2020 (edited)
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. local library = {
  2. windowcount = 0
  3. }
  4.  
  5. function library:CreateWindow(text)
  6. local Container = Instance.new("ScreenGui")
  7. local Disz = Instance.new("Frame")
  8. local Title = Instance.new("TextLabel")
  9. local OpenClose = Instance.new("TextButton")
  10. local Window = Instance.new("Frame")
  11. local UIPadding = Instance.new("UIPadding")
  12. local UIListLayout = Instance.new("UIListLayout")
  13.  
  14. Container.Name = "Container"
  15. Container.Parent = game.CoreGui
  16. Container.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  17.  
  18. Disz.Name = "Disz"
  19. Disz.Parent = Container
  20. Disz.BackgroundColor3 = Color3.new(0.105882, 0.105882, 0.105882)
  21. Disz.BorderSizePixel = 0
  22. Disz.Position = UDim2.new(0, (15 + ((200 * library.windowcount) - 200)), 0, 15)
  23. Disz.Size = UDim2.new(0, 160, 0, 25)
  24.  
  25. Title.Name = "Title"
  26. Title.Parent = Disz
  27. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  28. Title.BackgroundTransparency = 1
  29. Title.Size = UDim2.new(0, 160, 0, 25)
  30. Title.Font = Enum.Font.GothamBold
  31. Title.Text = text
  32. Title.TextColor3 = Color3.new(1, 1, 1)
  33. Title.TextScaled = true
  34. Title.TextSize = 14
  35. Title.TextWrapped = true
  36.  
  37. OpenClose.Name = "OpenClose"
  38. OpenClose.Parent = Disz
  39. OpenClose.BackgroundColor3 = Color3.new(1, 1, 1)
  40. OpenClose.BackgroundTransparency = 1
  41. OpenClose.Position = UDim2.new(0.806249976, 0, 0, 0)
  42. OpenClose.Size = UDim2.new(0, 31, 0, 25)
  43. OpenClose.Font = Enum.Font.Cartoon
  44. OpenClose.Text = "-"
  45. OpenClose.TextColor3 = Color3.new(1, 1, 1)
  46. OpenClose.TextScaled = true
  47. OpenClose.TextSize = 14
  48. OpenClose.TextWrapped = true
  49. OpenClose.MouseButton1Click:Connect(function()
  50. if Window.Visible == true then
  51. Window.Visible = false
  52. OpenClose.Text = "+"
  53. else
  54. Window.Visible = true
  55. OpenClose.Text = "-"
  56. end
  57. end)
  58.  
  59. Window.Name = "Window"
  60. Window.Parent = Disz
  61. Window.BackgroundColor3 = Color3.new(0.133333, 0.133333, 0.133333)
  62. Window.BorderSizePixel = 0
  63. Window.Position = UDim2.new(-0.00229400396, 0, 0.967330694, 0)
  64. Window.Size = UDim2.new(0, 160, 0, 26)
  65.  
  66. UIPadding.Parent = Window
  67. UIPadding.PaddingLeft = UDim.new(0, 2)
  68.  
  69. UIListLayout.Parent = Window
  70. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  71.  
  72. local epicLibrary = {}
  73.  
  74. function epicLibrary:CreateButton(text, callback)
  75. text = text or "New Button"
  76. callback = callback or function() end
  77. local NewButton = Instance.new("TextButton")
  78.  
  79. NewButton.Name = text
  80. NewButton.Parent = Window
  81. NewButton.BackgroundColor3 = Color3.new(1, 1, 1)
  82. NewButton.BackgroundTransparency = 1
  83. NewButton.Position = UDim2.new(0, 0, 0.114035085, 0)
  84. NewButton.Size = UDim2.new(0, 160, 0, 26)
  85. NewButton.Font = Enum.Font.GothamBold
  86. NewButton.Text = text
  87. NewButton.TextColor3 = Color3.new(1, 1, 1)
  88. NewButton.TextSize = 14
  89. NewButton.MouseButton1Click:Connect(callback)
  90. end
  91.  
  92. function epicLibrary:CreateToggle(text, callback)
  93. text = text or "New Toggle"
  94. callback = callback or function() end
  95. local flag = false
  96. local NewToggle = Instance.new("TextLabel")
  97. local Frame = Instance.new("Frame")
  98. local TextButton = Instance.new("TextButton")
  99. local UITextSizeConstraint = Instance.new("UITextSizeConstraint")
  100.  
  101. NewToggle.Name = text
  102. NewToggle.Parent = Window
  103. NewToggle.BackgroundColor3 = Color3.new(1, 1, 1)
  104. NewToggle.BackgroundTransparency = 1
  105. NewToggle.Size = UDim2.new(0, 129, 0, 26)
  106. NewToggle.Font = Enum.Font.GothamBold
  107. NewToggle.TextColor3 = Color3.new(1, 1, 1)
  108. NewToggle.TextSize = 14
  109. NewToggle.Text = text
  110. NewToggle.TextWrapped = true
  111. NewToggle.TextXAlignment = Enum.TextXAlignment.Left
  112.  
  113. Frame.Parent = NewToggle
  114. Frame.BackgroundColor3 = Color3.new(0.101961, 0.101961, 0.101961)
  115. Frame.BorderSizePixel = 0
  116. Frame.Position = UDim2.new(1.04700005, 0, 0.209999993, 0)
  117. Frame.Size = UDim2.new(0, 18, 0, 17)
  118.  
  119. TextButton.Parent = Frame
  120. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  121. TextButton.BackgroundTransparency = 1
  122. TextButton.Position = UDim2.new(-8.4771051e-07, 0, -4.48787915e-07, 0)
  123. TextButton.Size = UDim2.new(0, 18, 0, 17)
  124. TextButton.Font = Enum.Font.SourceSans
  125. TextButton.Text = ""
  126. TextButton.TextColor3 = Color3.new(0, 0, 0)
  127. TextButton.TextSize = 14
  128. TextButton.MouseButton1Down:Connect(function()
  129. if flag then
  130. flag = false
  131. Frame.BackgroundColor3 = Color3.new(1, 0.0313726, 0)
  132. else
  133. flag = true
  134. Frame.BackgroundColor3 = Color3.new(0.101961, 0.101961, 0.101961)
  135. end
  136. end)
  137.  
  138. while wait() do
  139. if flag then
  140. callback();
  141. end
  142. end
  143.  
  144. UITextSizeConstraint.Parent = NewToggle
  145. UITextSizeConstraint.MaxTextSize = 18
  146. UITextSizeConstraint.MinTextSize = 18
  147. end
  148.  
  149. return epicLibrary
  150. end
  151.  
  152. return library
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement