-- Original Obby UI starter. LocalScript in StarterPlayer > StarterPlayerScripts.
-- Documentation-reviewed and mock-checked; not rendered in Roblox Studio for this guide.
-- Local demonstration only. No purchases, rewards, persistence, or remote modules.
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local GUI_NAME = "ObbyTemplateReading"
if playerGui:FindFirstChild(GUI_NAME) then warn(GUI_NAME .. " already exists; keep one copy") return end
local gui = Instance.new("ScreenGui")
gui.Name = GUI_NAME
gui.ResetOnSpawn = false
local panel = Instance.new("ScrollingFrame")
panel.Name = "Panel"
panel.AnchorPoint = Vector2.new(0.5, 0.5)
panel.Position = UDim2.fromScale(0.5, 0.5)
panel.Size = UDim2.new(1, -32, 1, -32)
panel.BackgroundColor3 = Color3.fromRGB(245, 249, 247)
panel.BorderSizePixel = 0
panel.ScrollBarThickness = 4
panel.AutomaticCanvasSize = Enum.AutomaticSize.Y
panel.CanvasSize = UDim2.fromOffset(0, 0)
panel.Parent = gui
local limit = Instance.new("UISizeConstraint")
limit.MaxSize = Vector2.new(460, 460)
limit.Parent = panel
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 16)
corner.Parent = panel
local padding = Instance.new("UIPadding")
padding.PaddingTop = UDim.new(0, 20)
padding.PaddingBottom = UDim.new(0, 20)
padding.PaddingLeft = UDim.new(0, 20)
padding.PaddingRight = UDim.new(0, 20)
padding.Parent = panel
local layout = Instance.new("UIListLayout")
layout.Padding = UDim.new(0, 12)
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.Parent = panel
local order = 0
local function add(class, name, height)
    order = order + 1
    local item = Instance.new(class)
    item.Name = name
    item.Size = UDim2.new(1, 0, 0, height)
    item.LayoutOrder = order
    item.Parent = panel
    return item
end
local function label(name, text, height, size)
    local item = add("TextLabel", name, height)
    item.AutomaticSize = Enum.AutomaticSize.Y
    item.BackgroundTransparency = 1
    item.TextColor3 = Color3.fromRGB(30, 67, 54)
    item.Font = Enum.Font.Gotham
    item.TextSize = size or 16
    item.TextXAlignment = Enum.TextXAlignment.Left
    item.TextWrapped = true
    item.Text = text
    return item
end
local function button(name, text)
    local item = add("TextButton", name, 44)
    item.BackgroundColor3 = Color3.fromRGB(30, 67, 54)
    item.TextColor3 = Color3.fromRGB(255, 255, 255)
    item.BorderSizePixel = 0
    item.Font = Enum.Font.Gotham
    item.TextSize = 16
    item.TextWrapped = true
    item.Text = text
    local round = Instance.new("UICorner")
    round.CornerRadius = UDim.new(0, 8)
    round.Parent = item
    return item
end
label("Title", "Reading preferences", 36, 24)
label("Note", "These controls change only the sample text below, for this session.", 56)
local sample = label("Sample", "Find the lantern beside the trail.", 88, 16)
local small = button("SmallButton", "Text size: 16")
local medium = button("MediumButton", "Text size: 20")
local large = button("LargeButton", "Text size: 24")
local contrast = button("ContrastButton", "High contrast: off")
local reset = button("ResetButton", "Reset preferences")
local highContrast = false
local function renderContrast()
    sample.BackgroundTransparency = highContrast and 0 or 1
    sample.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    sample.TextColor3 = highContrast and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(30, 67, 54)
    contrast.Text = highContrast and "High contrast: on" or "High contrast: off"
end
small.Activated:Connect(function() sample.TextSize = 16 end)
medium.Activated:Connect(function() sample.TextSize = 20 end)
large.Activated:Connect(function() sample.TextSize = 24 end)
contrast.Activated:Connect(function() highContrast = not highContrast renderContrast() end)
reset.Activated:Connect(function() sample.TextSize = 16 highContrast = false renderContrast() end)
renderContrast()
gui.Parent = playerGui
