-- Regular Script in ServerScriptService, in a spare practice place.
-- Create Workspace.PracticeNPC (rig) and Workspace.PracticeSeat (Seat) first.
-- Documentation-reviewed; not executed in Studio for this guide.
local rig = workspace:FindFirstChild("PracticeNPC")
local seat = workspace:FindFirstChild("PracticeSeat")
assert(rig and rig:IsA("Model"), "Add a rig Model named PracticeNPC under Workspace")
assert(seat and seat:IsA("Seat"), "Add a Seat named PracticeSeat under Workspace")
local humanoid = rig:FindFirstChildOfClass("Humanoid")
local root = rig:FindFirstChild("HumanoidRootPart")
assert(humanoid, "PracticeNPC needs its rig Humanoid")
assert(root and root:IsA("BasePart"), "PracticeNPC needs a BasePart named HumanoidRootPart")
if humanoid.Health <= 0 then warn("Use a living practice Humanoid") return end
if not seat.Anchored then warn("Anchor the practice Seat for this exercise") return end
if seat.Disabled then warn("PracticeSeat is disabled") return end
for _, part in ipairs(rig:GetDescendants()) do
    if part:IsA("BasePart") and part.Anchored then
        warn("Unanchor the practice rig's body parts before this test:", part.Name)
        return
    end
end
if seat.Occupant == humanoid then
    print("PracticeNPC is already the seat occupant")
    return
end
if seat.Occupant then warn("PracticeSeat already has another occupant") return end

local function reportOccupant()
    if seat.Occupant == humanoid then
        print("Confirmed on server: PracticeNPC is PracticeSeat's occupant")
    elseif seat.Occupant then
        warn("PracticeSeat now has a different occupant")
    else
        print("PracticeSeat has no occupant")
    end
end
seat:GetPropertyChangedSignal("Occupant"):Connect(reportOccupant)
seat:Sit(humanoid) -- Request seating. Do not assign the read-only Occupant property.
task.delay(1, function()
    if not seat.Parent or not humanoid.Parent then return end
    if seat.Occupant ~= humanoid then
        warn("Not confirmed after one second; inspect setup, physics, and Output")
    else
        reportOccupant()
    end
end)
