Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Accessing DataStore from another game?

Hello. Is there a method to access DataStore from another game? I want to create place and read data from another place DataStore.

2 answers

You can't

DataStores don't work across universes, so if you need to store data for two places you're better off either putting them in a Universe together, or using HttpService with a web service such as Trello.

Simply use the same DataStore you used in the first, and read from it just as you would normally.

In one game:

DS = game:GetService("DataStoreService"):GetDataStore("DataStoreName")
local key = "player_" ..player.userId
DS:SetAsync(key, "Test")

In another:

DS = game:GetService("DataStoreService"):GetDataStore("DataStoreName") -- Make sure it's the same name!
local key = "player_" ..player.userId
local test = DS:GetAsync(key)
print(test)

Should print Test. Hope this helped.

2 comments

0

Games is not in same universes

0

As SatireIncarnate said, it'd be easier on you to just put them in the same universe.

This discussion is preserved as it was. New answers, comments, and votes are closed.