Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Get the Total Sales of a Player?

Asked by 4 years ago

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

2 answers

Log in to vote
1
Answered by
Wiscript 622 Moderation Voter
4 years ago

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

Ad
Log in to vote
0
Answered by
VitroxVox 884 Moderation Voter
4 years ago
Edited 4 years ago

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..

Answer this question