Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

DataStore request was added to queue, you know?

Asked by 5 years ago
Edited 5 years ago

Hello! How to fix a script error? Many errors found name "302: SetAsync request dropped. Request was throttled, but throttled request queue was full." and "DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 199239304" Who know, can fix the errors for scripts? Screen Game Errors -Screen

1 answer

Log in to vote
0
Answered by 5 years ago

DataStore requests have limits, you can't try to request from them or to them too often. For :SetAsync(), that limit is 60 + numPlayers*10 times per minute. That means if there's one player in the game, you can call SetAsync on a certain key 70 times per minute. In your case the problem lies in the while true do loop on line 41. Because of this loop, you've set up a new .Changed event every 0.5 seconds so when the value changes for either of your values, you don't just attempt to save it once, you attempt to save it many many times. If you simply take out the while loop then you should stop getting an error.

0
I understand everything, how to do this, so as not to get an error? It's impossible?   Pavel1012345 11 — 5y
0
Just take out the entire while loop like the cowsoncows said. You only really need to save when the player leaves the game. Reset8449879 204 — 5y
0
Yep, saving every time the value changes is risky because you never know how often the function might fire, and players might end up losing data if it throttles. If you wanted you could add a loop that saves every minute or so, that way you won't throttle and there'll be extra security incase it doesn't save when the player leaves. cowsoncows 951 — 5y
0
Thx, you best) Pavel1012345 11 — 5y
Ad

Answer this question