Advertisement
SigmaBoy456

Roblox scrolling Frame GUI ex #7329

Oct 1st, 2024
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. -- GUI made by Mawin_CK
  2. if game.CoreGui:FindFirstChild("My GUI") then
  3. game.CoreGui:FindFirstChild("My GUI"):Destroy()
  4. end
  5.  
  6. local GUI = Instance.new("ScreenGui", game.CoreGui)
  7. GUI.Name = "My GUI"
  8. local mainFM = Instance.new("Frame", GUI)
  9. mainFM.Name = "My Main frame"
  10. mainFM.Size = UDim2.new(0, 100, 0, 100)
  11. mainFM.Position = UDim2.new(0, 0, 0, 0)
  12. mainFM.BackgroundColor3 = Color3.new(1, 1, 1)
  13. mainFM.Active = true
  14. mainFM.Draggable = true
  15. local mainTI = Instance.new("TextLabel", mainFM)
  16. mainTI.Name = "My Title"
  17. mainTI.Size = UDim2.new(0, 100, 0, 20)
  18. mainTI.Position = UDim2.new(0, 0, 0, 0)
  19. mainTI.BackgroundColor3 = Color3.new(1, 1, 1)
  20. mainTI.Text = "Example UI/GUI ScrollingFrame"
  21. mainTI.TextScaled = true
  22. mainTI.TextWrapped = true
  23. local showlist = Instance.new("TextButton", mainFM)
  24. showlist.Name = "Show List Object"
  25. showlist.Size = UDim2.new(0, 100, 0, 30)
  26. showlist.Position = UDim2.new(0, 0, 0, 35)
  27. showlist.BackgroundColor3 = Color3.fromRGB(31, 255, 0)
  28. showlist.Text = "Show list Object"
  29. showlist.TextScaled = true
  30. showlist.TextWrapped = true
  31. -- Object Frame
  32. local ObFM = Instance.new("Frame", GUI)
  33. ObFM.Size = UDim2.new(0, 150, 0, 150)
  34. ObFM.Position = UDim2.new(0, 0, 0, 0)
  35. ObFM.Name = "Object main frame"
  36. ObFM.BackgroundColor3 = Color3.new(1, 1, 1)
  37. ObFM.Active = true
  38. ObFM.Draggable = true
  39. ObFM.Visible = false
  40. local ObTitle = Instance.new("TextLabel", ObFM)
  41. ObTitle.Name = "Title object"
  42. ObTitle.Size = UDim2.new(0, 150, 0, 30)
  43. ObTitle.Position = UDim2.new(0, 0, 0, 0)
  44. ObTitle.BackgroundColor3 = Color3.fromRGB(255, 9, 2)
  45. ObTitle.Text = "Object List Button"
  46. ObTitle.TextScaled = true
  47. ObTitle.TextWrapped = true
  48. local scroll = Instance.new("ScrollingFrame", ObFM)
  49. scroll.Size = UDim2.new(0, 150, 0, 100)
  50. scroll.Position = UDim2.new(0, 0, 0, 30)
  51. scroll.Name = "Scrolling Main"
  52. scroll.BackgroundColor3 = Color3.new(1, 1, 1)
  53. scroll.CanvasSize = UDim2.new(0, 0, 0, 500)
  54. -- UI GridLayout Setting
  55. local control = Instance.new("UIGridLayout", scroll)
  56. control.CellPadding = UDim2.new(0, 0, 0, 0)
  57. control.Name = "Control UI grid LayOut"
  58. control.CellSize = UDim2.new(0, 50, 0, 50)
  59. control.FillDirection = Enum.FillDirection.Horizontal
  60. control.HorizontalAlignment = Enum.HorizontalAlignment.Left
  61. control.StartCorner = Enum.StartCorner.TopLeft
  62. control.VerticalAlignment = Enum.VerticalAlignment.Top
  63. -- Creation Object Button
  64. for i = 1, 30 do
  65. local Object = Instance.new("TextButton", scroll)
  66. Object.Size = UDim2.new(0, 0, 0, 0)
  67. Object.Name = "Button " .. i
  68. Object.Position = UDim2.new(0, 0, 0, 0)
  69. Object.BackgroundColor3 = Color3.fromRGB(253, 255, 87)
  70. Object.Text = "Object Button " .. i
  71. Object.TextScaled = true
  72. Object.TextWrapped = true
  73. Object.MouseButton1Click:Connect(function()
  74. print("Object clicked")
  75. end)
  76. end
  77.  
  78. -- Final Button Event
  79. showlist.MouseButton1Click:Connect(function()
  80. if not ObFM.Visible then
  81. ObFM.Visible = true
  82. elseif ObFM.Visible then
  83. ObFM.Visible = false
  84. end
  85. end)
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement