Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why does it say DataStore request was added to queue?

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)

4 comments

0

You're sending too many requests for data to be saved, try slowing down.

0

I am only doing 2 requests and I see many games doing more than 1

0

Also I only played one game

0

there aren't spaces in the actual code

1 answer

✓ Accepted answer

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

8 comments

0

thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!!! I will try

0

also where is the test place

0
0

also do you mind accepting my answer :- )

0

ok I was going to try first but ok

0

wolud it work on studio now the datastore

0

It should but it would'nt save anything that you do in studio :)

0

You should use PlayerRemoving and PlayerAdded instead.

This discussion is preserved as it was. New answers, comments, and votes are closed.