Heres the script that i have but when i print the datastore i get nil:
Script:
Data = game:GetService("DataStoreService"):GetDataStore("BlastOffMoons") JSON = game:GetService("HttpService") Tycoon = '' local base local corner local placedItems = {} game.Players.PlayerAdded:connect(function(Player) repeat wait(1) until Player.Character repeat wait() until workspace.TestTycoon.Owner.Value ~= '' if workspace.TestTycoon.Owner.Value == Player.Name then Tycoon = workspace.TestTycoon end local plrData = Data:GetAsync(Player.UserId) print(plrData) if plrData then for i, Object in pairs(game:GetService("ReplicatedStorage").GameItems:GetChildren()) do for e, Data in pairs(plrData:GetChildren()) do if Object.Name == Data[1] then local newObject = Object:Clone() newObject.Parent = Tycoon.TestItems local location = tonumber(Data[2],Data[3],Data[4]) newObject:SetPrimaryPartCFrame(location) end end end end end) game.Players.PlayerRemoving:connect(function(plr) if workspace.TestTycoon.Owner.Value == plr.Name then Tycoon = workspace.TestTycoon base = Tycoon.Base corner = Tycoon.Base.Position - (Tycoon.Base.Size/3) print(corner) end local playerData = { Money = plr.Money.Value, Placed = {['itemPositions:'] = {}} } Tycoon = workspace.TestTycoon for i, v in pairs(Tycoon.TestItems:GetChildren()) do print(v.ClassName) if v:IsA('Model') then table.insert(playerData.Placed["itemPositions:"], {v.Name, v.PrimaryPart.Position.x,v.PrimaryPart.Position.y, v.PrimaryPart.Position.z}) print(JSON:JSONEncode(playerData)) Data:SetAsync(plr.UserId, playerData) end end end)