In my upcoming game I am planning to sell limited items in my game where once a new item is released only certain amount of people can buy it. However I am unsure of the best way to doing this while ensuring that the amount of players who end up owning the item doesn’t pass the limit.
The way I’m currently thinking of doing it would take far too much datastore requests, which only leaves me with the option of doing it via 3rd party server.
While doing it on a 3rd party server would be easier, I’d like to keep this on roblox, so I thought see if anyone has accomplished something like this and what they’ve done.
Yes I want to be sure to only sell the item to the player so long as there is some left… though with multiple people buying it at once, I’m not sure how i can do that with the request limits we have.
Are these items going to transfer from server-to-server or just in the server you are currently in?
If want these items to be saved from server-to-server, and make the notifier cross-server, then that’ll be a but tricky(hopefully universe scripts make this a lot easier and more possible when they come out).
I’m not experienced with web development, but I think HttpService is your best bet then, you can’t trust datastores for a task like this. My other recommended option would be to wait and see if universe scripts can do this when they come out. Sorry.
Yeah, I don’t think any of the features Roblox has are up to this task. Maybe when ‘universe scripts’ get released this idea might become slighly more viable, but even then 1. DataStores are slow and 2. DataStores have small limits (compared to HttpService).
Using your own webserver, or doing these limited items based on a server instead of the entire game is probably a better option.
There’s a lot of ways you could do it, just one way I’ll throw out there:
Have one ordered datastore and every time someone buys a limited, one key out of as many as you need(to avoid using the same key in two servers at the same time) is incremented. Periodically check this ODS(which takes one datastore request) and add up the total amount of purchases.
Unless you have a many thousands of players or the item will be bought many many times in a short timespan, you can keep the item almost exactly as limited as you want without an issue.
Sorry buddy, I used a 3rd party server to do this. Using a third party server works wonders for this though. The only problem is that sometimes the servers go down or have hiccups and that can make players angry. I have no clue how you’d go about making a limited system with serials and everything using datastore only though.
Have a Data store containing all the special items. each item info should be an table with maybe expiration date, tier, item name, cost, and how many there are left.
each time a player tries to purchase one of the limits. its going to check in the data store and checks if the amount >= 1 then after that’s its going to check if the player has enough currency to purchase it.
then update the data store that one has been taken. and give it to the player.
hope this might help you figure out how you can do it.
This could still be prone to bugs such as more items being bought than what the Datastore says is in stock. You have to take in account that Datastores are not 100% reliable.
You could do this on limited items that can no longer be purchased after a set time-frame, but not on items with a limited stock(could lead to duplicates)
Will have to use HTTP service, I am working on a project and the programmer (@Good_Scripter) uses Trello to store all the details on in-game group creation we have set up. There is a free Trello module which makes the process a lot less tricky.
Before allowing users to purchase it, check if the amount of cards in that list is lower than the item stock available.
Create a new card and change title and desc to whatever you like(Username as the title?)
Now, if 2 users purchase the same item at the same time it might sell more than the stock has available.
You should also take a look at Trello’s limitations if you plan to do it that way.