question

Karl Johannes avatar image
Karl Johannes asked

Increase Player Statistics

How can I increase the player statistics of a player with only calling the cloud scripts once?

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

Leaderboards and Statistics
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

·
Citrus Yan avatar image
Citrus Yan answered

Sure, all you have to do is to set that statistic’s aggregation method as Sum in the “Edit Leaderboard” panel via Game Manager:Or, you can do it through the Admin/UpdatePlayerStatisticDefinition API.

Next time you call Server/UpdatePlayerStatistics via CloudScript to update that statistic for the player, it will get increased instead of replaced.


pic.png (21.9 KiB)
4 comments
10 |1200

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

Karl Johannes avatar image Karl Johannes commented ·

It works perfectly. Thanks a lot!

0 Likes 0 ·
mariogarranz avatar image mariogarranz commented ·

Is it possible to reset a Sum statistic then through CloudScript or automation not based on a fixed time, but on an event?

Because setting a value of 0 would just not sum anything I guess, right?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan mariogarranz commented ·

Of course, you can use Playstream Rules react to PlayStream events in real time. Please check this doc:https://docs.microsoft.com/en-us/gaming/playfab/features/automation/actions-rules/

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Citrus Yan commented ·

And yes, setting value of 9 won't sum anything.

0 Likes 0 ·

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.