Is it possible to see friends currently online in the same game?

Is it currently possible to see if a player’s friends are online in the same game, possibly in a different server?

Such a system could be used for advanced custom matchmaking systems and allows for an ‘invite a friend to party/match/game’ option.

4 Likes
2 Likes

But there seems to be no option to check the PlaceId of the friend’s current place, right?

Did you read the entire page? It does say “PlaceId” and “GameId”. If that’s not what you meant, I’m unsure what you’re asking for. :smile:

The PlaceId states “user’s last location”. I want to know if that is the current one. (Or nil if not in a game.)

Yes, this is correct. The user’s last location is the thing they did last, for example playing “Jailbreak”.
I just tried this with my friend, and made her join a game, leave it after some time, and then join a different game.

After they left:
image
After they joined a new game:
image

Code used:

local FriendsOnline = game.Players.USERNAME:GetFriendsOnline();
for _, friend in pairs(FriendsOnline) do
     print(friend.VisitorId, friend.PlaceId)
end

It worked like a charm :ok_hand:

10 Likes

That is very nice, thank you.

I hope the wiki will be edited, since the term ‘last location’ can be a bit confusing then.

1 Like

It won’t be edited unless you request an edit through making a post in #platform-feedback:documentation-requests. Not sure why it’d need to be changed though, seems fine as it is.

Because ‘last location’ in the wiki description suggests that it stays the same when the player leaves the place, even though @WhereAreTheLights’s tests proof that it indeed changes to nil when the player leaves.

1 Like

Are you suggesting a change in the name or in the functionality? I’m a little lost but that’s probably because I’m not really paying attention.

For a term change, #platform-feedback:documentation-requests. For a functionality change, #platform-feedback:engine-features.