Hello,
I need to make a cloudscript function that a client can call that will edit entity objects for another player. The player has the other players PlayFabID, but I cannot figure out how to go from a PlayFabID to the EntityKey of type "title_player_account" of the other player in cloud script in order to change entity objects. How can this be achieved?
The code snippet below shows the function I need in context.
Any help would be greatly appreciated!
handlers.setobjecttest1 = function (args, context) { // I have this var anotherPlayersPlayFabID = "EXAMPLEPLAYFABID"; // This is how I would get the current players entity key //var target = context.currentEntity.Entity; // I want either this function: var target = PlayFabIDToEntity(otherPlayersPlayFabID); // ... or this Function which just returns the ID // var target = { // Id:PlayFabIDToEntityID(otherPlayersPlayFabID);, // Type:"title_player_account" // var apirequest = { Objects: [ { ObjectName: "ObjectName", DataObject: { "TestKey":"TestValue" } } ], Entity: target } return entity.SetObjects(apirequest); }