0% found this document useful (0 votes)
26 views2 pages

Scriik

The document outlines a Lua script for creating a scrollable user interface in Roblox, featuring a scroll area and navigation arrows. It sets up a ScreenGui with a ScrollContainer that includes an UpArrow and BottomArrow for scrolling functionality. The script also dynamically generates 50 text labels within the scroll area, allowing users to scroll through the content using the arrow buttons.

Uploaded by

akeliousreavis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Scriik

The document outlines a Lua script for creating a scrollable user interface in Roblox, featuring a scroll area and navigation arrows. It sets up a ScreenGui with a ScrollContainer that includes an UpArrow and BottomArrow for scrolling functionality. The script also dynamically generates 50 text labels within the scroll area, allowing users to scroll through the content using the arrow buttons.

Uploaded by

akeliousreavis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

-- Instances:

local ScreenGui = Instance.new("ScreenGui")


local ScrollContainer = Instance.new("Frame")
local ScrollArea = Instance.new("ScrollingFrame")
local UpArrow = Instance.new("TextButton")
local BottomArrow = Instance.new("TextButton")

-- Parent Setup:
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

-- Scroll Container (Holds the ScrollArea & Arrows)


ScrollContainer.Name = "ScrollContainer"
ScrollContainer.Parent = ScreenGui
ScrollContainer.BackgroundColor3 = Color3.fromRGB(240, 240, 240) -- Background
color
ScrollContainer.BorderSizePixel = 0
ScrollContainer.Position = UDim2.new(0.4, 0, 0.3, 0)
ScrollContainer.Size = UDim2.new(0, 320, 0, 420)

-- Up Arrow (Fixed Position)


UpArrow.Name = "UpArrow"
UpArrow.Parent = ScrollContainer
UpArrow.BackgroundTransparency = 1
UpArrow.Position = UDim2.new(1, -22, 0, 0) -- Stays at the top inside the container
UpArrow.Size = UDim2.new(0, 18, 0, 15)
UpArrow.Font = Enum.Font.SourceSans
UpArrow.Text = "▲"
UpArrow.TextColor3 = Color3.fromRGB(96, 96, 96)
UpArrow.TextSize = 14

-- Scroll Area (Now correctly inside the container below the arrow)
ScrollArea.Name = "ScrollArea"
ScrollArea.Parent = ScrollContainer
ScrollArea.BackgroundColor3 = Color3.fromRGB(240, 240, 240)
ScrollArea.BorderSizePixel = 0
ScrollArea.Position = UDim2.new(0, 0, 0, 15) -- Positioned below UpArrow
ScrollArea.Size = UDim2.new(0, 300, 0, 390) -- Fits inside the container, leaving
space for arrows
ScrollArea.CanvasSize = UDim2.new(0, 0, 3, 0) -- Allows scrolling
ScrollArea.ScrollBarThickness = 17
ScrollArea.ScrollBarImageColor3 = Color3.fromRGB(205, 205, 205) -- Scroll bar color
ScrollArea.VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar
ScrollArea.ScrollBarImageTransparency = 0 -- Makes it fully visible

-- Make ScrollBar Rectangular


ScrollArea:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
local scrollbar = ScrollArea:FindFirstChildOfClass("UIStroke") or
Instance.new("UIStroke")
scrollbar.Parent = ScrollArea
scrollbar.Thickness = 0 -- Removes any unwanted thickness
scrollbar.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
end)

-- Bottom Arrow (Fixed Position)


BottomArrow.Name = "BottomArrow"
BottomArrow.Parent = ScrollContainer
BottomArrow.BackgroundTransparency = 1
BottomArrow.Position = UDim2.new(1, -22, 1, -15) -- Stays at the bottom inside the
container
BottomArrow.Size = UDim2.new(0, 18, 0, 15)
BottomArrow.Font = Enum.Font.SourceSans
BottomArrow.Text = "▼"
BottomArrow.TextColor3 = Color3.fromRGB(96, 96, 96)
BottomArrow.TextSize = 14

-- Example content inside ScrollArea:


for i = 1, 50 do
local TextLabel = Instance.new("TextLabel")
TextLabel.Parent = ScrollArea
TextLabel.Size = UDim2.new(1, -20, 0, 30)
TextLabel.Position = UDim2.new(0, 5, 0, (i - 1) * 35)
TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
TextLabel.TextSize = 16
TextLabel.Text = "Line " .. i
end

-- Arrow Functionality (Scrolls when clicked)


UpArrow.MouseButton1Click:Connect(function()
ScrollArea.CanvasPosition = ScrollArea.CanvasPosition - Vector2.new(0, 50) --
Scroll up
end)

BottomArrow.MouseButton1Click:Connect(function()
ScrollArea.CanvasPosition = ScrollArea.CanvasPosition + Vector2.new(0, 50) --
Scroll down
end)

You might also like