I have a PlayStream Action that should run CloudScript when a Statistic is changed. I don't know where is the problem, but the action is not running. Same CloudScript function can be executed through server API call and runs as expected.
When I change the Stat, it appears in the debugger, but the Action doesn't run.
The Cloud Script function:
handlers.UpdateLevelStat = function (args, context) { var currentStats = server.GetPlayerStatistics({ PlayFabId: currentPlayerId, StatisticNames: [ "LastLevel1", "LastLevel2", "LastLevel3" ] }); var sum = 0; for (var i = 0; i < currentStats.Statistics.length; i++) { if(currentStats.Statistics[i].StatisticName == "LastLevel1" && currentStats.Statistics[i].Value > 0) sum += currentStats.Statistics[i].Value; else if(currentStats.Statistics[i].StatisticName == "LastLevel2" && currentStats.Statistics[i].Value > 0) sum += currentStats.Statistics[i].Value - 26; else if(currentStats.Statistics[i].StatisticName == "LastLevel3" && currentStats.Statistics[i].Value > 0) sum += currentStats.Statistics[i].Value - 51; } server.UpdatePlayerStatistics({ PlayFabId: currentPlayerId, Statistics: [ { StatisticName: "level", Value: sum } ] }); }