Hello, I hope you are feeling well! . So basically I have been having problems in getting the JobId of the server where a particular Friend is.
1- I tried the function Player:GetFriendsOnline() but this one has a small bug since 2020 and still no fix, instead of giving the JobId it gives the GameId.
2- I also tried using the function TeleportService:GetPlayerPlaceInstanceAsync(UserId) but this one always gives me the error HTTP 403 (Forbidden).
3- I can’t use MessagingService because is limited to just one place as long as I know, in other words, it doesn’t support multiple places.
They are in the main place, they click a button which displays all the friends that they have playing in the Multiplayer. They click the join button and they get teleported to that server where the friend is. Done.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local onlineFriends = player:GetFriendsOnline(200)
for i, friend in pairs(onlineFriends) do
script.Parent.MouseButton1Click:Connect(function()
if friend.PlaceId == 000000 or 000000 or 00000 then --put here ur 3 place Ids
game:GetService("TeleportService"):Teleport(friend.PlaceId, game.Players.LocalPlayers)
end)
end
end
--Idk try this
local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")
local LocalPlayer = Players.LocalPlayer
for _,friend in pairs(LocalPlayer:GetFriendsOnline()) do
if friend.PlaceId == 0 then -- replace with your place ID
if friend.LastLocation then
TeleportService:TeleportToPlaceInstance(friend.PlaceId, friend.VisitorId, LocalPlayer)
end
end
end
What that code will do is teleport the local player to the place but not to the server where its friend is. For example, maybe the player has 10 people playing in that place but in different server. Maybe the player decides to play with one of its friend so you will need to get the JobId of the server they are in to be able to teleport the player to that server.
I see, first time seeing this bug. It seems like there’s a workaround by using game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(uID). Have you tried using this?
Interesting, running out of options here but I have one last thing that may work. Have you tried going on an online server or playing your game directly?