Teleporting to the player using TeleportService

Hello, i need help how do you guys teleport to your friend his/her current server using TeleportService.
Can you give me an example of script?

Example: When a player1 is in the different server and the player1 want to teleport to his/her friend current server.

7 Likes

local TeleportService = game:GetService(“TeleportService”)

local Place =

script.Parent.Touched:connect(function(hit)

local player = game.Players:GetPlayerFromCharacter(hit.Parent)

if player then

TeleportService:Teleport(Place, player)

end

end)

This Should Work.

This is a normal Teleportation. I already know this.

You should format it in a code block. Makes it easier to read C:

~~~~~
– # code
~~~~~

:Teleport(ID of Place, Player Name)

Your question is very broad.

makes no sense. Could you please clarify so we can better help you?

Which one are you looking for?

Example: Me i want to join to my friend using the TeleportService, when i typed his name to the bar and pressed enter my character will be teleport to my friend.

If you are talking about teleporting them to another actual place where the friend is, I am not sure if this is possible. But if you mean just teleporting the character to some coordinates in the same place then you do not use TeleportService at all.

Do you mean different games to teleport like your friends game if that’s what your asking?

No, when a player1 is in the different server and the player1 want to teleport to his/her friend current server.

Thanks sorry about that.

You mean you want to teleport to someone elses server by the script you use?

Yea, if player1 want to teleport to player2.

When player2 is in the different server.

Copy her or his game ID that should work, if you all ready did that.

You should try TeleportService | Documentation - Roblox Creator Hub

You can use TeleportService:GetPlayerPlaceInstanceAsync(playerId) to get the player’s current server id, then use TeleportService:TeleportToPlaceInstance() to teleport to that specific server.

In order to get a list of a players friends, I believe you might need to use a WebAPI, so you’ll need to use HTTPService, and a you might need to use a web proxy since roblox.com links don’t work IIRC

20 Likes

Can you give an example of script my net is very weak this day.

I’m on mobile at the moment so I can’t write anything major currently, however there should be an example of how to use those two functions on the pages, then you might be able to find where to get the specific web api(s) for a players friends list elsewhere. I will try and update this post if i can find it myself.