How to make saves for a table?
QuestsData.Info = {
["ThugQuest"] = {
["Rewards"] = {
Money = 10;
Exp = 20;
},
["Settings"] = {
IsActive = false;
Completed = false;
Step = nil;
Progress = 0
},
},
["DioQuest"] = {
["Rewards"] = {
Money = 50;
Exp = 200;
},
["Settings"] = {
IsActive = false;
Completed = false;
Step = nil;
Progress = 0
},
},
["JotaroQuest"] = {
["Rewards"] = {
Money = 25;
Exp = 200;
},
["Settings"] = {
IsActive = false;
Completed = false;
Step = nil;
Progress = 0
},
},
}
You just need to save a few things in the table, these are:
local SaveableSettings = {
"IsActive",
"Completed",
"Step",
"Progress",
}
Just put it all into a Datastore using DataStoreService
QuestsData.Info = {
["ThugQuest"] = {
["Rewards"] = {
Money = 10;
Exp = 20;
},
["Settings"] = {
IsActive = false;
Completed = false;
Step = nil;
Progress = 0
},
},
["DioQuest"] = {
["Rewards"] = {
Money = 50;
Exp = 200;
},
["Settings"] = {
IsActive = false;
Completed = false;
Step = nil;
Progress = 0
},
},
["JotaroQuest"] = {
["Rewards"] = {
Money = 25;
Exp = 200;
},
["Settings"] = {
["IsActive"] = false; --make them like this
Completed = false;
Step = nil;
Progress = 0
},
},
}
local SaveableSettings = {
"IsActive",
"Completed",
"Step",
"Progress",
}
for _,item in pairs(QuestsData.Info) do
for i,v in pairs(SaveableSettings) do
if table.find(item,v) than
--save
end
end
end
1 Like
hey, i idk how to make save. Can you write fully?
local Data = game:GetService(“DataStoreService”):GetDataStore(“Quests”)