Ways to make this code system faster?

So my friend and I made this game where you can redeem codes and get UGC items in-game

however when we had 250+ people trying to redeem the same code, the system broke and let a lot more people use it (500)

Do you scripters have any tips for us to make the system faster to recognize when a code is out of use?

1 Like

I would recommend associating an expireary timestamp with each code so that when a player redeems a code you can check if the time that they attempted to redeem it is before the expireary time.

1 Like

You will need to add a return clause in case your script is failing.

Unless these 250 players are all in the same server, I don’t see why your system breaks even with the datastore ratelimits. Could you specify what type of error you are getting?

Ideally you’d only need to save the player’s data when they leave.

You should define what you mean by “system broke”. We don’t know how your system works, so saying such phrase may lead to other developers misunderstanding the problem.