Hey!
I have been making a save and load datastore system and whenever trying to use SaveData or LoadData I get this:
This is a Module, but it is required and used.
local DataStoreService = game:GetService("DataStoreService")
local MainDataStore1 = DataStoreService:GetDataStore("MAINDATASTORE1CAPTAN")
local DataModule = {}
function DataModule.SaveData(TABLE, player, Value)
if player:IsA("Player") and Value then
local PlayerId = "Player"..player.UserId
local Success, Message = pcall(function()
MainDataStore1:UpdateAsync(PlayerId, Value)
end)
if Success then
return true
else
warn("Data could not be saved for:", player)
warn(Message)
end
end
end
function DataModule.LoadData(TABLE, player : Player)
local Data
if player:IsA("Player") then
local PlayerId = "Player"..player.UserId
local Success, Message = pcall(function()
Data = MainDataStore1:GetAsync(PlayerId)
end)
if Success then
return Data
else
warn("Data could not be loaded for:", player)
warn(Message)
end
end
end
return DataModule