Hello, I'm trying to make a badge counter like the one in this (http://www.roblox.com/games/5166670285) game.
But when I use it, it gets something like 32,500 instead of 32,452. If anybody could help it would be very much appreciated
heres my code
local httpservice = game:GetService("HttpService") game.Players.PlayerAdded:Connect(function(p) local url = "https://badges.rprxy.xyz/v1/users/"..p.UserId.."/badges?limit=100&sortOrder=Asc" while true do local request = httpservice:JSONDecode(httpservice:GetAsync(url)) local cursor = request.nextPageCursor if cursor == "null" then break else url = "https://badges.rprxy.xyz/v1/users/"..p.UserId.."/badges?limit=100&sortOrder=Asc&cursor="..cursor p.leaderstats.Badges.Value += 100 end end end)
That's what happened to me quite a bit, as you see you are using += 100 and when it reaches the last page it won't add the value, it will add 100...
Basically you just need to add the total inside the page...
iirc, p.leaderstats.Badges.Value += #request.body or #request?
Note: Badges api no longer works for anyone who comes across this 5/18/21