Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Would I Get Player's Friend's PlaceID?

Hey! Thanks for checking this out, I'm having trouble understanding how to get a player's game. My game uses a friends list so that they can join a friend from the main menu which is a different place. I want to be able to detect if the friend is in that place in order for the player to be able to join them, and wont see all friends in every game.

for i,v in pairs(friends) do if v.LastLocation then if v.PlaceId == "4588671650" then

What I attempted to do up there is detect the placeid but i'm pretty sure it only applies to that server it will not show anything if i use that.

1 answer

✓ Accepted answer

you actually have to use TeleportService:GetPlayerPlaceInstanceAsync(userID). which returns the place Id of where the player is, and the code of the server they are in

learn more here

4 comments

0

So something like if game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(v.UserId).PlaceId == "4588671650" then ?

0

yes

0

here is what it returns:https://ibb.co/JpNWFvs

0

Got it! Ty

This discussion is preserved as it was. New answers, comments, and votes are closed.