question

trbarati avatar image
trbarati asked

Unlock inventory item after specifice time

Hi.

I want to unlock some of player inventory after a while (for example 5h.).

This will happen after user purchased that item from shop.

Can you give me a solution for this pattern?

Player DataPlayer 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.

Greg Nagel avatar image
Greg Nagel answered

You can do the math yourself with the PurchaseDate field. Just take the current time and subtract the purchase date and see if it has been five hours yet. Note that this probably won't work with stackable items.

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.

trbarati avatar image trbarati commented ·

Thanks a lot.It seems the best way.

0 Likes 0 ·
brendan avatar image
brendan answered

In the game manager, make the items be consumable, set the "By time" to 5, and the drop down below to "Hours". That way, when the player buys the item, it will be in his inventory for 5 hours, then be removed.

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.

trbarati avatar image trbarati commented ·

No I want to unlock this item after 5 hour.In other hand first you buy it and you cant use it until 5 hours.Its not consumable.

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.