The information on this page may no longer be accurate. To see the latest, go to our new and improved documentation. You can also learn more about the future of documentation.
Collapse Sidebar


The GetFriends Players function returns a FriendPages object which contains information for all of the given Player|Player's friends. The items within the FriendPages object are tables with the following fields:

Name Type Description
Id int64 The friend's UserId
Username string The friend's username
DisplayName string The display name of the friend.
IsOnline bool If the friend is currently online

See the code samples for an easy way to iterate over all a player’s friends.


Name Type Default Description

The userId of the player being specified.


Return Type Summary

Code Samples

Print Roblox Friends

This code sample loads the Player/UserId of the player whose username is provided at the top of the script by using Players/GetUserIdFromNameAsync. Then, it gets a FriendPages object by calling Players/GetFriendsAsync and iterates over each entry using the iterPageItems function. The username of each friend is stored in a table, then printed at the end.