Advertisement
ScriptyPastes

UI lib

Apr 1st, 2020
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. --ui v2
  2.  
  3. local lib = {
  4. ToggleOn = Color3.fromRGB(40, 255, 40),
  5. ToggleOff = Color3.fromRGB(255, 40, 40)
  6. }
  7.  
  8. local count = 0
  9.  
  10. function lib:Frame(Name)
  11. count=count+1
  12. local mainui = Instance.new("ScreenGui")
  13. local Top = Instance.new("Frame")
  14. local Container = Instance.new("Frame")
  15. local name = Instance.new("TextLabel")
  16. local UIListLayout = Instance.new("UIListLayout")
  17.  
  18. for i,v in pairs(game.CoreGui.RobloxGui:GetChildren()) do
  19. if i == math.random(1,5) then
  20. mainui.Parent = v
  21. break;
  22. end
  23. end
  24.  
  25. Top.Name = "Top"
  26. Top.Parent = mainui
  27. Top.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  28. Top.BorderColor3 = Color3.new(0.152941, 1, 0.34902)
  29. Top.BorderSizePixel = 1
  30. Top.Position = UDim2.new(0.0343383588 + (count*.1), 0, 0.0679886714, 0)
  31. Top.Size = UDim2.new(0, 170, 0, 30)
  32. Top.Active = true
  33. Top.Draggable = true
  34.  
  35. Container.Name = "Container"
  36. Container.Parent = Top
  37. Container.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
  38. Container.BorderColor3 = Color3.new(0.152941, 1, 0.34902)
  39. Container.BorderSizePixel = 1
  40. Container.Position = UDim2.new(-0.000955760479, 0, 0.983205199, 0)
  41. Container.Size = UDim2.new(0, 170, 0, 150)
  42.  
  43. UIListLayout.Parent = Container
  44. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  45.  
  46. name.Name = "name"
  47. name.Parent = Top
  48. name.BackgroundColor3 = Color3.new(1, 1, 1)
  49. name.BackgroundTransparency = 1
  50. name.Size = UDim2.new(0, 169, 0, 30)
  51. name.Font = Enum.Font.SourceSans
  52. name.TextColor3 = Color3.new(1, 1, 1)
  53. name.Text = Name
  54. name.TextSize = 20
  55.  
  56.  
  57. local lib2 = {buttons = 0}
  58.  
  59. function lib2:Toggle(text, variable)
  60. lib2.buttons=lib2.buttons+1
  61. Container.Size = UDim2.new(0, 170, 0, 28*lib2.buttons)
  62. local lol = Instance.new("TextLabel")
  63. local togglebtn = Instance.new("TextButton")
  64.  
  65. lol.Name = "lol"
  66. lol.Parent = Container
  67. lol.BackgroundColor3 = Color3.new(1, 1, 1)
  68. lol.BackgroundTransparency = 1
  69. lol.Size = UDim2.new(0, 126, 0, 28)
  70. lol.Font = Enum.Font.Code
  71. lol.TextColor3 = Color3.new(1, 1, 1)
  72. lol.TextSize = 20
  73. lol.Text = text
  74. togglebtn.Name = "togglebtn"
  75. togglebtn.Parent = lol
  76. togglebtn.BackgroundColor3 = Color3.new(1, 0.156863, 0.156863)
  77. togglebtn.BorderSizePixel = 0
  78. togglebtn.Position = UDim2.new(0.995144784, 0, 0.00335884094, 0)
  79. togglebtn.Size = UDim2.new(0, 44, 0, 28)
  80. togglebtn.Font = Enum.Font.SourceSans
  81. togglebtn.Text = ""
  82. togglebtn.TextColor3 = Color3.new(0, 0, 0)
  83. togglebtn.TextSize = 14
  84. togglebtn.MouseButton1Down:Connect(function()
  85. --pcall(function()
  86. _G.tggle[variable] = not _G.tggle[variable]
  87. print(_G.tggle[variable])
  88. if _G.tggle[variable] == true then
  89. togglebtn.BackgroundColor3 = lib.ToggleOn
  90. else
  91. togglebtn.BackgroundColor3 = lib.ToggleOff
  92. end
  93. --end)
  94. end)
  95. end
  96.  
  97. function lib2:Button(text, callback)
  98. lib2.buttons=lib2.buttons+1
  99. local TextButton = Instance.new("TextButton")
  100. Container.Size = UDim2.new(0, 170, 0, 28*lib2.buttons)
  101. TextButton.Parent = Container
  102. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  103. TextButton.Size = UDim2.new(0, 170, 0, 28)
  104. TextButton.BackgroundTransparency = 1
  105. TextButton.Font = Enum.Font.SourceSans
  106. TextButton.TextColor3 = Color3.new(1, 1, 1)
  107. TextButton.MouseButton1Down:Connect(callback)
  108. TextButton.TextSize = 17
  109. TextButton.Text = text
  110. end
  111. return lib2
  112. end
  113. return lib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement