When I added player point rewards to my game I didn’t know there is a max integer limit so I awarded way too many points. A lot of players reached the maximum amount of 32bit number. It would be nice if we could get a reset leaderboards button which would restart player points.
I have also tried to reset it by negating users points but there is a limit 60 requests per min which would take way too long to reset 200k players
My attempt
local HttpService = game:GetService("HttpService")
local PointsService = game:GetService("PointsService")
local DONE = false
local function CleanStuff(i)
local data = HttpService:JSONDecode(HttpService:GetAsync("https://rprxy.xyz/leaderboards/game/json?targetType=0&distributorTargetId=329972392&timeFilter=3&startIndex="..i.."¤tRank=1&previousPoints=2046006349&max=50"))
if #data == 0 then
DONE = true
return
end
for _,x in ipairs(data)do
spawn(function()
local s, e = pcall(function()
local count = PointsService:GetGamePointBalance(x.UserId)
PointsService:AwardPoints(x.UserId, -count)
end)
if not s then
print(e)
end
end)
end
end
local i = 0
while not DONE do
CleanStuff(i)
i = i + 50
wait(50)
end
print("done")