Hello everyone,
I'm trying to get a random user in Cloudscript depending on the player's experience. I use the code down below to get a random player.
var getRandomUser = { "MaxResultsCount": 50, "PlayFabId": currentPlayerId, "StatisticName": "Experience" }; var getRandomUserResult = server.GetLeaderboardAroundUser(getRandomUser); for(var i = 0; i < getRandomUserResult.Leaderboard.length; ++i) { log.info("Index: " + i + " - Name: " + getRandomUserResult.Leaderboard[i].DisplayName + " - ID: " + getRandomUserResult.Leaderboard[i].PlayfabId); }
The code works without an issue, however, the PlayFabIDs of the players return as undefined. Is that expected behavior? If so, what should I do to get their PlayFabIDs as well?
This is the one of logs. (The ID is undefined for all the players):