How would I go about saving around 7 StringValues to one datastore? I have a datastore script set up for individual values, but I want to save and load multiple from 1 datastore, but I don’t know how.
Here’s my script: (datastores have been changed to avoid accessing them)
local datastoreService = game:GetService("DataStoreService")
local SpeciesData = datastoreService:GetDataStore("stet")
local WonderAmountData = datastoreService:GetDataStore("stetet")
local WondersData = datastoreService:GetDataStore("stetert")
local BloodlineData = datastoreService:GetDataStore("strte")
local s
local wa
local w
local b
game.Players.PlayerAdded:Connect(function(player)
local bloodline = Instance.new("StringValue", player)
bloodline.Name = "Bloodline"
bloodline.Value = BloodlineData:GetAsync(player.UserId) or nil
if bloodline.Value ~= nil then
b = true
else
b = false
end
local wonderamount = Instance.new("StringValue", player)
wonderamount.Name = "WonderAmount"
wonderamount.Value = WonderAmountData:GetAsync(player.UserId) or nil
if wonderamount.Value ~= nil then
wa = true
else
wa = false
end
local species = Instance.new("StringValue", player)
species.Name = "Species"
species.Value = SpeciesData:GetAsync(player.UserId) or nil
if species.Value ~= nil then
s = true
else
s = false
end
-- i want to save multiple string values to the Wonders datatstore here
end)