What am I doing? I am creating an efficient datastoring module, very user friendly and easy to use.
What do I need help with?
The GetData part, I want to utilize tables for organization purposes. The real question is, how would I find the stuff inside the table? and find what it is?
Here is my code:
function DSSfunc.GetData(PlayerInstance, TableToGet, DictionaryName)
local data
local success, errormsg = pcall(function()
local Store = DSS:GetDataStore(DictionaryName)
data = Store:GetAsync(PlayerInstance)
end)
if success and data then
--Heres the problem
end
end
The call script:
local CanaryData = require(script.CanaryData)
local DataFolderName = ""
local DictionaryName = ""
game.Players.PlayerAdded:Connect(function(Player)
local TableToGet = {
-- Add paths to the instances inside the folder you want to save
-- For example: Player:WaitForChild(DataFolderName):WaitForChild("Instance")
Player:WaitForChild(DataFolderName):WaitForChild("")
}
-- << Add code here (remove)
end)
So really, how would I link the table in the callscript up with the module?
Heres the value adder (this probably has something to do with this)
function DSSfunc.AddValue(InstanceType, PlayerInstance, InstanceName, DefaultNumber, DefaultBool)
if InstanceType == "BoolValue" then
local BoolValue = Instance.new("BoolValue")
BoolValue.Parent = PlayerInstance
BoolValue.Name = InstanceName
BoolValue.Value = DefaultBool
elseif InstanceType == "StringValue" then
local StringValue = Instance.new("StringValue")
StringValue.Parent = PlayerInstance
StringValue.Name = InstanceName
StringValue.Value = DefaultNumber
elseif InstanceType == "NumberValue" then
local NumberValue = Instance.new("NumberValue")
NumberValue.Parent = PlayerInstance
NumberValue.Name = InstanceName
NumberValue.Value = DefaultNumber
end
end