Teleport (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Megamatrixdude
New page: <onlyinclude>{{Method |name = Teleport |returns = nil |description = When put into a LocalScript, the Teleport method is used to teleport the ...
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>"
Tags: mobile web edit mobile edit
 
(31 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{local}}
<onlyinclude>{{Method
<onlyinclude>{{Method
|name                = Teleport
|name                = Teleport
|returns              = [[nil]]
|arguments            = [[int]] placeId
|description          = When put into a [[LocalScript]], the Teleport method is used to teleport the player to a different game by PlaceId.
|description          = Used in a [[LocalScript]] to teleport a player to the place with ID <var>placeId</var>.
|object              = TeleportService
|object              = TeleportService
}}</onlyinclude>
}}</onlyinclude>
Line 8: Line 10:
{{clear floats}}
{{clear floats}}


{{Example|
This code will teleport a player to Crossroads:
<syntaxhighlight lang="lua">
game:GetService('TeleportService'):Teleport(1818)
</syntaxhighlight>}}
==See Also==
*[[TeleportService]]
*[[TeleportToSpawnByName_(Method)|TeleportToSpawnByName]]


[[Category:Methods]]
[[Category:Methods]]

Latest revision as of 05:00, 27 April 2023

Local: This item should be used with a LocalScript in order to work as expected in online mode.
Teleport( int placeId )
Returns nil
Description: Used in a LocalScript to teleport a player to the place with ID placeId.
Member of: TeleportService


Example

This code will teleport a player to Crossroads:

game:GetService('TeleportService'):Teleport(1818)


See Also