Advertisement
marcelslibrary

UI2

Jul 26th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. local screen = Instance.new("ScreenGui",game:GetService("CoreGui"))
  2. local mainui = {
  3. frames = 0;
  4. buttonsize = 20;
  5. t = true,
  6. }
  7.  
  8. local colors = {
  9. barcolor = Color3.fromRGB(170, 0, 127)
  10. }
  11.  
  12.  
  13.  
  14. function mainui:AddWindow(n,c)
  15. local top = Instance.new("Frame",screen)
  16. local bframe = Instance.new("Frame")
  17. local main = Instance.new("ImageLabel")
  18. local UIListLayout = Instance.new("UIListLayout",main)
  19. local bar = Instance.new("Frame")
  20. local text = Instance.new("TextLabel")
  21. local x = c or 0
  22.  
  23. top.Name = "top"
  24. top.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  25. top.BorderSizePixel = 0
  26. top.Position = UDim2.new(0, 20+(210*self.frames), 0, 15)
  27. top.Size = UDim2.new(0, 201, 0, 39)
  28.  
  29. bframe.Name = "bframe"
  30. bframe.Parent = top
  31. bframe.BackgroundColor3 = Color3.new(0.156863, 0.156863, 0.156863)
  32. bframe.BorderColor3 = Color3.new(0.666667, 0, 0.498039)
  33. bframe.BorderSizePixel = 0
  34. bframe.ClipsDescendants = true
  35. bframe.Position = UDim2.new(-0.00045085547, 0, 0.999999583, 0)
  36. bframe.Size = UDim2.new(0, 201, 0, (self.buttonsize*x))
  37.  
  38. main.Name = "main"
  39. main.Parent = bframe
  40. main.BackgroundColor3 = Color3.new(1, 1, 1)
  41. main.BackgroundTransparency = 1
  42. main.Position = UDim2.new(-7.59143717e-08, 0, -1.12196979e-07, 0)
  43. main.Size = UDim2.new(0, 907, 0, 833)
  44. main.Image = "rbxassetid://3343671401"
  45. main.ImageTransparency = 0.89999997615814
  46.  
  47. bar.Name = "bar"
  48. bar.Parent = top
  49. bar.BackgroundColor3 = Color3.new(0.666667, 0, 0.498039)
  50. bar.BorderSizePixel = 0
  51. bar.Position = UDim2.new(0, 0, 0.923076928, 0)
  52. bar.Size = UDim2.new(0, 201, 0, 3)
  53.  
  54. text.Name = "text"
  55. text.Parent = top
  56. text.BackgroundColor3 = Color3.new(1, 1, 1)
  57. text.BackgroundTransparency = 1
  58. text.Size = UDim2.new(0, 199, 0, 36)
  59. text.Font = Enum.Font.Code
  60. text.Text = n
  61. text.TextColor3 = Color3.new(1, 1, 1)
  62. text.TextSize = 18
  63. self.frames = self.frames +1
  64. return main
  65. end
  66.  
  67. function mainui:AddToggle(txt,p)
  68. local b = Instance.new("TextButton")
  69. local label = Instance.new("TextLabel")
  70.  
  71. b.Name = "b"
  72. b.Parent = p
  73. b.BackgroundTransparency = 1
  74. b.Size = UDim2.new(0, 200, 0, self.buttonsize)
  75. b.Font = Enum.Font.SourceSans
  76. b.Text = txt
  77. b.TextColor3 = Color3.new(1, 1, 1)
  78. b.TextSize = 16
  79. b.TextXAlignment = Enum.TextXAlignment.Left
  80.  
  81. label.Name = "label"
  82. label.Parent = b
  83. label.BackgroundTransparency = 1
  84. label.Position = UDim2.new(0.890547276, 0, 0, 0)
  85. label.Size = UDim2.new(0, 21, 0, 20)
  86. label.Font = Enum.Font.Code
  87. label.Text = "OFF"
  88. label.TextColor3 = Color3.new(1,0,0)
  89. label.TextSize = 14
  90. return b,label
  91. end
  92.  
  93. function mainui:AddBox(t,b,p)
  94. local a = Instance.new("TextBox")
  95.  
  96. a.Name = "a"
  97. a.Parent = p
  98. a.BackgroundColor3 = Color3.new(0.231373, 0.231373, 0.231373)
  99. a.BorderSizePixel = 0
  100. a.BackgroundTransparency = 0.2
  101. a.Size = UDim2.new(0, 201, 0, 20)
  102. a.Font = Enum.Font.SourceSans
  103. a.PlaceholderColor3 = Color3.new(1, 1, 1)
  104. a.Text = t
  105. a.PlaceholderText = b
  106. a.TextColor3 = Color3.new(1, 1, 1)
  107. a.TextSize = 16
  108. a.TextStrokeColor3 = Color3.new(1, 1, 1)
  109. a.TextXAlignment = Enum.TextXAlignment.Left
  110. a.TextTransparency = 0.4
  111. return a
  112. end
  113.  
  114. function mainui:AddButton(txt,p)
  115. local x = Instance.new("TextButton")
  116. x.Name = "x"
  117. x.Parent = p
  118. x.BackgroundTransparency = 1
  119. x.BorderSizePixel = 0
  120. x.Size = UDim2.new(0, 200, 0, 20)
  121. x.Font = Enum.Font.SourceSans
  122. x.Text = txt
  123. x.TextColor3 = Color3.new(1, 1, 1)
  124. x.TextSize = 16
  125. x.TextXAlignment = Enum.TextXAlignment.Left
  126. return x
  127. end
  128.  
  129. function onKeyPress(actionName, userInputState, inputObject)
  130. if userInputState == Enum.UserInputState.Begin then
  131. if mainui.t == false then
  132. mainui.t = true
  133. screen.Enabled = true
  134. else
  135. mainui.t = false
  136. screen.Enabled = false
  137. end
  138. end
  139. end
  140.  
  141. game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.RightShift)
  142.  
  143.  
  144. return mainui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement