I’ve been trying to use DataStoreService to store applications, using tables. I can save them, and retrieve them and what is inside them, but I don’t know how to create an application then save it or remove an application.
local Applications = {
["1"] = {
['Username'] = "h",
['Questions'] = {},
['Status'] = "Pending"
};
["2"] = {
['Username'] = "asdads",
['Questions'] = {},
['Status'] = "Passed"
};
}
local DSS = game:GetService("DataStoreService"):GetDataStore("ApplyNow")
game.Players.PlayerAdded:connect(function(plr)
print(plr.Name.."joined")
local uniquekey = 'id-'..plr.userId
local GetSaved = DSS:GetAsync(uniquekey)
end)
game.Players.PlayerRemoving:connect(function(plr)
local uniquekey = 'id-'..plr.userId
local Savetable = {Applications}
DSS:SetAsync(uniquekey, Savetable)
end)
I have built in two applications for testing, but I don’t know how to create an application and then save it into my DataStore.