Signal
Minimal typed signal, built with closures so the kit stays strict without casts and without pulling a third dependency just to notify listeners.
Every event the kit exposes is one of these: Tutorial.StepChanged, Tutorial.Completed, TutorialServer.PlayerStepAdvanced and the rest.
const connection = tutorial.StepChanged:Connect(function(step, previousStep)
print(step, previousStep)
end)
connection:Disconnect()
Handlers run on their own thread, matching how Roblox events behave: a listener that errors cannot take the tutorial flow down with it. It also means a handler cannot block the step that fired it, and that the order handlers run in is not guaranteed.
Types
Connection
interface Connection {Connected: boolean--
False once disconnected
}Functions
create
constructorCreates an empty signal.
const stepReached: TutorialKit.Signal<number> = TutorialKit.Signal.create()
Connect
Listens until disconnected.
Inside an action, put the connection on the step Janitor so it dies with the step:
context.Janitor:add(tutorial.StepChanged:Connect(onStepChanged), "Disconnect")
Once
Listens for a single fire, then disconnects itself.
Fire
Signal:Fire(...: T...--
Arguments passed to every handler
) → ()Calls every handler, each on its own thread.
Handlers are iterated over a copy, so one may disconnect itself or others mid-fire without skipping anybody.
DisconnectAll
Signal:DisconnectAll() → ()Drops every listener but leaves the signal usable.
Destroy
lifecycleSignal:Destroy() → ()Drops every listener. The kit calls this on its own signals from Tutorial:Destroy.