I want to make a booth system similar to the roblox game PLS DONATE where players can donate to other players by purchasing gamepasses and shirts off of them. How can I get a players created shirts and gamepasses?
I need some clarification. Are you trying to load shirts onto a character, or trying to prompt purchase items that other people have created?
I am trying to prompt a purchase. I am not sure how to find all of a players created gamepasses and shirts so I can list them on the booths that is my issue. Hope that clarifies
I’ve never actually done this before, but I think you would just change the assetID to the id for the desired product.
- You can find ids by looking at the number in the url of the product page.
- If your trying to let the players put their own assets up for sale, you’ll need to have them input the assetID I think.
Hope this helps!
the game PLS DONATE essentially automatically grabs all of a players owned shirts and gamepasses and lists them for sale on a booth. Here is an example of what that looks like: (Players dont have to manually type in the gamepasses it automatically scans them all somehow) It also sorts them from least expensive to most as you can see here. This is what I am trying to replicate.
Hmmmm I’m not sure how they achieved that. I’d recommend looking around on the documentation
Or just wait for a smarter person to come along .
To achieve this you would use HTTPService, heres a post I found related to your question:
Player Created Gamepasses - Help and Feedback / Scripting Support - DevForum | Roblox
the http links no longer work unfortunately.
Hm, when I tested it, it worked for me:
local HTTPService = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(Player)
local Url = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber="..Player.UserId.."&userId="..Player.UserId
local Data = HTTPService:GetAsync(Url)
Data = HTTPService:JSONDecode(Data)
for _, value in pairs(Data.Data.Items) do
for _, GamepassData in pairs(value.Item) do
print(GamepassData)
end
end
end)
this is the error im getting when I run that code (yes HTTP requests are enabled)
Ok so for some reason it wont work in studio but it does work in-game however I have some issues.
- This only works for gamepasses. How could I get this to work with shirts, t-shirts, and pants as well?
- I have a gamepass listed on a game owned by me and it still says I dont have any gamepasses when I try to print them
This is my code:
local HTTPService = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(Player)
print("STARTING")
task.wait(5)
local Url = "https://www.roproxy.com/users/inventory/list-json?assetTypeId=34&cursor=&itemsPerPage=100&pageNumber="..Player.UserId.."&userId="..Player.UserId
local Data = HTTPService:GetAsync(Url)
Data = HTTPService:JSONDecode(Data)
print(#Data.Data.Items)
print("STARTING LOOP")
for _, value in pairs(Data.Data.Items) do
print("HI")
print(value)
print(value.Item)
for _, GamepassData in pairs(value.Item) do
print(GamepassData)
end
end
end)
This is the result printed
Just to double check I joined the game PLS DONATE which detects gamepasses and it detected my gamepass just fine yet here it claims I have 0 gamepasses.
You need to change the asset type ID. I believe it is something like 12 for shirts, 13 for t shirts, and 14 for pants. (Those numbers might be wrong, but it doesn’t hurt to try.)
I actually figured out how. The issue with the above code is that its checking the inventory and my inventory is private.
"https://catalog.roproxy.com/v1/search/items/details?Category=3&CreatorName="..Player.Name"
Using that link instead searches the catalog for things created by me. This can only get shirts, t-shirts, and pants however and not gamepasses. So I am assuming that the game PLS DONATE does this to bypass private inventories which is smart.
Now for gamepasses I am just going to assume that they get all of the places a player has made and scans them for gamepasses. I did a test on PLS DONATE and it actually only displays gamepasses that are on games that are public so this theory could be correct. I’m not sure how to go about scanning all of a players public games for gamepasses however so that remains my only standing issue at this point.