queue_on_teleport Synchronous

  • queue_on_tp
  • queueonteleport
  • queueontp
  • queueteleport
  • syn.queue_on_teleport

Queue a Luau source string to run after the next eligible game teleport. Use it for a small piece of setup that should follow the player into the new session.

Syntax
Luau
queue_on_teleport(source: string) -> ()

Parameters

Function parameters
ParameterTypeDescription
sourcestringLuau source to run after teleport.

Returns

()

No values.

Usage notes

Requires an active game session and current authorization. Queuing does not run the source immediately.

Call clear_teleport_queue to discard entries you no longer want executed.

Limits

ResourceLimitWhat happens
Script size1 GiB per scriptA larger string raises an error and is not queued.
Queued scripts64 at a timeAnother call raises an error until the queued scripts run or clear_teleport_queue discards them.

Queued source stays in memory until it runs or is cleared, so keep it to what the next session needs. Use pcall when the source or the number of queued scripts depends on external data.

Example

Example
Luau
queue_on_teleport([[print("Arrived in the new game session")]])
print("Teleport setup queued")