Hello! I am making a script in which player’s teleport to a different place inside my game, but I got stumped on one thing. I want my player’s coins value to be the exact same in the second place, and since it already saves with a datastore, I was wondering whether I could pull out the same data from the same store in the second place. Basically, if I had a store name “DataSave” and I have a value saved in there with my userid, if I run a GetAsync for the same store, just in a different place, will it return the same value, or a new one? Any help would be appreciated! Thank you!
2 Likes
As long as they’re within the same universal place & both named the same way, then yes!
--Place #1
local DataService = game:GetService("DataStoreService")
local GetData = DataService:GetDataStore("SavedData")
--Place #2
local DataService = game:GetService("DataStoreService")
local GetData = DataService:GetDataStore("SavedData")
This should work as long as you call your GetData
string the same name in both places
3 Likes
Thank you! This was exactly what I was asking for.
1 Like