Hello. Is there a method to access DataStore from another game? I want to create place and read data from another place DataStore.
COMMUNITY QUESTION
Accessing DataStore from another game?
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Games is not in same universes
As SatireIncarnate said, it'd be easier on you to just put them in the same universe.