This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
Player function returns a
Articles/Table#dictionaries of online friends, specified by maxFriends.
The Array’s Content
Some fields are only present for certain location types. For example, PlaceId won’t be present when the location type is (mobile) website.
|UserName||string||The user name of the friend.|
|LastOnline||string||When the user was last online.|
|IsOnline||boolean||If the friend is currently online.|
|LastLocation||string||The name of the friends current location.|
|PlaceId||number||The placeId of the friends last location.|
|LocationType||number||The location type of the friends last location. 0 for mobile website. 1 for mobile in game. 2 for website. 3 for studio. 4 for ingame.|
The maximum number of online friends to return. The default is 200.
An dictionary of online friends (see the table in the description to see what each the format of an entry).
How to Get a List of Online Friends
This example demonstrates how to get a dictionary of a player’s online friends.
It will returns at max as many friends as specified in the argument, which we set to 10. If the argument is blank, the default max number of friends to return is 200.
The example then prints the names of all online friends.