If I used data store to save a value in one place, how would I get that saved value in the other place?
Data Store script in the first place:
local quirkstore = game:GetService("DataStoreService"):GetDataStore("Quirk") game.Players.PlayerAdded:connect(function(plr) local stats = Instance.new("IntValue", plr) stats.Name = "leaderstats" local quirk = Instance.new("StringValue", stats) quirk.Name = "Quirk" quirk.Value = quirkstore:GetAsync(plr.userId) or "" quirkstore:SetAsync(plr.userId, quirk.Value) end) game.Players.PlayerRemoving:connect(function(plr) print("Saving Player Data") quirkstore:SetAsync(plr.userId, plr.leaderstats.Quirk.Value) print(plr.leaderstats.Quirk.Value.." Has been saved") end)
If the places are part of the same game, you can simply use the same DataStore name and it will go through. Just put the same script in the second place if they aren't.