Advertisement
marcelslibrary

UI

Jul 20th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.47 KB | None | 0 0
  1. local TS = game:GetService("TweenService")
  2. local MainUI = {
  3. windows = 0,
  4. }
  5.  
  6.  
  7. local Colors = {
  8. BarColorTo = {BackgroundColor3 = Color3.fromRGB(170, 0, 255)},
  9. BarColorFrom = {BackgroundColor3 = Color3.fromRGB(85, 0, 255)},
  10. BarDefault = Color3.fromRGB(85, 0, 255),
  11. }
  12.  
  13.  
  14. function MainUI:CreateScreenGui(name,enabled)
  15. local k = Instance.new("ScreenGui",game.CoreGui)
  16. k.Enabled = enabled
  17. if name == true then
  18. k.Name = game:GetService("HttpService"):GenerateGUID(false)
  19. end
  20. return k
  21. end
  22.  
  23. function MainUI:CreateWindow(textt,tweentrue,barcolor,colorto,colorfrom,buttons,parent)
  24. local topframe = Instance.new("Frame",parent)
  25. local clipframe = Instance.new("Frame",topframe)
  26. local buttonframe = Instance.new("Frame",clipframe)
  27. local UIListLayout = Instance.new("UIListLayout",buttonframe)
  28. local bar = Instance.new("Frame",topframe)
  29. local text = Instance.new("TextLabel",topframe)
  30. local Minimize = Instance.new("TextButton",topframe)
  31.  
  32. topframe.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  33. topframe.BorderSizePixel = 0
  34. topframe.Position = UDim2.new((0.0193106737 + (self.windows * 0.130)), 0, 0.0737100765, 0)
  35. topframe.Size = UDim2.new(0, 229, 0, 34)
  36.  
  37. clipframe.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  38. clipframe.BackgroundTransparency = 1
  39. clipframe.BorderSizePixel = 0
  40. clipframe.ClipsDescendants = true
  41. clipframe.Position = UDim2.new(-0.000678863376, 0, 0.989352942, 0)
  42. clipframe.Size = UDim2.new(0, 229, 0, 700)
  43.  
  44. buttonframe.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  45. buttonframe.BorderSizePixel = 0
  46. buttonframe.Size = UDim2.new(0, 229, 0, (20*buttons))
  47.  
  48. bar.BackgroundColor3 = barcolor
  49. bar.BorderSizePixel = 0
  50. bar.Position = UDim2.new(0, 0, 0.916666687, 0)
  51. bar.Size = UDim2.new(0, 229, 0, 3)
  52.  
  53. text.BackgroundColor3 = Color3.new(1, 1, 1)
  54. text.BackgroundTransparency = 1
  55. text.BorderSizePixel = 0
  56. text.Position = UDim2.new(0, 0, 0.0755656064, 0)
  57. text.Size = UDim2.new(0, 228, 0, 28)
  58. text.Font = Enum.Font.SourceSansBold
  59. text.Text = textt
  60. text.TextColor3 = Color3.new(1, 1, 1)
  61. text.TextSize = 18
  62.  
  63. Minimize.BackgroundColor3 = Color3.new(1, 1, 1)
  64. Minimize.BackgroundTransparency = 1
  65. Minimize.Position = UDim2.new(0.903930187, 0, 0.0588235296, 0)
  66. Minimize.Size = UDim2.new(0, 20, 0, 20)
  67. Minimize.Font = Enum.Font.SourceSansBold
  68. Minimize.Text = "-"
  69. Minimize.TextColor3 = Color3.new(1, 1, 1)
  70. Minimize.TextSize = 24
  71.  
  72.  
  73.  
  74. toggle = false
  75. Minimize.MouseButton1Click:connect(function()
  76. if toggle == false then
  77. toggle = true
  78. Minimize.Text = "+"
  79. buttonframe:TweenPosition(UDim2.new(0, 0,-1, 0),"Out","Elastic",1)
  80. else
  81. toggle = false
  82. Minimize.Text = "-"
  83. buttonframe:TweenPosition(UDim2.new(0, 0,0, 0),"Out","Quad",1)
  84. end
  85. end)
  86.  
  87.  
  88. spawn(function()
  89. while wait(3) do
  90. if tweentrue == true then
  91. local info = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut)
  92. local to = TS:Create(bar,info,{BackgroundColor3 = colorto})
  93. local from = TS:Create(bar,info,{BackgroundColor3 = colorfrom})
  94. to:Play()
  95. wait(3)
  96. from:Play()
  97. end
  98. end
  99. end)
  100.  
  101. self.windows = self.windows+1
  102. return buttonframe
  103. end
  104.  
  105. function MainUI:AddToggle(text,frame)
  106. local togglebutton = Instance.new("TextButton",frame)
  107. local toggle = Instance.new("TextLabel",togglebutton)
  108.  
  109. togglebutton.BackgroundColor3 = Color3.new(1, 1, 1)
  110. togglebutton.BackgroundTransparency = 1
  111. togglebutton.BorderSizePixel = 0
  112. togglebutton.Size = UDim2.new(0, 229, 0, 20)
  113. togglebutton.Font = Enum.Font.SourceSans
  114. togglebutton.Text = text
  115. togglebutton.TextColor3 = Color3.new(1, 1, 1)
  116. togglebutton.TextSize = 16
  117. togglebutton.TextXAlignment = Enum.TextXAlignment.Left
  118.  
  119. toggle.BackgroundColor3 = Color3.new(1, 1, 1)
  120. toggle.BackgroundTransparency = 1
  121. toggle.Position = UDim2.new(0.890829742, 0, 0, 0)
  122. toggle.Size = UDim2.new(0, 23, 0, 20)
  123. toggle.Font = Enum.Font.SourceSans
  124. toggle.Text = "OFF"
  125. toggle.TextColor3 = Color3.new(1, 0, 0)
  126. toggle.TextSize = 14
  127.  
  128. return togglebutton,toggle
  129. end
  130.  
  131. function MainUI:AddBox(text,backtext,frame)
  132. local box = Instance.new("TextBox",frame)
  133. box.BackgroundColor3 = Color3.new(0.333333, 0.333333, 0.333333)
  134. box.BorderSizePixel = 0
  135. box.Size = UDim2.new(0, 229, 0, 20)
  136. box.Font = Enum.Font.SourceSans
  137. box.PlaceholderText = backtext
  138. box.Text = text
  139. box.TextColor3 = Color3.new(1, 1, 1)
  140. box.TextSize = 16
  141. box.TextXAlignment = Enum.TextXAlignment.Left
  142. return box
  143. end
  144.  
  145. function MainUI:AddButton(text,frame)
  146. local button = Instance.new("TextButton",frame)
  147. button.BackgroundColor3 = Color3.new(1, 1, 1)
  148. button.BackgroundTransparency = 1
  149. button.BorderSizePixel = 0
  150. button.Size = UDim2.new(0, 229, 0, 20)
  151. button.Font = Enum.Font.SourceSans
  152. button.Text = text
  153. button.TextColor3 = Color3.new(1, 1, 1)
  154. button.TextSize = 16
  155. button.TextXAlignment = Enum.TextXAlignment.Left
  156. return button
  157. end
  158.  
  159. function MainUI:AddLabel(text,size,textsize,frame)
  160. local x = Instance.new("TextLabel",frame)
  161. x.BackgroundColor3 = Color3.new(1, 1, 1)
  162. x.BackgroundTransparency = 1
  163. x.BorderSizePixel = 0
  164. x.Size = UDim2.new(0, 227, 0, size)
  165. x.Font = Enum.Font.SourceSans
  166. x.Text = text
  167. x.TextColor3 = Color3.new(1, 1, 1)
  168. if textsize == nil then
  169. x.TextSize = 16
  170. else
  171. x.TextSize = textsize
  172. end
  173. x.TextXAlignment = Enum.TextXAlignment.Left
  174. return x
  175. end
  176.  
  177. return MainUI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement