Hey. So I have a script that calculates someone’s avatar value, but when I try to calculate ColdDeveloper’s avatar (Which I know is well over 50 million) it shows up as like 13,000.
The LocalScript:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local MarketplaceService = game:GetService("MarketplaceService")
local PlayerNameBox = script.Parent.PlayerName
local Check = script.Parent.Check
local PlayerName
local function AvatarWorth(id)
local info = Players:GetCharacterAppearanceInfoAsync(id)
local items = info.assets
local AvValue = 0
for i, v in pairs(items) do
local ProductInfo = MarketplaceService:GetProductInfo(v.id, Enum.InfoType.Asset)
if ProductInfo.IsForSale then
AvValue += ProductInfo.PriceInRobux
end
end
return AvValue
end
PlayerNameBox.FocusLost:Connect(function()
PlayerName = tostring(PlayerNameBox.Text)
end)
Check.MouseButton1Click:Connect(function()
local PlayerId = Players:GetUserIdFromNameAsync(PlayerName)
local AvatarValue = AvatarWorth(PlayerId)
if PlayerName ~= nil then
script.Parent.Parent.AvatarWorth.Text = PlayerName.."'s avatar is worth "..AvatarWorth(PlayerId)
end
end)