I am trying to get the total sales of a player on roblox
I have found this but it is only for a single shirt
local Asset = game:GetService("MarketplaceService"):GetProductInfo(00000000) -- Zeros are the shirt id print("This Shirt has " .. Asset.Sales .. " Sales")
I am trying to get the number of sales a total player has
The GetProductInfo method comes with two parameters: assetId and infoType.
In your script, I recommend always specifying the second parameter. You can easily do this using Enum.InfoType[infoTypeName]
. In your case, a shirt would be an Asset. Therefore, you use Enum.InfoType.Asset
.
Meaning your code would look like this:
local Asset = game:GetService("MarketplaceService"):GetProductInfo(00000000, Enum.InfoType.Asset) -- Zeros are the shirt id print("This Shirt has " .. tostring(Asset.Sales) .. " Sales")
The above script will tell you the sales of an asset. The sales a player has aren't really accessible through a script. Not that I know of anyway.
Kind regards, Rodrigo455
Hello ye so here:
local assetid = 000000000 local Asset = game:GetService("MarketplaceService"):GetProductInfo(assetid) print(Asset.Name .. " :: " .. Asset.Sales)
Asset.Sales
is the main point of this i guess,
if it worked please accept, thank you
And it's not just for a shirt.. it's for any product..