Learn
Engine Class
FriendPages
Not Creatable
Not Replicated

Summary

Inherited Members
Code Samples
Print Roblox Friends
local Players = game:GetService("Players")
local USERNAME = "Cozecant"
-- First, get the user ID of the player
local userId = Players:GetUserIdFromNameAsync(USERNAME)
-- Then, get a FriendPages object for their friends
local friendPages = Players:GetFriendsAsync(userId)
-- Walk the pages, collecting the username of every friend. Each page entry is
-- a table of information about the friend, including Username.
local usernames = {}
while true do
for _, friend in ipairs(friendPages:GetCurrentPage()) do
table.insert(usernames, friend.Username)
end
if friendPages.IsFinished then
break
end
friendPages:AdvanceToNextPageAsync()
end
print("Friends of " .. USERNAME .. ": " .. table.concat(usernames, ", "))
©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.