-- 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 = "ObbyTemplateQuest"
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", "Star fragment quest", 36, 24)
label("Note", "Local UI demo. The button simulates progress; it awards nothing.", 56)
local progress = label("Progress", "Fragments: 0 / 3", 36, 20)
local track = add("Frame", "Track", 18)
track.BorderSizePixel = 0
track.BackgroundColor3 = Color3.fromRGB(208, 224, 216)
local fill = Instance.new("Frame")
fill.Name = "Fill"
fill.BorderSizePixel = 0
fill.BackgroundColor3 = Color3.fromRGB(204, 122, 44)
fill.Size = UDim2.fromScale(0, 1)
fill.Parent = track
local addButton = button("AddButton", "Simulate one fragment")
local resetButton = button("ResetButton", "Reset progress")
local count = 0
local function render()
    progress.Text = "Fragments: " .. count .. " / 3"
    fill.Size = UDim2.fromScale(count / 3, 1)
    addButton.Text = count == 3 and "Demo complete" or "Simulate one fragment"
    addButton.Active = count < 3
    addButton.Selectable = count < 3
    addButton.AutoButtonColor = count < 3
end
addButton.Activated:Connect(function() count = math.min(3, count + 1) render() end)
resetButton.Activated:Connect(function() count = 0 render() end)
render()
gui.Parent = playerGui
