question

choi dong geun avatar image
choi dong geun asked

I want to make an item upgrade.

hi.

1)

I want to make an item upgrade.

I'm making it a cloud script, but it doesn't work, so I'm posting questions.

I want to get ItemInstanceId from args and find it in the inventory. Is there an example of cloud script?

2)

I have to modify and save the cloud script, and then change it to live. Is there any way to test it without live?

I thought I could test the game while serving it.

Thank you.

10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

>>> I want to get ItemInstanceId from args and find it in the inventory. Is there an example of cloud script?

Do you mean you want to update items’ custom data using Server API UpdateUserInventoryItemCustomData? If so, you can refer to the following example.

handlers.UpgradeUserInventoryItem = function (args, context) {
    var userItemInstanceId = args.userItemInstanceId;
    var result = server.UpdateUserInventoryItemCustomData
        ({
            PlayFabId: currentPlayerId,
            ItemInstanceId:userItemInstanceId,
            Data: {
                Equipped: "True",
                Slot: "Head"
            }
        });
}

>>> I have to modify and save the cloud script, and then change it to live. Is there any way to test it without live?

Currently, PlayFab doesn’t support testing the CloudScript revision without live, you can only test the CloudScript revision after deploying 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.