Its kinda of complicated. I already have a table, I just want to insert dictionary values into the already existing table. As said before, I already tried the code above but nothing happened.
local dataTable = {}
function DM:SetAsync(player: Player, key: string, value: any)
local profile = Profiles[player]
if profile then
dataTable[key] = value
end
end
I followed @okeanskiy’s tutorial on how to set it up, then I made my own getter/setter functions.
local dataTable = {}
function DM:SetAsync(player: Player, key: string, value: any)
local profile = Profiles[player]
if profile then
profile.Data[key] = value
end
end
local DataManager = require(game.ServerStorage.DataManager)
game.Players.PlayerAdded:Connect(function(player)
local Data = DataManager:GetAsync(player)
DataManager:SetAsync(player, "Cash", 100)
print(player.Name .. " has " .. Data["Cash"]) -- errors here saying that its nil while its clearly not.
end)
Show me that function (i gtg sry, if i came back and it isn’t solved i’ll help you, you can dm me here or discord Msix29#7740 if you want, I am really sorry!)