question

cshombith avatar image
cshombith asked

Updating Player Data through Cloudscript,Update User Data Not working inside Cloudscript environment

Hey, I have been trying to accomplish to update a player title data through cloudscript where it just sets the State of the player. This is my cloudscript code, handlers.storeFriend = function (args, context) { var state = args.PlayerState; var playerStatResult = server.UpdateUserData({ PlayFabID : currentPlayerId, Data : {"State", state}}); }

Although while doing this I am getting the following issue, I am a beginner at cloud scripting so please pardon my mistakes. This is a real blocker right now, Any help would be appreciated. Thanks ! 5434-image-2023-01-27-130541755.png

,Hey, this here is my following cloudscript,

     handlers.storeFriend = function (args, context) {
         var state = args.PlayerState;
         var playerStatResult = server.UpdateUserData({PlayFabID : currentPlayerId,
             Data : {"State", state}});
     }

So in this above example I am trying to update the player title data with one single value for setting the player state. Although while saving I am getting the following issue, I might missing something basic but I am a beginner with Cloudscript so pardon my mistakes. Thanks! 5433-image.png

Player Dataunity3dCloudScript
1 comment
10 |1200

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

cshombith avatar image cshombith commented ·

Somehow I posted it twice, sorry :p

0 Likes 0 ·

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

At line 4, it should be ':'.

 Data : {"State": state}});
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.