(If I’m wrong about the topic, I’m sorry)
What is the difference between a regular DataStore and a DataStore with tables, and do I need to switch from a regular DataStore to a DataStore with tables?
Using tables in datastores is a huge game changer, You can store alot more data without having to worry to hit the limits.
1 Like
Forummer
(Forummer)
May 15, 2022, 3:53pm
#3
DataStores support a variety of data types (number, string, Boolean, table etc.), the benefit of tables is that they allow you to store multiple pieces of data that can be stored and loaded all at once (without issuing multiple requests to the DataStore).
1 Like
Is there a tutorial on these DataStore with tables somewhere?
(For me, writing a script with tables is a problem)
Valkyrop
(JustAGuy)
May 15, 2022, 3:55pm
#5
Yes, there are tons of tutorials, Ill link you some
I have never really used datastores with tables before. i was wondering how i can save and load the data easily.
here is my current script:
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local TestDataStore = DataStoreService:GetDataStore("emp43")
local data = {
["level"] = 1,
["kills"] = 0
}
Players.PlayerAdded:Connect(function(Player)
local DataFromStore = nil
local leaderstats = Instance.new("Folder")
leaderstats.Name = "lead…
I’m new to datastores and I don’t know how to store a table using it, how can I make this work?
local datastoreservice = game:GetService("DataStoreService")
local datastore = datastoreservice:GetDataStore("table")
local data
local player_id
game.Players.PlayerAdded:Connect(function(player)
local success, errormessage = pcall(function()
player_id = player.UserId
data = datastore:GetAsync(player_id)
end)
for name, value in pairs do
print(name)
print(value)
end
game.Players.Player…
How can I add so,ething to a table stored in a datastore?
2 Likes