question

szcuipeng avatar image
szcuipeng asked

can i incr/decr player data like redis?

hi all

How can I increase player data with only calling the cloud scripts once?

Is it possible to Update Player data by a specific amount without first getting them?

Player DataPlayer InventoryPlayStream
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

·
Neils Shi avatar image
Neils Shi answered

If you want to increase/decrease a number, we recommend you use UpdatePlayerStatistics. In the Leaderboard, you can set Aggregation method to Sum. By using it, you don't have to get it first and you can increase/decrease player data with only calling the cloud scripts once. For more detail, you can refer to Writing custom CloudScript.5595-2222.png


2222.png (28.0 KiB)
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.