hi i have a question how can i delete a item of a specific catalog like "weapons"
what i want is buy a weapon (catalog handguns) and then delete the previus weapon (same catalog)
i just want have 1 of these how can i do it ?
hi i have a question how can i delete a item of a specific catalog like "weapons"
what i want is buy a weapon (catalog handguns) and then delete the previus weapon (same catalog)
i just want have 1 of these how can i do it ?
As I understand it, you are using durable items for weapons in your catalog. And for a player, he can only have one weapon in his inventory. So, when the player buys a new weapon, you want to remove the previous weapon from his inventory. Do I understand it correctly?
If so, you can use a cloud script function to do this. When player wants to buy a weapon, you will call this function. In the function, you can check the player's inventory by using GetUserInventory method and then check all item instances to see if there is a weapon. If no, then give the weapon to the player. If there is already a weapon, then get the "ItemInstanceId" and give the new weapon to player and finally call RevokeInventoryItem with the "ItemInstanceId" you've got to remove the previous weapon from player's inventory.
can you give me an exaple to make a function o revoke a item ? i know how to change statistics but via cloudscrip but not to revoke item please
In CloudScript, you can use something like the following to call server APIs.
server.RevokeInventoryItem({ PlayFabId: currentPlayerId, ItemInstanceId: "xxx" })
For more details, please see Writing custom CloudScript.
2 People are following this question.