Datastoring a table

Hello. Im new to scripting, especially datastores, And I was wondering how I can make this basic table save. Not for any players, but just save in general. I wont send my entire script. But the table I want to save is:
local logs = {}

use game:GetService("HttpService"):JSONEncode() to encode the table to a json string then save the table with :SetAsync() (more info here: Data Stores | Documentation - Roblox Creator Hub)

when you want to get the table from the datastore use :GetAsync() then decode the json string with game:GetService("HttpService"):JSONDecode()

You can just directly save a table with :SetAsync(): it doesn’t need to be converted to JSON because roblox does that by default when you use :SetAsync().

2 Likes