queue_on_teleport Synchronous
queue_on_tpqueueonteleportqueueontpqueueteleportsyn.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.
Luau
queue_on_teleport(source: string) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
source | string | Luau 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
| Resource | Limit | What happens |
|---|---|---|
| Script size | 1 GiB per script | A larger string raises an error and is not queued. |
| Queued scripts | 64 at a time | Another 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
Luau
queue_on_teleport([[print("Arrived in the new game session")]])
print("Teleport setup queued")