Recently my quick little donate game has stopped working. It uses RoProxy to retrieve all gamepasses and shirts that user has for sale, then displays them in a GUI.
Now for some reason it only displays my gamepasses. I am really confused. It does not show other people their gamepasses. Only me. Any ideas?
Here is a quick script i found in another post that i used to quickly test it and sure, it returns “0” for everyone except me. Can someone try it on their own ID and mine? Thanks
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 userGamepasses = getUserCreatedGamepassesRecursive(856770377)
print(#userGamepasses) --6 gamepasses.
for _, gamepassId in ipairs(userGamepasses) do
print(gamepassId) --6 gamepass IDs.
end
The script you posted is making a request to the RoProxy website to retrieve a list of game passes that the specified user has created. It seems that the issue you are experiencing is that the script is only returning game passes created by the user specified in the getUserCreatedGamepassesRecursive function, rather than game passes owned by the user.
To retrieve game passes owned by a user, you can make a request to the Roblox API to get a list of game passes owned by a user. You will need to use an access token with the ReadInventory scope to make this request. Here is an example of how you can do this using the HttpService :
local http = game:GetService("HttpService")
local userId = 856770377
local apiUrl = "https://api.roblox.com/Ownership/HasAsset?userId="..userId.."&assetId=%s"
local function getUserOwnedGamepasses(userId)
local ownedGamepasses = {}
-- Make a request to the Roblox API for each game pass to check if the user owns it
for assetId = 1, 100 do
local requestUrl = apiUrl:format(assetId)
local success, result = pcall(function()
return http:GetAsync(requestUrl)
end)
if success then
if result == "true" then
table.insert(ownedGamepasses, assetId)
end
else
warn(result)
end
end
return ownedGamepasses
end
local userGamepasses = getUserOwnedGamepasses(userId)
print(#userGamepasses)
for _, gamepassId in ipairs(userGamepasses) do
print(gamepassId)
end
This script will make a request to the Roblox API for each game pass from ID 1 to ID 100, and check if the specified user owns the game pass. If the user does own the game pass, the asset ID will be added to the ownedGamepasses table. At the end, the ownedGamepasses table will contain the IDs of all game passes that the user owns.
I apologize for misunderstanding the purpose of the script. To retrieve game passes created by a user, you can use the Roblox API to get a list of assets owned by a user, and then filter the results to only include game passes. You can use the AssetTypeId field in the response to determine the type of asset, and check if it is a game pass ( AssetTypeId of 8).
Here is an example of how you can do this using the HttpService:
local http = game:GetService("HttpService")
local userId = 856770377
local apiUrl = "https://api.roblox.com/Ownership/v1/Owners/Users/%s/Assets/Infinite?limit=1000"
local function getUserCreatedGamepasses(userId)
local createdGamepasses = {}
-- Make a request to the Roblox API to get a list of assets owned by the user
local requestUrl = apiUrl:format(userId)
local success, result = pcall(function()
return http:GetAsync(requestUrl)
end)
if success then
local assets = result:match("%b{}")
assets = assets and game:GetService("HttpService"):JSONDecode(assets)
if assets then
-- Iterate through the assets and add game passes to the createdGamepasses table
for _, asset in ipairs(assets) do
if asset.AssetTypeId == 8 then
table.insert(createdGamepasses, asset.AssetId)
end
end
end
else
warn(result)
end
return createdGamepasses
end
local userGamepasses = getUserCreatedGamepasses(userId)
print(#userGamepasses)
for _, gamepassId in ipairs(userGamepasses) do
print(gamepassId)
end
This script will make a request to the Roblox API to get a list of assets owned by the specified user, and then iterate through the assets to find game passes (assets with an AssetTypeId of 8). The IDs of the game passes will be added to the createdGamepasses table, which will be returned at the end.
Well, as I had said, there probably isn’t a way around checking the user’s inventory and going through those gamepasses to find ones that they own, which won’t work if they have their inventory set to no one. But, you may be able to iterate through the games that they have created, and check the gamepasses under those games.
It might just be a roproxy issue, it was working around a month ago.
Anyways the other guy is 100% using chatgpt, i know because it always responds with “I apologize for the error in my previous response.” when you point out an error in a script.
No, the issue is that they have their inventory private. Try turning your inventory to something other than “Everyone,” and roproxy will provide an empty list of items.