I need customData from itemInstance (inventory). But the following code tell me that all item instance has undefined customData. Any help is appreciate.
I need customData from itemInstance (inventory). But the following code tell me that all item instance has undefined customData. Any help is appreciate.
This is my code as text.
test(args) {
var inventory = server.GetUserInventory({ PlayFabId: currentPlayerId }).Inventory;
var length = inventory.length;
var response = {
status: "ok",
description: ""
};
for (var i = 0; i < length; i++)
{
response.description += " [" + i + "]: " + JSON.stringify(inventory[i].customData);
}
return response;
}
You may change the inventory[i].customData
in your code to inventory[i].CustomData
. You may refer to Player Item Management - Get User Inventory - REST API (PlayFab Server).
2 People are following this question.