teleportPlayers
teleportPlayers(
authority,players,to,teleportPlayersOptions?):number
Moves players to another place in one hand-over: the world worldId,
the room roomId, or a room of the kind kind, which mode picks: a
fresh room private to them when left out. All or none: each player must be
able to enter, and the place must have a seat for every one. Answers the
request’s id; PlayersTeleportedEvent answers on a later tick with the
room, and the room lets each player go by its next checkpoint, due at once,
as the player leaves for any room. Throws on a world no room runs. Roblox’s
TeleportService:TeleportAsync does the same.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
authority |
Authority |
players |
readonly PlayerEntity[] |
to |
TeleportTarget |
teleportPlayersOptions |
TeleportPlayersOptions |
Returns
Section titled “Returns”number
Example
Section titled “Example”teleportPlayers(step, party, { kind: room.kinds!.arena }, { hint: { name: "red-gate" } });