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

why does it say DataStore request was added to queue?

Asked by 5 years ago
Edited 5 years ago

why does it say DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key =? I recently made a datastore script and I want to save 2 values but when I do 2 it says - DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key =. why does it do it and how do I fix it? If it is needed I will put the script. Please help script

game.Players.ChildAdded:connect(function(Player)

local Lead = Player.leaderstats

local Genorosity = Instance.new("IntValue",Lead)

Genorosity.Name = "Genorosity"

Genorosity.Value = 10

local cash = Instance.new("IntValue",Lead)

cash.Name = "Cash"

cash.Value = 4000

DataStore = game:GetService("DataStoreService"):GetDataStore("SaveCash")

local Key = Player.userId

local Data = DataStore:GetAsync(Key)

if Data then

cash.Value = Data

Genorosity.Value = data

end

end

end)



game.Players.ChildRemoved:connect(function(Player)

local Key = Player.userId

DataStore:SetAsync(Key,Player.leaderstats.Genorosity.Value)

DataStore:SetAsync(Key,Player.leaderstats.Cash.Value)

end)
0
You're sending too many requests for data to be saved, try slowing down. despicablejack2005 83 — 5y
0
I am only doing 2 requests and I see many games doing more than 1 turquoise_monkeyman 32 — 5y
0
Also I only played one game turquoise_monkeyman 32 — 5y
0
there aren't spaces in the actual code turquoise_monkeyman 32 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

You should invest your time learning how to make a saving a table instead of single values. This has a lot of benefits:

(this will fix your problem on having to many requests)

  • More organised.
  • No issues in having too many requests.
  • Easy to change later on.
  • Able to save more then just strings without using tonumber.

I have a test place here that's uncopylocked that you can mess around and my own tutorial here:

youtube link

0
thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!! I will try turquoise_monkeyman 32 — 5y
0
also where is the test place turquoise_monkeyman 32 — 5y
0
sorry must of not posted it lmao: https://www.roblox.com/games/2801186598/datastoretest retrobricks 162 — 5y
0
also do you mind accepting my answer :- ) retrobricks 162 — 5y
View all comments (4 more)
0
ok I was going to try first but ok turquoise_monkeyman 32 — 5y
0
wolud it work on studio now the datastore turquoise_monkeyman 32 — 5y
0
It should but it would'nt save anything that you do in studio :) retrobricks 162 — 5y
0
You should use PlayerRemoving and PlayerAdded instead. YaoYN 0 — 4y
Ad

Answer this question