Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
katclap 24
4 years ago

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

Log in to vote
0
Answered by 4 years ago

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

0
So something like ``if game:GetService("TeleportService"):GetPlayerPlaceInstanceAsync(v.UserId).PlaceId == "4588671650" then`` ? katclap 24 — 4y
0
yes User#23252 26 — 4y
0
here is what it returns:https://ibb.co/JpNWFvs User#23252 26 — 4y
0
Got it! Ty katclap 24 — 4y
Ad

Answer this question