SimpleScroll.lua
A lightweight, “zero-config” custom scrollbar solution for Roblox.
Custom Scroll is a ModuleScript that replaces the default Roblox scrollbar logic with a custom, highly-configurable alternative. It handles the “annoying” math—like UI padding, top-bar offsets, and multi-axis detection—so you don’t have to.
Features
- Hybrid Directional: One script handles both Vertical and Horizontal scrolling frames.
- Fixed or Dynamic: Toggle whether the scroll handle resizes based on canvas length.
- Padding-Aware: Respects
UIPaddingobjects within your Custom Scroll frame. - Click-to-Jump: Integrated track-click logic to center the bar on your cursor.
- Content Aware adjusts with content of the scrolling frame
Quick Start
Module: https://create.roblox.com/store/asset/70698187510263
- Place the
ScrollServicemodule inReplicatedStorage. - Structure your UI so the Bar(Named Scroll) is a child of the Custom Frame.
- Initialize in a
LocalScript:
local ScrollService = require(game.ReplicatedStorage.ScrollService)
-- Initialize
local myScroll = ScrollService.new(
script.Parent.CustomFrame, -- The background frame
script.Parent.ScrollingFrame, -- The actual list
{
Resize = false, -- Keep bar size fixed?
ScrollSpeed = 50, -- Scrolling sensitivity
ShiftScrollSpeed = 10,
}
)
THIS MODULE’S CREATION WAS ASSISTED BY AI