queueonteleport
Queues a script to run after teleporting.
Syntax
queueonteleport(script: string) -> ()Aliases
queue_on_teleportqueueteleport
Parameters
| Parameter | Type | Description |
|---|---|---|
script | string | The Luau code to run after teleport |
Returns
This function does not return a value.
Description
queueonteleport queues Luau code to be executed after the player teleports to another place. The script will run once the new place loads.
Example
-- Queue a script to run after teleporting
queueonteleport([[
print("Teleported successfully!")
-- Your script code here
]])
-- Teleport the player
game:GetService("TeleportService"):Teleport(placeId)Auto-Execute Example
-- Queue the current script to run again
queueonteleport(game:HttpGet("https://example.com/script.luau"))Notes
- Use
clearqueueonteleportto clear the queue - Every queued script is removed by
clearqueueonteleport
Related Functions
clearqueueonteleport- Clear the queue