Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- GUI made by Mawin_CK
- if game.CoreGui:FindFirstChild("My GUI") then
- game.CoreGui:FindFirstChild("My GUI"):Destroy()
- end
- local GUI = Instance.new("ScreenGui", game.CoreGui)
- GUI.Name = "My GUI"
- local mainFM = Instance.new("Frame", GUI)
- mainFM.Name = "My Main frame"
- mainFM.Size = UDim2.new(0, 100, 0, 100)
- mainFM.Position = UDim2.new(0, 0, 0, 0)
- mainFM.BackgroundColor3 = Color3.new(1, 1, 1)
- mainFM.Active = true
- mainFM.Draggable = true
- local mainTI = Instance.new("TextLabel", mainFM)
- mainTI.Name = "My Title"
- mainTI.Size = UDim2.new(0, 100, 0, 20)
- mainTI.Position = UDim2.new(0, 0, 0, 0)
- mainTI.BackgroundColor3 = Color3.new(1, 1, 1)
- mainTI.Text = "Example UI/GUI ScrollingFrame"
- mainTI.TextScaled = true
- mainTI.TextWrapped = true
- local showlist = Instance.new("TextButton", mainFM)
- showlist.Name = "Show List Object"
- showlist.Size = UDim2.new(0, 100, 0, 30)
- showlist.Position = UDim2.new(0, 0, 0, 35)
- showlist.BackgroundColor3 = Color3.fromRGB(31, 255, 0)
- showlist.Text = "Show list Object"
- showlist.TextScaled = true
- showlist.TextWrapped = true
- -- Object Frame
- local ObFM = Instance.new("Frame", GUI)
- ObFM.Size = UDim2.new(0, 150, 0, 150)
- ObFM.Position = UDim2.new(0, 0, 0, 0)
- ObFM.Name = "Object main frame"
- ObFM.BackgroundColor3 = Color3.new(1, 1, 1)
- ObFM.Active = true
- ObFM.Draggable = true
- ObFM.Visible = false
- local ObTitle = Instance.new("TextLabel", ObFM)
- ObTitle.Name = "Title object"
- ObTitle.Size = UDim2.new(0, 150, 0, 30)
- ObTitle.Position = UDim2.new(0, 0, 0, 0)
- ObTitle.BackgroundColor3 = Color3.fromRGB(255, 9, 2)
- ObTitle.Text = "Object List Button"
- ObTitle.TextScaled = true
- ObTitle.TextWrapped = true
- local scroll = Instance.new("ScrollingFrame", ObFM)
- scroll.Size = UDim2.new(0, 150, 0, 100)
- scroll.Position = UDim2.new(0, 0, 0, 30)
- scroll.Name = "Scrolling Main"
- scroll.BackgroundColor3 = Color3.new(1, 1, 1)
- scroll.CanvasSize = UDim2.new(0, 0, 0, 500)
- -- UI GridLayout Setting
- local control = Instance.new("UIGridLayout", scroll)
- control.CellPadding = UDim2.new(0, 0, 0, 0)
- control.Name = "Control UI grid LayOut"
- control.CellSize = UDim2.new(0, 50, 0, 50)
- control.FillDirection = Enum.FillDirection.Horizontal
- control.HorizontalAlignment = Enum.HorizontalAlignment.Left
- control.StartCorner = Enum.StartCorner.TopLeft
- control.VerticalAlignment = Enum.VerticalAlignment.Top
- -- Creation Object Button
- for i = 1, 30 do
- local Object = Instance.new("TextButton", scroll)
- Object.Size = UDim2.new(0, 0, 0, 0)
- Object.Name = "Button " .. i
- Object.Position = UDim2.new(0, 0, 0, 0)
- Object.BackgroundColor3 = Color3.fromRGB(253, 255, 87)
- Object.Text = "Object Button " .. i
- Object.TextScaled = true
- Object.TextWrapped = true
- Object.MouseButton1Click:Connect(function()
- print("Object clicked")
- end)
- end
- -- Final Button Event
- showlist.MouseButton1Click:Connect(function()
- if not ObFM.Visible then
- ObFM.Visible = true
- elseif ObFM.Visible then
- ObFM.Visible = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement