What do you want to achieve?
Hey, I am trying to Save the Player’s Strength Level using Data Store
What is the issue?
When I play the game it prints Strength Loaded Successfully but when I leave the game it doesn’t print Strength Saved Successfully but instead gives an error in the output: “DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 926196310”
What solutions have you tried so far?
I have tried saving all three values to One Data Store but still gives the same result. I have also tried reading other posts but it didn’t quite help.
local DataStoreService = game:GetService("DataStoreService")
local StrengthLevelDataStore = {
StrengthlevelDS = DataStoreService:GetDataStore("StrengthLevel"),
StrengthcurrentexpDS = DataStoreService:GetDataStore("StrengthCurrentExp"),
StrengthexpleftDS = DataStoreService:GetDataStore("StrengthExpLeft")
}
game.Players.PlayerAdded:Connect(function(Player)
local Skills = Instance.new("Folder")
Skills.Name = "Skills"
Skills.Parent = Player
local Strength = Instance.new("Folder")
Strength.Name = "Strength"
Strength.Parent = Skills
local StrengthLevel = Instance.new("IntValue")
StrengthLevel.Name = "StrengthLevel"
StrengthLevel.Parent = Strength
StrengthLevel.Value = 1
local StrengthExpLeft = Instance.new("IntValue")
StrengthExpLeft.Name = "StrengthExpLeft"
StrengthExpLeft.Parent = Strength
StrengthExpLeft.Value = 100
local StrengthCurrentExp = Instance.new("IntValue")
StrengthCurrentExp.Name = "StrengthCurrentExp"
StrengthCurrentExp.Parent = Strength
StrengthCurrentExp.Value = 0
local playerUserId = "Player: "..Player.UserId
local StrengthLevelDataAsync = {
StrengthlevelDA = DataStoreService:GetDataStore("StrengthLevel"),
StrengthcurrentexpDA = DataStoreService:GetDataStore("StrengthCurrentExp"),
StrengthexpleftDA = DataStoreService:GetDataStore("StrengthExpLeft")
}
local success,errormessage = pcall(function()
StrengthLevelDataAsync.StrengthlevelDA = StrengthLevelDataStore.StrengthlevelDS:GetAsync(playerUserId)
StrengthLevelDataAsync.StrengthcurrentexpDA = StrengthLevelDataStore.StrengthcurrentexpDS:GetAsync(playerUserId)
StrengthLevelDataAsync.StrengthexpleftDA = StrengthLevelDataStore.StrengthexpleftDS:GetAsync(playerUserId)
end)
if success then
if StrengthLevelDataAsync.StrengthlevelDA == 0 then
StrengthLevel.Value = 1
else
StrengthLevel.Value = StrengthLevelDataAsync.StrengthlevelDA
end
if StrengthLevelDataAsync.StrengthexpleftDA == 0 then
StrengthExpLeft.Value = 100
else
StrengthExpLeft.Value = StrengthLevelDataAsync.StrengthexpleftDA
end
StrengthCurrentExp.Value = StrengthLevelDataAsync.StrengthcurrentexpDA
local StrengthEventLoad = game:GetService("ReplicatedStorage"):WaitForChild("SavingRemoteEvents").Skills.strengthsave
StrengthEventLoad:FireClient(Player)
print("Strength Loaded Successfully!")
else
print("An Error occured while Loading Strength")
end
end)
I’ve experienced this issue before.
The error shows up if you’re saving data too quickly. As @dollychun showed, there are datastore limits. I suggest possibly adding a debounce or using an autosave
It sounds a bit weird but I tried printing success and errormessage but it doesn’t print it. Then I tried printing print("test") and it doesn’t print test too.
You CAN save tables to a normal datastore (not an orderedDatastore though). You do not need to convert it to a string. The reason he’s getting the error is due to the fact that he’s trying to save the actual intValue object (not the value of the intValue):
All he needs to do to fix this is simply add .Value at the end of each one:
Can you post your current script because I’ve tested your previous datastore sent in your 4th post with .Value at the end and it worked perfectly fine.