Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

UpdateAsync doesn't update the old value, help?

Asked by
xJigoku 17
4 years ago

It worked for lower numbers like numbers in Quintillion(Qn) and below, but it stopped updating the value after it got so high. I've tried for the past 20 mins to fix it and I can't think of any more ways to try.

local Stat = "Money"
local PlayerCount = 30

local DataStore = game:GetService("DataStoreService"):GetOrderedDataStore("Leaderboard_"..Stat)
local Pages = DataStore:GetSortedAsync(false,PlayerCount)
local Data = Pages:GetCurrentPage()

game.Players.PlayerRemoving:Connect(function(Player)
    if Player:FindFirstChild("Stats") then
       DataStore:UpdateAsync(Player.UserId, function(oldValue)
            return Player.Stats[Stat].Value
        end)
    end
end)
0
Are you sure that the value isn't being updated? Are you simply looking at the OrderedDataStore for that? Does the script ever reach the :UpdateAsync line? Ankur_007 290 — 4y
0
yea it reaches the line, I had a print statement in the function and it would print, it would just never update the value xJigoku 17 — 4y

Answer this question