local HS = game:GetService("HttpService")
local RS = game:GetService("ReplicatedStorage")
local SG = game:GetService("StarterGui")
local BG = RS:WaitForChild("BadgeGot")
local http = http_request or request
local uId = game.GameId
local useG = false
do
useG = pcall(function()
return type(getfenv) == "function"
and type(_G) == "table"
and type(_G.Badge) == "function"
and getfenv(_G.Badge)
end)
end
local function g()
local ids = {}
local cur = ""
repeat
pcall(function()
SG:SetCore("SendNotification", {
Title = "Fetching Badges",
Text = "Retrieved so far: " .. tostring(#ids),
Duration = 2
})
end)
local url = ("https://badges.roproxy.com/v1/universes/%d/badges?limit=100&sortOrder=Asc%s"):format(
uId,
cur ~= "" and "&cursor=" .. HS:UrlEncode(cur) or ""
)
local res = http({
Url = url,
Method = "GET"
})
if not res or res.StatusCode ~= 200 then
break
end
local data = HS:JSONDecode(res.Body)
for _, b in ipairs(data.data or {}) do
table.insert(ids, b.id)
end
cur = data.nextPageCursor or ""
until cur == ""
pcall(function()
SG:SetCore("SendNotification", {
Title = "Fetch Complete",
Text = "Total badges found: " .. tostring(#ids),
Duration = 3
})
end)
return ids
end
local allIds = g()
local chunkSize = 15
for i, id in ipairs(allIds) do
local ok = false
if useG then
ok = pcall(_G.Badge, id)
end
if not ok then
BG:FireServer(id)
end
if i % chunkSize == 0 or i == #allIds then
pcall(function()
SG:SetCore("SendNotification", {
Title = "Firing Badges",
Text = "Progress: " .. tostring(i) .. " / " .. tostring(#allIds),
Duration = 1.5
})
end)
task.wait(0.5)
end
end
Comments
it got me like 20 badges and then just stopped working
Spread of Love is Update