Is there any way to transfer DataStore from one game to another? (The Universe Id is different), I want to transfer the data from one game I have, to another game, but I dont know how to do it, I would appreciate help.
Datastore won’t work between games in different universes as far as I’m aware. You might need to look into utilising an external database of some kind and using the Post/Get methods within the HttpService.
I believe there are roblox modules available which will interface easily with certain cloud-based storage options. But I’ve not worked with them in a while so I’ll concede to anyone else with more experience.
as @darkelementallord said you would need to transfer the data to an external database then transfer it from there to the game again.
You will have to make use of API Keys and HTTP, I recommend Openblox I use it for my data related programs most of the time.
There is something you could do with just a proxy, but it’s a bit complicated.
You need an api key on game 1 with data store read permissions.
When the player joins game 2, send a HTTP request via RoProxy or a different proxy to get the player’s data from game 1. You can then JSON decode it to get the player’s data.
local httpService = game:GetService("HttpService")
local apiKey = httpService:GetSecret("APIKEY")
--then, to send the request:
local function getData(player: Player)
local url = "https://apis.roproxy.com/cloud/v2/universes/UNIVERSE_ID_FOR_GAME_1/data-stores/DATA_STORE_NAME/entries/DATA_KEY_FOR_PLAYER"
local success, response = pcall(httpService.RequestAsync, httpService, {
["Url"] = url,
["Method"] = "GET",
["Headers"] = {
["Content-Type"] = "application/json",
["x-api-key"] = apiKey
}
})
if (not success or response.StatusCode ~= 200) then
--failure
else
local data = httpService:JSONDecode(response)
return data.value --the player's data
--you can also access things like attributes and the etag associated with the data
end
end
If you used scopes, you’ll need to include the scope path in the url with /scopes/SCOPE
.