Is it possible to make a cross-place data store save?

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.

1 Like

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.

When you create a datastore named “Badges” all places on your game also can access the created datastore.

As @TheLazyRaven said, you’re trying to use SetAsync() too much.

Is there a BindToClose() function that saves data anywhere?

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.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.