question

shin chang seop avatar image
shin chang seop asked

How to run Cloudscript player_ranked_on_leaderboard_version?

handlers.RankPlyaer = function (args, context) {
    var rank = context.Rank;


    var data = {};
    data["Rank"] = String(rank);
    server.UpdateUserData({PlayFabId: currentPlayerId, Data: data});
    
    return {};
};

How to access rank?
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Ivan Cai avatar image
Ivan Cai answered

If you want to access such PlayStream event properties via the context input parameter of the CloudScript function. Please refer to https://docs.microsoft.com/en-us/gaming/playfab/features/automation/actions-rules/using-cloudscript-actions-with-playstream#the-context-input-parameter .

In your case, please modify the code as follows::

var rank = context.Rank;

edit to

var rank = context.playStreamEvent.Rank;
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.