local http = game:GetService("HttpService")
local baseUrl = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber=%s&userId=%s"
local function getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
gamepasses = gamepasses or {}
pageNumber = pageNumber or 1
lastLength = lastLength or math.huge
local requestUrl = baseUrl:format(pageNumber, userId)
local success, result = pcall(function()
return http:GetAsync(requestUrl)
end)
if success then
if result then
local success2, result2 = pcall(function()
return http:JSONDecode(result)
end)
if success2 then
if result2 then
for _, gamepass in ipairs(result2.Data.Items) do
if gamepass.Creator.Id == userId then
table.insert(gamepasses, gamepass.Item.AssetId)
end
end
if result:len() ~= lastLength then
lastLength = result:len()
pageNumber += 1
getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
end
end
else
warn(result)
getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
end
end
else
warn(result)
getUserCreatedGamepassesRecursive(userId, gamepasses, pageNumber, lastLength)
end
return gamepasses
end
local player = game.Players.LocalPlayer
local playerId = player.UserId
local userGamepasses = getUserCreatedGamepassesRecursive(playerId)
local frame = Instance.new("Frame")
frame.Name = "PiggyBank"
frame.Size = UDim2.new(0, 200, 0, 200)
frame.Position = UDim2.new(0.5, -100, 0.5, -100)
frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
frame.Parent = player.PlayerGui
local textLabel = Instance.new("TextLabel")
textLabel.Name = "Gamepasses"
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Gamepasses:"
textLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
textLabel.TextScaled = true
textLabel.Parent = frame
for _, gamepassId in ipairs(userGamepasses) do
local gamepassButton = Instance.new("TextButton")
gamepassButton.Name = "Gamepass"..gamepassId
gamepassButton.Size = UDim2.new(1, 0, 0, 20)
gamepassButton.Position = UDim2.new(0, 0, 0, 20)
gamepassButton.Text = "Gamepass "..gamepassId
gamepassButton.TextColor3 = Color3.fromRGB(0, 0, 0)
gamepassButton.TextScaled = true
gamepassButton.Parent = frame
end
(this plugin try to fix it)