question

Maarten Braaksma avatar image
Maarten Braaksma asked

Economy V2 - Additional requirements on purchase

Hi!

Is it possible to attach an additional requirement to a purchase? Let's say that if you want to buy a certain item, you need 100 coins & 100 rank points. Those rank points won't retract.

Thanks in advance!

  • Maarten

In-Game EconomyPlayer Inventory
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

·
Xiao Zha avatar image
Xiao Zha answered

I think you want to implement the function that players can only purchase specific items when their rank points meet the requirements. PlayFab doesn’t support such feature. As a workaround, you can add the rank points as the currency and set it as the item price with the coins. Then using an Azure Function to handle the purchase process. When a player wants to buy this item, you can execute this Azure Function to call Execute Inventory Operations with Add operation to add the item to the player's inventory and Subtract operation to decrease the coins (To prevent hackers, it is better to call the Execute Inventory Operations API than the Purchase Inventory Items API). In this case, the rank points won’t be retracted.

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.

Maarten Braaksma avatar image Maarten Braaksma commented ·

Alright, thank you! Will do that.

0 Likes 0 ·

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.