MarketplaceService:GetProductInfo().Sales returns 0 In game?
Studio:
InGame:
local Gamepasses = {
[1] = 218170241,
[2] = 218180369,
}
local TotalRobux = 0
for Number, Pass in pairs(Gamepasses) do
local Info = MarketplaceService:GetProductInfo(Pass, Enum.InfoType.GamePass)
if Info then
local Sales = Info.Sales
local PriceInRobux = Info.PriceInRobux
print("Sales", Sales)
print("PriceInRobux", PriceInRobux)
if Sales and PriceInRobux then
TotalRobux += (Sales * PriceInRobux)
print("TotalRobux", TotalRobux)
end
end
end
Rest assured that this Service does what is required.
I believe what has you mistaken is your method of testing the increase. You see, when you purchase the gamepass within studio in a testing environment, it has the advantage of not taking your ROBUX away. However, this does not actually go to the server, hence no receipt is printed. I would check if
game:GetService("RunService"):IsStudio()
is set to true and manually increase it for testing purposes. I would recommend this method due to the redundance of spending ROBUX on your own game pass to register it to the system.
That is correct. If you leave the game or the process fails before the purchase is complete, the purchase is voided. Check the alt account’s inventory to see if the purchase came through.
I tested it out in one of my games where I know for a fact that several thousand people have purchased gamepasses, and it still gives a result of 0.
It’s possible that it’s a studio exclusive thing, or maybe just bugged. Waiting for it to be finish being pending will have no effect on it.
Alrighty then… Yeah that may be a server side issue then. I’d suggest waiting a day @sopkhim@SeargentAUS and if it still doesn’t work, file a report to the software engineers. Could be a fast flag that’s being switched off for testing momentarily. I will check in the morning to see if there’s anything like that going on.