basically i need a script that can detect the price of a dev product from the product id. anyone know how to do this?
2 Likes
You can use the :GetProductInfo()
which is a function of the marketplace service.
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/GetProductInfo
That gives you info about a product or gamepass via the asset id. It then gives you info about the product (the on you need is the "PriceInRobux).
2 Likes
Example code:
--//Services
local MarketplaceService = game:GetService("MarketplaceService")
--//Functions
local function GetProductPrice(productId)
local productInfo = MarketplaceService:GetProductInfo(productId, Enum.InfoType.Product)
return productInfo.PriceInRobux
end
print(GetProductPrice(2222))