DSS = DataStoreService
Hello! So I have a function that saves {["firstTimeJoined"]: number, ["totalXP"]: number, ["points"]: number}
to a DSS, except that I want to only save [“points”] sometimes, how would I do that?
Like calling DataStoreManager.savePlayerData(player, {["points"] = 78})
with only the points value, but it not overriding the others?
Here’s my code:
function DataStoreManager.savePlayerData(player: Player, playerData: {["firstTimeJoined"]: number, ["totalXP"]: number, ["points"]: number}): boolean
local maxTries: number = 5
local success: boolean
repeat
maxTries -= 1
success = pcall(function()PlayersStatsStore:SetAsync(player.UserId, playerData)end)
until success or maxTries == 0
return success
end
Thank you for helping!