Basically if I save something into a table, I'd need to know the name of it + the asset id so I can put it in the players inventory labeling it the name.
How can I do this?
Example;
ds= game:GetService("DataStoreService"):GetDataStore("Example") local rolled= game.ReplicatedStorage.RolledSomething rolled.OnServerEvent:Connect(function(plr, name, id) local skins= {} ds:SetASync() -- How to add both to the table? end)
This is for a skin script, so players can change their assets skin texture
Use table.insert, or just do this:
local skins = {name, id} ds:SetAsync(key, skins)
Though of note is that you shouldn't really be using SetAsync as it might overwrite some saved data. It's recommended to use UpdateAsync instead.