PROBLEM It only allows me to teleport to people in the exact same server that i'm trying to teleport from. useless right? I would greatly appreciate some help.
DESC I tried to make a feature that uses the typed name of a player, fires it to the server, and gets their UserId to begin the first part.
--Gets the userId of "Who"
game.ReplicatedStorage.Events.TeleportToFriend.OnServerEvent:Connect(function(Player,Who)
` local FriendId
pcall(function()
FriendId = game.Players:GetUserIdFromNameAsync(Who)
end)
FollowFriend(Player,FriendId) -- Function that makes you follow your friend
end)
The second part of the script is the one following the friend's named they typed.
function FollowFriend(player, targetUserId)
local teleportService = game:GetService("TeleportService")
local success, errorMsg, placeId, instanceId = teleportService:GetPlayerPlaceInstanceAsync(targetUserId)
if success then
teleportService:TeleportToPlaceInstance(placeId, instanceId, player)
else
print("Teleport error:", errorMsg)
end
end
However this is where it won't let me teleport to anyone outside of my server?
Any suggesstions? Any help appreciated

4 comments
lmao much appreciate<3
Gonna test the problem, might take some time
Much obliged man
You are not doing anything if GetUserIdFromNameAsync fails and you are not pcalling GetPlayerPlaceInstanceAsync. Use "pcall(teleportService.GetPlayerPlaceInstanceAsync, teleportService, targetUserId)"