question

Kim Strasser avatar image
Kim Strasser asked

How can I disable a certain purchased item and remove a player tag for all players?

The players are able to purchase certain items in my shop. After purchasing one of those items, the players get a new player tag. The player tag depends on the display name of the purchased item. Each player can only purchase one of these items and can only get one corresponding player tag. It should not be possible to have more than one of these items in the player inventory.

On a certain date, I want to disable the purchased item in the players inventory and remove the corresponding player tag because the item can only be used during a certain period (for example from 18.04.2021-25.04.2021) in my game.

Is it possible to create a scheduled task for all players that disables the purchased item in the players inventory and removes the corresponding player tag on a certain date?

In-Game Economy
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

·
Ivan Cai avatar image
Ivan Cai answered

You can create a scheduled task that run a cloudscript for all players. In cloudscript function, you can check that there is a corresponding purchased item in the player inventory during a certain period. Once it is found that the corresponding item has not been in the revoked state, you need to call RevokeInventoryItem API and remove player tag via calling RemovePlayerTag. However, I think you can directly set the item to consume by time and use it in a limited period.

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.

Kim Strasser avatar image Kim Strasser commented ·

I changed my items settings. Now, the item will be consumed after a certain time and I remove the player tag with RemovePlayerTag in my CloudScript function.

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.