local service = game:GetService("DataStoreService") local datastore = service:GetDataStore("lolaaaa1uh9") local toolstosave = { } game.Players.PlayerAdded:Connect(function(Player) if datastore:GetAsync(Player.userId) then for i, v in pairs(datastore:GetAsync(Player.userId)) do print(v) end end end) game.Players.PlayerRemoving:Connect(function(Player) local toolstosave = { } for i, v in pairs(Player.Backpack:GetChildren()) do table.insert(toolstosave, v.Name) end datastore:SetAsync(Player.userId, toolstosave) end)
Sometimes, it does not print anything when I join, even though I left with tools. Any fix?