Need help with a devforum rank leaderboard

I want to edit a leaderboard script to show the devforum rank of each player, but I don’t know much about scripting. All I need to know is how I can fetch these ranks. Any solutions?

(I’ll be reading replies at a later time, I need to sleep since it’s 4 am for me.)

1 Like

You just need to make a GET request to the player’s devforum profile json. Make sure you enable HTTP requests. To quickly do that if you haven’t already just run this in command bar:

game:GetService("HttpService").HttpEnabled = true

Since you can’t make requests to roblox.com or *.roblox.com you will need to use a proxy. I will use rprxy.xyz.

local URL_FORMAT = "https://devforum.rprxy.xyz/u/%s.json"

local Players = game:GetService("Players")
local HttpService = game:GetService("HttpService")

You’ll then want to listen for PlayerAdded.

Players.PlayerAdded:Connect(function(player)
    
end)

Then making the GET request to the proxy to get their devforum info.

local request_data = HttpService:RequestAsync({
    Url = URL_FORMAT:format(player.Name),
    Method = "GET"
})

Now you want to make sure this was successful, you will get an error if something went wrong or if the player doesn’t have a devforum account.

if request_data.Success then
    
end

So if it was successful then get the body of the result and decode it from JSON into a Lua table.

    local data = HttpService:JSONDecode(request_data.Body)

Then from here you can get the trust_level from the user field.

    print(data.user.trust_level)
3 Likes

Thanks for the help, I’ll make sure to try this later.

1 Like

I got this error image