Get user platform friend information||doc136876

September 20, 2022

Format

Player:RequestFriendList(callback, firstIndex, lastIndex) 
  • The class of the functionPlayer

Description

Get the current player's platform friend information

        Callback parameters

        Parameter name Type Description
        friendsData table<table<key, variant>> Friends data table

        friend data

        Parameter name Type Description
        NickName string User nick name
        UserID int User platform id
        ProfilePhoto string User icon url
        Language string User Language
        Online bool User is online
        CurrentGame string User current game

        Code example

        On the server side of the player entity templatemount script, get and print the platform friend information of 10 players. The sorting rules of friends are the same as those of the platform, and online friends have priority.

        this:GetUserData(function(friendsData, 1, 10)
            for _,data in pairs(friendsData) do
                for k,v in pairs(data) do
                    print(k,v)
                end
            end
        end)