Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. config = {
  2. LibName = "Test",
  3. LibText = "Lib Test"
  4. }
  5. local Library = {}
  6.  
  7. function Library:CreateWindow(name)
  8. local uilib = Instance.new("ScreenGui")
  9. local Top = Instance.new("Frame")
  10. local Header = Instance.new("TextLabel")
  11. local Container = Instance.new("Frame")
  12. local ObjHolder = Instance.new("ScrollingFrame")
  13. local UIListLayout = Instance.new("UIListLayout")
  14.  
  15.  
  16. uilib.Name = config.LibName
  17. uilib.Parent = game.CoreGui
  18.  
  19. Top.Name = "Top"
  20. Top.Parent = uilib
  21. Top.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  22. Top.BorderSizePixel = 0
  23. Top.Position = UDim2.new(0.171992481, 0, 0.231075704, 0)
  24. Top.Size = UDim2.new(0, 275, 0, 29)
  25.  
  26. Header.Name = "Header"
  27. Header.Parent = Top
  28. Header.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  29. Header.BackgroundTransparency = 1.000
  30. Header.Size = UDim2.new(0, 275, 0, 29)
  31. Header.Font = Enum.Font.Code
  32. Header.Text = config.LibName
  33. Header.TextColor3 = Color3.fromRGB(255, 255, 255)
  34. Header.TextSize = 14.000
  35.  
  36. Container.Name = "Container"
  37. Container.Parent = Top
  38. Container.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  39. Container.BorderSizePixel = 0
  40. Container.ClipsDescendants = true
  41. Container.Position = UDim2.new(0, 0, 1, 0)
  42. Container.Size = UDim2.new(0, 275, 0, 125)
  43.  
  44. ObjHolder.Name = "ObjHolder"
  45. ObjHolder.Parent = Container
  46. ObjHolder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  47. ObjHolder.BackgroundTransparency = 1.000
  48. ObjHolder.BorderSizePixel = 0
  49. ObjHolder.Size = UDim2.new(0, 275, 0, 125)
  50. ObjHolder.CanvasSize = UDim2.new(0, 0, 5, 0)
  51. ObjHolder.ScrollBarThickness = 1
  52.  
  53. UIListLayout.Parent = ObjHolder
  54. UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  55. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  56. UIListLayout.Padding = UDim.new(0.00499999989, 0)
  57. local Objects = {}
  58. function Objects:AddBtn(text, name, font,func)
  59. local ButtonTemplate = Instance.new("TextButton")
  60. ButtonTemplate.Name = name
  61. ButtonTemplate.Parent = ObjHolder
  62. ButtonTemplate.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  63. ButtonTemplate.BorderSizePixel = 0
  64. ButtonTemplate.Position = UDim2.new(0.00800000038, 0, 0.282999992, 0)
  65. ButtonTemplate.Size = UDim2.new(0, 248, 0, 31)
  66. ButtonTemplate.AutoButtonColor = false
  67. ButtonTemplate.Font = font or Enum.Font.ArialBold
  68. ButtonTemplate.Text = text
  69. ButtonTemplate.TextColor3 = Color3.fromRGB(255, 255, 255)
  70. ButtonTemplate.TextSize = 14.000
  71.  
  72. ButtonTemplate.MouseButton1Click:Connect(function()
  73. func()
  74. end)
  75. end
  76.  
  77. function Objects:AddSection(text, name, font)
  78. local SectionLabel = Instance.new("TextLabel")
  79.  
  80. SectionLabel.Name = "SectionLabel"
  81. SectionLabel.Parent = ObjHolder
  82. SectionLabel.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
  83. SectionLabel.BorderSizePixel = 0
  84. SectionLabel.Position = UDim2.new(0.00800000038, 0, 0, 0)
  85. SectionLabel.Size = UDim2.new(0, 248, 0, 31)
  86. SectionLabel.Font = font or Enum.Font.GothamSemibold
  87. SectionLabel.Text = "Test Section"
  88. SectionLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  89. SectionLabel.TextSize = 14.000
  90.  
  91. end
  92.  
  93. return Objects;
  94.  
  95. end
  96.  
  97. return Library;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement