How to make an *ACTUAL* PLS Donate Gamepass System

NOTE: This retrives all of a user’s gamepasses, regardless of their inventory being private/public

Ever wanted to make a PLS Donate game? Well I did, so I made it.
Here’s how:

So, we’re not just going to get a user’s public gamepasses from their inventory. We will RETRIEVE EVERY GAMEPASS the player has created on their games.

Let’s begin.
(getting a user’s clothing is fairly simple, and there’s already tutorials on that, so I won’t be covering this.

local function getUserGamepasses(userId)
        local url = "https://games.roproxy.com/v2/users/"..userId.."/games?accessFilter=2&limit=50&sortOrder=Asc"
        local suc, res = pcall(function()
            return HttpService:GetAsync(url)
        end)
        
        local placeIDs = {}
        if suc then
            if res then
                res = string.split(res,"},")
                
                for i, place in pairs(res) do
                    place = string.split(place,",")
                    
                    for _, thing in pairs(place) do
                        if string.find(thing,"id") and not string.find(thing,"rootPlace") then
                            place = thing
                            place = string.gsub(place,"%a","")
                            place = string.gsub(place,"%p","")
                            table.insert(placeIDs,place)
                        end
                    end
                end
            end
        end
        
        local gamepasses = {}
        local gamepassPrices = {}
        local increment = 1
        
        if #placeIDs > 0 then
            for i, place in pairs(placeIDs) do
                local url = "https://games.roproxy.com/v1/games/"..place.."/game-passes?limit=100&sortOrder=Asc"
                local suc, res = pcall(function()
                    return HttpService:GetAsync(url)
                end)
                
                res = string.split(res,"}")
                for x, gamepass in pairs(res) do
                    if string.find(gamepass,"id") then
                        local newPass = string.split(gamepass,",")
                        local productId = nil
                        local price = nil
                        
                        for _, info in pairs(newPass) do
                            if string.find(info,"id") then
                                productId = info
                                productId = string.gsub(productId,"%a","")
                                productId = string.gsub(productId,"%p","")
                            end
                            
                            if string.find(info,"price") then
                                price = info
                                price = string.gsub(price,"%a","")
                                price = string.gsub(price,"%p","")
                            end
                        end
                        
                        if productId and price then
                            if not table.find(gamepassPrices,price) then
                                gamepasses[increment] = {
                                    Item = {
                                        AssetId = tonumber(productId)
                                    };

                                    Product = {
                                        PriceInRobux = tonumber(price)
                                    };
                                }
                                
                                table.insert(gamepassPrices,price)
                                increment += 1
                            end
                        end
                    end
                end
            end
        end
        
        return gamepasses
    end

What this does is it loops through all of a player’s games, then loops through each game’s gamepasses and adds them to a table.

After running the function (on server of course), it will return a table full of gamepasses. Each gamepass has its own little table containing the AssetId (so you can make the player buy it), and the price of the gamepass.

That’s about it, sorry if I didn’t explain it that well, but the code works and that’s really all that matters haha, nobody ever bothers to read this much either way.

25 Likes

If this was possible, how come games like pls donate haven’t done this before?

I wish I could test this, but due to an error I’ve been having for days, I can’t open Studio.

Also, I wouldn’t really call this a tutorial since you’re just giving us the script and telling us what it does. You should move this to #resources:community-resources

Edit:

I’ve looked for a tutorial you mentioned about getting a user’s clothing without having a public inventory, and I can’t find it. Can you link it?

6 Likes

I just tried and the code doesn’t even work lol. Maybe actually test your script before creating a post about it

4 Likes

Even though I dont support making roblox players literally beg for ingame currency, why would you steal thier entire game? they came up with the idea, they made it popular and you just trying to milk it yourself even more.

4 Likes

Roproxy doesn’t work anymore. It’s not that simple. You need to host your own proxy on some cloud service online, which often has a monthly fee if you want a good one.

To my knowledge, there are no live, free Roblox API proxies. They’ve all been sunsetted or just shut down.

3 Likes

If you used it correctly (which you probably didn’t), and activated HTTP Requests, then it would’ve worked

2 Likes

roproxy does still work, i am currently using it

2 Likes

this has the clothes getting thing (and the gamepass getting thing, except it only gets the ones you own, not all of the gamepasses on your profile like PLS Donate does)

7 Likes

I legit copy and pasted the whole function into a script then printed it and the script returned a table with nothing inside

and yes i passed in a user id with gamepasses throughout different games

4 Likes

Did you figured it out? I actually need this also lol

4 Likes

Since I figured it out im just dropping helpful endpoints that works for that at the time of this posting.

Simple, get all the public games of the player and get all gamepasses of all these games.

Note:

  • Does work with private inventory, but the games need to be public to be seen.
  • Of course you will need a proxy to access this information. Get to host your own version of RoProxy Lite that will work for very cheap. Or any other proxy you find.
  • Make sure to cache this info! Dont keep repeating requests every time.
6 Likes

you don’t have to split JSON string like that. you can use HttpService:JSONDecode() to turn it into a Lua table. It have no yield.

1 Like

Damn I did not know that thanks so much, I’ll definitely use this in the future!

3 Likes

how does pls donate and other games do it

2 Likes

The same way as in my post, that’s the only way

1 Like

Stealing the game is a terrible idea as you prolly won’t get anything in return and you are wasting everyone’s time.

On the other hand this can be used to put a unique spin on the original concept for example starving artists

It can also be beneficial to see popular game’s code to better understand certain aspects that they use that may be complex.

4 Likes

no, you can do it even with private inventory

3 Likes

Yeah, definitely. It took me quite a while to figure it out so I decided it’s best to put it out there for anyone else who might be interested in it, so they don’t have to go through the same hassle as me

1 Like

Thanks you the script work perfectly :wink:

4 Likes