lol = game:GetService("MarketplaceService"):GetProductInfo(6457037)
print(lol.PriceInRobux)
Why does it print nil?
lol = game:GetService("MarketplaceService"):GetProductInfo(6457037)
print(lol.PriceInRobux)
Why does it print nil?
It's not deprecated.
Your error is that the asset you are trying to get PriceInRobux of, is not on sale, it doesn't have a price, that's why it returns Nil.
For others who might have similar issue:
You need to do MarketplaceService:GetProductInfo(PRODUCT_ID, Enum.InfoType.Product)
Basically, you need to specify the type too, unless the type is asset, then it's the default, but if it's product, what normally people want to get info about, you need to specify it.
For more info look here: https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo
If you are too lazy to look:
lol = game:GetService("MarketplaceService"):GetProductInfo(6457037, Enum.InfoType.Product)
print(lol.PriceInRobux)
You can use these types: Enum.InfoType.Asset(The Default), Enum.InfoType.Product, and Enum.InfoType.GamePass
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Nvermind, the thing you wanted to get info about, is asset, so it should work, any errors on your script?
no, it just prints nil
Ok, I found out why, it's because the asset you are trying to get info of, it is not on sale, so you can't get the price, there is no price.