I never used TeleportService, but I think you need both the PlaceId and the GameId - not sure what the difference is. Try this instead:
if v.LastLocation then
FriendImage.JoinButton.MouseButton1Click:Connect(function()
print(v.GameId, v.PlaceId)
TeleportService:TeleportToPlaceInstance(v.PlaceId, v.GameId, LocalPlayer)
end)
end
Edit: Changed v.VisitorId to v.GameId.
Another edit:
PlaceId
number
The place ID of the friend’s last location.
GameId
string
The DataModel.JobId of the friend’s last location.
Our game had the exact same problem but it went away on its own. According to this thread and reply, it is an issue on Roblox’s end and they attempted to fix it. I suppose you could bump the thread with your input, as there are plenty of developers reporting that whatever Roblox did didn’t work. Otherwise, it’ll work from time to time, but there’s no telling when.
Another reply in that thread said that it started to work when they ran it off of the server instead of following the DevHub documentation which says to run it from the client. You could try that if that’s not already the case.
Hey! Roblox has a Default Service part of the Social service, Here is a Little Code to help you out, This is a child of a Button.
local social = game:GetService("SocialService")
script.Parent.MouseButton1Click:Connect(function()
social:PromptGameInvite(game.Players.LocalPlayer)
end)
Ignore the idea of saving it to a data store, it’s not a great method at all.
This method returns the JobId for online friends.
This can be also read by the client. So you can get the list via client too, and then just use a remote event to teleport the player into another server;
Is this so that you can join other friend’s games? If so, then make sure you have “Allow third party teleports” on. (Beware that any virus can take you to any place if you do this.)