I’m making a new weapon saving system, and I’ve encountered a pretty big problem: I don’t know how to save the “Unlocked” status for all weapons, which is a bool value. Is it possible to save like a table consisted of the weapon name and this bool value?
I would solve this issue by setting the datastore to a blank table, then inserting a table of all the information you want to store using the UpdateAsync() function, the code would probably look like this
local gunData = game:GetService("DataStoreService"):GetDataStore("GunAtts")
local success, err = pcall(function()
gunData:UpdateAsync("Key", function(oldVal)
local newGunData = {}
table.insert(newGunData, "Table")
return newGunData
end)
end)
if success then print("Yippee!") end
Ah thats true, If you just wanted to change the table entry then this would work, since GunAtts would only have one entry you could also just store one table