Issue with player RAP counter

I’m creating a trading game similar to trading hangout, but I ran into an issue while creating the RAP counter. The script is able to find MOST limiteds in the player’s inventory and calculate the RAP, however it isn’t picking up on limited items that aren’t accessories.

I’m using HttpProxyService by @TheNexusAvenger to get API from roblox (which is working)

I’m thinking I may be using the incorrect API, if anybody knows which one I should be using, and if I’d need to change my script to use the API correctly, please let me know.

Here’s my script:

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

local HttpProxy = ServerStorage:WaitForChild("HttpProxyService")
local URL = "https://inventory.roblox.com/v1/users/%d/assets/collectibles?assetType=Hat&sortOrder=Asc&limit=100"

local function onPlayerAdded(player)
	local invURL = URL:format(player.UserId)
	
	local proxy = HttpProxy:Clone()
	proxy.Name = "PlayerProxy"
	proxy.Parent = player
	
	local inv = require(proxy):GetAsync(invURL).data
	local RAP = 0
	
	for _, item in pairs(inv) do
		RAP = RAP + item.recentAveragePrice
	end
	
	print(RAP)
end

Players.PlayerAdded:Connect(onPlayerAdded)

Thanks in advance to all who reply :slightly_smiling_face:

1 Like

Hello!

I’ve noticed in your link one of your parameters you have restricted to only returning back “Hat” (assetType=Hat)