Hello Devs,
I find I’m always having problems and questions but I guess its just because I’m a new-ish dev trying to learn a lot of new stuff but anyway…
I’m trying to make this thing where there is a shop which players can buy stuff from and its working great but I’m trying to add this system where some things are limited so only a certain amount can be sold and I have that working great as well but there is 1 problem, once its sold out the gui will disappear so no more can be sold but that will only update in new servers so I’m trying to make it so every gui in every server will update at the same time when the amount remaining goes to 0. Anybody know how to do this or can help me with this?? Thank you for your help and time reading!
You can use a datastore and use UpdateAsync to change the amount left to be sold. Keep in mind though it is not perfect and depending on how popular the game is, there might be a few extras.
I would suggest you use datastore service for accomplishing this, you can use messaging service as well, but datastore is superior compared to messaging service!
Also, if you want to control limiteds I would suggest using this sweet plugin made by @.boatbomber
have a counter to keep track of how many are being bought in a specific server. Every 6 seconds use UpdateAsync to increment the amount of items purchased. Have checks in your shop that stops all purchases as soon as it reaches the limit