I have the following code in my cloud script
handlers.testScript = function (args , context){ var request = { PlayFabId: currentPlayerId, VirtualCurrency: "GO", Amount: 100 }; var result = server.AddUserVirtualCurrency(request); }
and this code in unity
public void CloudScript(){ PlayFabClientAPI.ExecuteCloudScript( new ExecuteCloudScriptRequest() { GeneratePlayStreamEvent = false, FunctionName = "testScript", SpecificRevision = 2 }, exito => { Debug.Log("Exito: "+exito.ToString()); }, error => { Debug.Log("Error: "+error.ErrorMessage); } ); }
I ran it but nothing happens. Virtual currency is not added to the user. What am I doing wrong?