Skip to main content

TutorialClient

This item only works when running on the client. Client

The client half of the bridge to TutorialServer.

A tutorial built with Replicate = true drives this module on its own, so most games never touch it directly. It is exposed for the two cases the runtime does not cover: reacting to a server decision without a Tutorial instance, and reporting progress the kit cannot observe.

const TutorialClient = require(Packages.TutorialKit).Client

TutorialClient.StepRequested:Connect(function(step)
	print("server moved us to", step)
end)

Properties

StepRequested

events
TutorialClient.StepRequested: Signal<number>

Fires when the server puts this client on a step, via TutorialServer:SetStep.

CompleteRequested

events
TutorialClient.CompleteRequested: Signal<()>

Fires when the server ends this client's tutorial, via TutorialServer:Complete.

Functions

Start

This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. Yieldslifecycle
TutorialClient:Start() → ()

Connects to the bridge.

Idempotent, so every tutorial that replicates can call it. The first call yields while the RemoteEvent replicates, which is why Tutorial.build yields when Replicate = true.

Errors

TypeDescription
"TutorialKit.Client is client only"Called from the server

Stop

lifecycle
TutorialClient:Stop() → ()

Disconnects from the bridge.

ReportStep

TutorialClient:ReportStep(
stepnumber,--

Step reached

previousStepnumber?--

Step left behind

) → ()

Tells the server a step was reached.

A replicating tutorial does this for you. Call it by hand only for progress the kit cannot see, such as a tutorial beat that lives entirely in your own UI.

ReportCompleted

TutorialClient:ReportCompleted() → ()

Tells the server the tutorial finished.

Show raw api
{
    "functions": [
        {
            "name": "Start",
            "desc": "Connects to the bridge.\n\nIdempotent, so every tutorial that replicates can call it. The first call yields while the\nRemoteEvent replicates, which is why [Tutorial.build] yields when `Replicate = true`.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "tags": [
                "lifecycle"
            ],
            "errors": [
                {
                    "lua_type": "\"TutorialKit.Client is client only\"",
                    "desc": "Called from the server"
                }
            ],
            "yields": true,
            "source": {
                "line": 54,
                "path": "src/Net/Client.luau"
            }
        },
        {
            "name": "Stop",
            "desc": "Disconnects from the bridge.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "tags": [
                "lifecycle"
            ],
            "source": {
                "line": 62,
                "path": "src/Net/Client.luau"
            }
        },
        {
            "name": "ReportStep",
            "desc": "Tells the server a step was reached.\n\nA replicating tutorial does this for you. Call it by hand only for progress the kit cannot see,\nsuch as a tutorial beat that lives entirely in your own UI.",
            "params": [
                {
                    "name": "step",
                    "desc": "Step reached",
                    "lua_type": "number"
                },
                {
                    "name": "previousStep",
                    "desc": "Step left behind",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 74,
                "path": "src/Net/Client.luau"
            }
        },
        {
            "name": "ReportCompleted",
            "desc": "Tells the server the tutorial finished.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 81,
                "path": "src/Net/Client.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "StepRequested",
            "desc": "Fires when the server puts this client on a step, via [TutorialServer:SetStep].",
            "lua_type": "Signal<number>",
            "tags": [
                "events"
            ],
            "source": {
                "line": 33,
                "path": "src/Net/Client.luau"
            }
        },
        {
            "name": "CompleteRequested",
            "desc": "Fires when the server ends this client's tutorial, via [TutorialServer:Complete].",
            "lua_type": "Signal<()>",
            "tags": [
                "events"
            ],
            "source": {
                "line": 41,
                "path": "src/Net/Client.luau"
            }
        }
    ],
    "types": [],
    "name": "TutorialClient",
    "desc": "The client half of the bridge to [TutorialServer].\n\nA tutorial built with `Replicate = true` drives this module on its own, so most games never\ntouch it directly. It is exposed for the two cases the runtime does not cover: reacting to a\nserver decision without a [Tutorial] instance, and reporting progress the kit cannot observe.\n\n```lua\nconst TutorialClient = require(Packages.TutorialKit).Client\n\nTutorialClient.StepRequested:Connect(function(step)\n\tprint(\"server moved us to\", step)\nend)\n```",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 20,
        "path": "src/Net/Client.luau"
    }
}