I'm working on a Place Teleport gui and I'm having trouble finding the resources I need to enable a player to join a friends server. So far I have the basic teleport from place to place, however I'm having trouble figuring out how to follow friends playing the same game. Could someone please post a link to the wikia or somewhere that explains how to do this?
You need to use GetFriendsOnline, GetPlayerPlaceInstanceAsync, and TeleportToPlaceInstance
This is an example of what you could do
01 | --The whole script has not been tested, change it your likings |
02 |
03 | function GetFriends(player) --I do not feel like upvaluing it |
04 | return player:GetFriendsOnline( 200 ) --max is 200 |
05 | end |
06 |
07 | function GetFriendsInGame(friends) |
08 | local new_friends = { } --dont mean it like thatl |
09 | local placeid = game.PlaceId |
10 | local temp |
11 | for x = 1 , #friends do |
12 | temp = friends [ x ] |
13 |
14 | if (temp.IsOnline) then |
15 | if (temp.PlaceId = = placeid) then |
Cite: GetPlayerPlaceInstanceAsync GetFriendsOnline TeleportToPlaceInstance