Use Data:SetAsync({true}), most not supported values for SetAsync can be saved with wrapping them inside a table but I do not recommend making a lot of storages for different values, just wrap them all inside a one table and save that table in only one storage.
DataStores can save booleans because they can be serialised into a string format. Anything that’s serialisable into a string can be saved as a raw value to a DataStore or you can pass a table if you’re looking to store more than one value. Table wrapping is unnecessary for single-value DataStores.
local function createStatsTable(player)
local playerStatsTable = {}
if player.leaderstats:GetChildren() then
for i, stat in pairs(player.leaderstats:GetChildren()) do
playerStatsTable[stat.Name] = stat.Value
end
end
Weird, I tried saving booleans or strings in DataStore but did not work, but I already edited my post that provides the reasons why you should wrap every value that could be saved inside a table in only one DataStorage
game.Players.PlayerAdded:connect(function(Ply)
local DS = game:GetService("DataStoreService") -- get datastoreservice
local plyhasjoined = DS:GetDataStore("PlyHasJoined" .. Ply.UserId) --get the datastore
if plyhasjoined:GetAsync("Value") == nil then --verify if the async VALUE is nil (if player never joined)
print("player is new !")
plyhasjoined:SetAsync("Value", true)
else -- else if player has arledy joined
print("player arledy joined !")
end
end)