Hi! I’m working on a currency datastore for a game and I am getting this error;
The player is correctly defined when the function is used, so I’m not sure why it can’t find it?
Can someone please help?
CODE:
function M:SaveData(Player)
print("Saved Data")
local Data = {
Player.Data.Coins.Value,
Player.Data.OwnsTeacher.Value,
Player.Data.OwnsExtrLead.Value,
}
local s,e = pcall(function()
CoinsStore:SetAsync(Player.UserId, Data)
end)
if s then
print("Updated Datastore for "..Player.Name)
elseif e then
print(e)
end
end