I am trying to make a win/xp system that rewards you one win and math.random(80,100) xp each time you beat the game, but how would I make a data store capable of transferring that data back to my lobby place?
I have a leaderstats system so far, but I don’t know how to script it to save the data and transfer it to the game.
I tried a bunch of youtube videos and dev forums but they either have the error message
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 4246928482 - Studio
or they can’t be scripted to support two leaderstats.
I just want to know how I would go about creating a cross-place save datastore system and if it’s possible.
Have places under the same experience and access the datastore with the same name and key
local DataStoreService = game:GetService("DataStoreService")
local store = DataStoreService:GetDataStore("NameHere")
local success, errorMessage = pcall(function() -- pcalls catch errors
store:GetAsync("KeyHere", save) -- usually use tables for saves, key should vary by the player (mainly done with UserId)
end)
if not success then
print(errorMessage)
end
DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 4246928482 - Studio
This is because you’re attempting to :SetAsync too often. There are limits.
Consider learning the basics from youtube rather than diving straight into making your idea a reality. Learning is not as fun but it’ll be a pain to make a game if you’re unaware of what your code means.
Yeah after watching and reading the documentations about datastores I figured out how to limit the SetAsync() to 5 times per player and how to use the BindToClose() to call my servershutdown function when the servers shut down.