How could I get how much RAP the player has?

Yo, if the player’s view inventory access is false, the http returns forbidden. How should we approach for this?

You cannot display RAP if the player has their inventory privated.

From a design POV you could just ask them to make their inventory public

I got it, I made an instance for each player then wrapped a function to check after the player is loaded. If the instance isn’t there then that means the player has it off.

INVENTORY VIEW ENABLED:

INVENTORY VIEW DISABLED:
image

I am finding that this only works if the player has less than 100 collectable items. For example, using this method none of Shedletsky’s limited are counted past “Specular Egg of Red, No Blue”.

Is there a way to get around this?

Fancy seeing you here @codefroze

Navigate to the next page using nextPageCursor until it is null.

local HTTPService = game:GetService("HttpService")

local function GetRAPForUserId(UserId)
	local RAP = 0
	local Cursor = ""
	
	while (Cursor) do
		local Link = ("https://inventory.rprxy.xyz/v1/users/%s/assets/collectibles?sortOrder=Asc&limit=100&cursor=%s"):format(UserId, Cursor)
		local Response = HTTPService:JSONDecode(HTTPService:GetAsync(Link))
		
		local Data = Response.data
		
		for i, Asset in pairs(Data) do
			RAP = RAP + Asset.recentAveragePrice
		end
		
		Cursor = Response.nextPageCursor
	end
	
	return RAP
end

print(GetRAPForUserId(261))
1 Like

What is RAP?
(I’ve heard this many times but I’ve never figured out what it is.)

Rap is a shortened of “Recent Average Price”. Getting their rap is bascially getting their total rap by using the API provided by Roblox.

The RAP is, in essence, the value of limited items on Roblox. It’s what is used by “traders” to determine what an item on the Roblox platform is worth. You can see the RAP of a specific item here:


Often, the RAP of an item will be very different to the best price, which is the cheapest price that the item is obtainable for via robux - not trading.

1 Like

What is the “numerify” function declared as