Hello,
[SUBJECT]: Me and my dev team are making a 2-game based DataStore system, basically where one game that creates all the Data and sets the Data (aka, the Loading Menu), then loads into the other game to Async the data from the Menu (aka, the Park).
[ERROR]: Basically, I honestly don't know what the error is, but all I know is from using an in-game explorer or checking the output.
[MENU DATASTORE]:
local Player local DataVersion = "Version 3" game.Players.PlayerAdded:connect(function(NPlayer) Player = game:GetService('Players').LocalPlayer --local as = tostring(NPlayer) repeat wait() until Player.Character local vs = script:WaitForChild("Inventory"):clone() --local ui = script:WaitForChild('BillboardGui'):Clone() vs.Name = NPlayer.UserId vs.Parent = NPlayer --ui.Parent = workspace[as].UpperTorso NPlayer:LoadCharacter() local Stats = vs:GetChildren() local S1 = {} for i=1,#Stats do local n = Stats[i].Name S1[n] = Stats[i].Value end if NPlayer.Name ~= "Player" then local DataStore = game:GetService("DataStoreService"):GetDataStore(DataVersion,NPlayer.UserId) if DataStore:GetAsync("Stats") == nil then DataStore:SetAsync("Stats", S1) end S1 = DataStore:GetAsync("Stats") end local vv = vs:GetChildren() for i=1,#vv do local n = vv[i].Name if S1[n] ~= nil then vv[i].Value = S1[n] end end --[[while wait() do if not Player.Character.UpperTorso:FindFirstChild('BillboardGui') then ui.Parent = workspace[as].UpperTorso end end--]] end) game.Players.PlayerRemoving:connect(function(p) local DataStore = game:GetService("DataStoreService"):GetDataStore(DataVersion,p.UserId) local Stats = p:FindFirstChild(""..p.UserId..""):GetChildren() local S1 = {} for i=1,#Stats do local n = Stats[i].Name S1[n] = Stats[i].Value end DataStore:SetAsync("Stats",S1) end) --[[game.ReplicatedStorage.Events.SaveData.OnServerEvent:connect(function(SaveData) local DataStore = game:GetService("DataStoreService"):GetDataStore(DataVersion,Player.UserId) local Stats = Player:FindFirstChild(""..Player.UserId..""):GetChildren() local s1 = game.ReplicatedStorage.DataInfo.Data print'saving data' for i=1,#Stats do local n = Stats[i].Name s1[n] = Stats[i].Value end DataStore:SetAsync("Stats",s1) print'saved data' end)--]]
[PARK DATASTORE]
local Player local DataVersion = "Version 3" game.Players.PlayerAdded:connect(function(NPlayer) Player = game:GetService('Players').LocalPlayer --local as = tostring(NPlayer) repeat wait() until Player.Character local vs = script:WaitForChild("Inventory"):clone() --local ui = script:WaitForChild('BillboardGui'):Clone() vs.Name = NPlayer.UserId vs.Parent = NPlayer --ui.Parent = workspace[as].UpperTorso NPlayer:LoadCharacter() local Stats = vs:GetChildren() local S1 = {} for i=1,#Stats do local n = Stats[i].Name S1[n] = Stats[i].Value end if NPlayer.Name ~= "Player" then local DataStore = game:GetService("DataStoreService"):GetDataStore(DataVersion,NPlayer.UserId) if DataStore:GetAsync("Stats") == nil then DataStore:SetAsync("Stats", S1) end S1 = DataStore:GetAsync("Stats") end local vv = vs:GetChildren() for i=1,#vv do local n = vv[i].Name if S1[n] ~= nil then vv[i].Value = S1[n] end end --[[while wait() do if not Player.Character.UpperTorso:FindFirstChild('BillboardGui') then ui.Parent = workspace[as].UpperTorso end end--]] end) game.Players.PlayerRemoving:connect(function(p) local DataStore = game:GetService("DataStoreService"):GetDataStore(DataVersion,p.UserId) local Stats = p:FindFirstChild(""..p.UserId..""):GetChildren() local S1 = {} for i=1,#Stats do local n = Stats[i].Name S1[n] = Stats[i].Value end DataStore:SetAsync("Stats",S1) end)
If you can help, please respond on here, or contact me on Discord. Discord: Resplendid#2571