I am trying to find the proper API to teleport to a friend's game.
If you join this game and hit Alt + M, it opens up a menu where you can join a friend's game. I would like to know how to replicate this.
The TeleportService doesn't seem to mention how to do this.
01 | local Players = game:GetService( "Players" ) |
02 | local TeleportService = game:GetService( "TeleportService" ) |
03 |
04 | local function FollowPal(Player, Id) |
05 | --- Teleports Player to another user's game |
06 | -- @param Player the Player that will be teleported |
07 | -- @param integer Id The userId of the Player they want to teleport to |
08 |
09 | local Successful, Error, PlaceId, ServerId = TeleportService:GetPlayerPlaceInstanceAsync(Id) |
10 |
11 | if Successful then |
12 | TeleportService:TeleportToPlaceInstance(PlaceId, ServerId, Player) |
13 | else |
14 | print ( "Teleport error:" , Error) |
15 | end |
16 | end |
17 |
18 | FollowPal(Players.Narrev, 34011054 ) |