We wish to add a feature to some of our bundles, and I'm not sure how to do it.
Basically, we want to give (for example) bonus items the first time each player buys the bundle.
I didn't find a similar feature in the bundles page, and I believe there's currently no API endpoint to access a player's purchase history (to check whether they have already bought the bundle or not)
My current workaround idea is something like this:
Create a player statistic for each affected bundle.
Create a rule that increments the statistic when the player buys the bundle (or when the bundle item is added to their inventory).
Create another rule that gives the bonus items when the statistic is changed and its new value is 1.
Obviously this is not an ideal way to do it. Is there anything I'm missing to make it better?
Thanks.
Answer by Gosen Gao · Jun 15 at 06:42 AM
For the feature to give additional items the first time players purchase a bundle, I think the most important part is to store the status information whether the bundle was purchased for the first time or not. Since Statistic has a maximum limit of 300, “Create a player statistic for each affected bundle” may take some resources. I would recommend that you can use Player Data to store the status all in one key/value pair. The workflow should be something like below.
BTW, if not all of the bundles need such a feature, you can either edit the rule to restrict condition to specify which bundles will trigger the rule, or you can change the data structure of that Key/Value pair to store more info to meet your needs.
Thanks for your answer, I thought about using PlayerData but ideally I'd like to do it without using Cloud Script functions, and we won't reach the Statistics limit of 300 anytime soon.
It seems there's no easy way to achieve this feature, so I'll try using Statistics and keep your suggestion in mind if needed.