Hey there, just wanted to know how i can proceed metatable for this kind of systems so in case of missing data it just straight up return a fresh and new table without a lot of useless if checks.
However im encountering nil as print. How should i resolve this?

-- Services
local DataStoreService = game:GetService("DataStoreService")
local PlayersS = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Reco the datastore
local BankDataStore = DataStoreService:GetDataStore("UserBank")
local GeneralData = {
__index = function(GeneralData,index)
warn("GeneralData: "..tostring(index).." is not a valid member of GeneralData")
return {
DaillyClaimLimit = 500000,
}
end,
}
setmetatable(GeneralData,{})
PlayersS.PlayerAdded:Connect(function(player)
print(GeneralData[player.UserId])
end)