Represents a single friend in a CoreFriendCollection.
|Property Name||Return Type||Description||Tags|
| || ||The ID of the friend.||Read-Only|
| || ||The name of the friend.||Read-Only|
In this example we get the first page of friends for each player who joins the game and print each friend's
id into the Event Log window.
function OnPlayerJoined(player) print(player.name .. " friends:") local friendCollection = CoreSocial.GetFriends(player) local results = friendCollection:GetResults() for _,entry in ipairs(results) do print(entry.name .. ":" .. entry.id) end end Game.playerJoinedEvent:Connect(OnPlayerJoined)
Last update: December 21, 2021