question

szcuipeng avatar image
szcuipeng asked

send reward to players when player win 5 times everyday

hi, everyday when a player win 5 times, send a reward and a message to him.

I found an example in the following document:

https://learn.microsoft.com/en-us/gaming/playfab/features/automation/actions-rules/

it says:

if you want to send a reward to your players, and send a them a notification when they have more than 10,000 XP you could:

 Define a Segment for your users called “High XP Players”, and set the criteria as XP >= 10,000.
 Create a rule that is triggered by the PlayStream event of those players moving into the High XP Players segment.
 Set two actions for that rule: 

my questions is: can i reset the win times everyday at 00:00 clock (utc0)? so everyday when the player got 5 wins, the rules be triggered.

tks. best wishes.

Player DataandroidPlayStream
10 |1200

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

Xiao Zha avatar image
Xiao Zha answered

You can create a statistic called “wins” for all players and update the statistic every time the player wins the game (it is recommended to call Server API Update Player Statistics in CouldScript to prevent client cheating), then create a Segment and set the player filter with Statistic “wins” value greater than or equal to 5, then select Execute Cloud Script in the Actions to grant reward to players with CouldScript. Since all statistics defined for a player in a game in PlayFab are part of a leaderboard and the leaderboard is resettable, you can find the “wins” leaderboard in Leaderboard page, then you can modify the Reset frequency to Daily. You can refer to Using resettable statistics and leaderboards - PlayFab | Microsoft Learn for more information.

10 |1200

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

drallcom3 avatar image
drallcom3 answered

my questions is: can i reset the win times everyday at 00:00 clock (utc0)? so everyday when the player got 5 wins, the rules be triggered.

You will have to use a cloudscript for that. Save the last reset date UTC in player data and on login check if a day has passed. Then reset the win counter, whereever you put it.

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.