question

Good Guy avatar image
Good Guy asked

Can we use N keys to open 1 container?

I think the answer is no, but I was hoping it is possible somehow to do this:

CONTAINER requires 10 instances of KEYITEM instead of just 1 in order to open it.

A. Is this possible?

Also let me describe the scenario differently:

Player has 10 uses of KEYITEM
CONTAINER is set to require KEYITEM

B. After unlocking the container with KEYITEM, would they have 9 uses left, or would they have 0 (the item KEYITEM is gone from inventory?

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

·
Rick Chen avatar image
Rick Chen answered

After unlocking the container with a key item, it will consume 1 use of the key item. But here are some workarounds.

Workaround 1: you can implement an Azure Function which use 1 key item to unlock the container then consumes 9 extra key items (and disable the client Unlock Container APIs such that player can only unlock via your function). In your function, you can check if the users have enough key items before unlocking the container.

Workaround 2: you can create an Azure Function that allow the player to trade 10 key items with the true key (using ModifyItemUses and GrantItemsToUser API). Then set the true key to be the key of the locked container.

2 comments
10 |1200

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

Good Guy avatar image Good Guy commented ·

Thanks. We're architecting our game to use NO Azure functions at all. I guess we'll have to consume the extra keys from a client call.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Good Guy commented ·

Consuming extra keys from client call can be hackable. Malicious players can directly call the API (with Postman/cURL/etc.) and workaround it so that they only consume 1 key.

If you don’t want to use server call, another workaround is that you can make the keys a Virtual Currency, which can be used to buy the “True Key” item, which can unlock the container.

Server-side scripts are necessary in many anti-cheat scenarios. May I know your concerns of using Azure Function? Have you tried Cloud Scripts?

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.