I’m trying to script leaderstats data saver, and isnt saving anything. The only thing output says:
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 529664560
My code ( I have 3 of these, for Rebirth, Gems, and Clicks )
Script 1:
local DS = game:GetService("DataStoreService")
local Players = game:GetService("Players")
local ClicksDataStore = DS:GetDataStore("ClicksDS")
local SM = require(script.PlayerStats)
Players.PlayerAdded:Connect(function(Player)
local Clicks = SM.AddPlayerStats(Player)
local success, ClicksData = pcall(function()
return ClicksDataStore:GetAsync(Player.UserId)
end)
Clicks.Value = (type(ClicksData) == "number" and ClicksData) or 0
end)
Players.PlayerRemoving:Connect(function(Player)
local stats = Player.leaderstats
local Clicks = stats.Clicks.Value
ClicksDataStore:UpdateAsync(Player.UserId, function(oldData)
return Clicks
end)
end)
Module (Under script)
local Stats = {}
function Stats.AddPlayerStats(Player)
local Folder = Instance.new("Folder", Player)
Folder.Name = "leaderstats"
local Clicks = Instance.new('IntValue',Folder)
Clicks.Name = "Clicks"
return Clicks
end
return Stats
1 Like
I still need help. Please, if you have an idea on how to fix it tell me
is your game published to roblox? if not then you have to publish it to roblox to be able to access datastores
Which Line Of Script Gives You That Error?
I published it and went to game settings to thrn on API services.
It did not say, it only said in the output what I said in OP.
also does this line give you any errors? because it doesnt seem correct if youre trying to import the ClicksData
you have 2 other similar scripts running and working with Datastores correct?
1 Like
I have 2 other similar scripts with Datastores that are the exact same as the one Im having an issue with but just a different currency. Both are also not working,
No, all it says is:
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 529664560
Please help someone, I am struggling a lot with this.
ok i think its because youre sending multiple requests to roblox to access your datastores simultaneously and so roblox isnt allowing them to go through. maybe try to access the database one at a time.
for example, you access your datastore with the rebirth script, then your gems script waits until the rebirth script has it’s data before accessing the datastore itself and so on
The Warning You Are Stuggling With Means That Your Are Updating/Getting Players Data Every Time. If You Want To Fix This You Should Store The “Clicks” Value As Variable And Only Update It When It’s Important. Like, When Data Changes.