How can I calculate the price of an avatar?

I want to make a system where you can check the Robux value of a player’s avatar. I want to calculate the price of the shirts, pants, t-shirts, and all other accessories. How can I do this?

I’ve found HumanoidDescription but I don’t know if I can do anything about it.

3 Likes

I’d suggest collecting all the items on the avatar, then using a proxy getting info of one item, detect the price and plus it with another price if that makes sense.

3 Likes

Use a proxy to get all of their items then use MarketplaceService to get the price of those items. Or you can just keep using the proxy to do that

I don’t plan to use any proxy or HttpService. Are there any alternatives?

Found the function I was looking for.
Players:GetCharacterAppearanceInfoAsync() and MarketplaceService:GetProductInfo() should suffice.

Edit: Here’s an example script. Chat someone’s username, you get their avatar worth printed.
This is probably a bit inaccurate but it should work decent enough.

local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
function GetAvatarWorth(id)
	local info = Players:GetCharacterAppearanceInfoAsync(id) -- Get the info
	local items = info.assets -- Get player items
	local Avatar_Worth = 0 -- Avatar worth in Robux
	for x,v in pairs(items) do -- For every key/value pair in items do...
		local ProductInfo = MarketplaceService:GetProductInfo(v.id,Enum.InfoType.Asset) -- Get product info
		if ProductInfo.IsForSale then -- If it's for sale...
			Avatar_Worth += ProductInfo.PriceInRobux -- Add price in robux
		end
	end
	return Avatar_Worth -- Return avatar worth
end
Players.PlayerAdded:Connect(function(player)
	print(player.Name .. "'s avatar is worth " .. GetAvatarWorth(player.UserId) .. " Robux")
	player.Chatted:Connect(function(msg)
		local PN = Players:GetUserIdFromNameAsync(msg)
		if PN then
			print(GetAvatarWorth(PN))
		end
	end)
end)
8 Likes

Posted a method to calculate an avatar price without HttpService. Happy coding!

Thank you, it works great. No hassle with HttpService.

imagine a plugin in webstore, that’s would be epic