I’m having lots of trouble figuring out why my global leaderboard won’t update for everyone.
while true do
for i, player in pairs(game.Players:GetPlayers()) do
task.spawn(function()
local cash = playerCash:WaitForChild(player.Name)
pcall(function()
print(player.Name)
cashData:SetAsync(player.UserId, cash.TotalCash.Value)
gemData:SetAsync(player.UserId, cash.TotalGems.Value)
rebirthData:SetAsync(player.UserId, cash.PlayerRebirths.Value)
playTimeData:SetAsync(player.UserId, player.Values.PlayTime.Value)
print(player.Name.. " Cash = ".. cash.TotalCash.Value)
print(player.Name.. " Gems = ".. cash.TotalGems.Value)
end)
end)
end
task.wait(60)
end
I’m calling all players and using SetAsync to save their place on the leaderboard. However, it only works for some people.
^ An image of me and my alt in-game. You can see it prints my alt’s name, but doesn’t call SetAsync at all while only calling SetAsync for my own account.
I’ve tried searching on google & the devforum and used UpdateAsync instead of SetAsync. No luck. Been stuck on this for days now.
but it looks like your using 4 set requests every minute per player and you have a limit of 10 per player per minute so if your not using the datastore anywhere else it should not hit the limit