"GetProductInfo()" Returning false

  1. What do you want to achieve? Keep it simple and clear!

I want the server to check if the asset id the user gave is for sale

  1. What is the issue? Include screenshots / videos if possible!

My issue is that. It keeps returning “false” all the time when i give it an id for a free model or decal(Its for sale btw). But when i give it an id for a catalog accessory it returns true… If anyone could tell me why its doing this that would be nice(:grinning: (:grinning:

Heres my code:

local APPROVE = game.ReplicatedStorage:FindFirstChild("FUNCS").APPROVE


-- // FUNCTIONS
function isAvaible(Id)
	local TABLE = nil
	local Sucess, Err = pcall(function()
		TABLE = game.MarketplaceService:GetProductInfo(Id)
	end)
	
	
	if Sucess == true then
		if TABLE["IsForSale"] == true then
			-- // DO STUFF
		end
	else
		warn("SOMETHING WENT WRONG LOADING THE ASSET: " ..Err)
	end
end

APPROVE.OnServerInvoke = function(Player, Id)
	local CONTINUE = isAvaible(Id)
	
	
	return CONTINUE
end

If this should return false, it means there is an error. obviously
What does Err print?

1 Like

Err returns the error message if the pcall failed. But my problem is that the function works. But it just keeps returning false when trying to check if its for sale:

if Sucess == true then
		if TABLE["IsForSale"] == true then
			print("Model is for sale")
		end
	else
		-- // Pcall failed. Quit ;P 
		warn("SOMETHING WENT WRONG LOADING THE ASSET: " ..Err)
	end
````

The error that pcall says will say what is wrong, surely there is a misspelled or invalid id.
Also that it is not in number format.

1 Like

What do you mean. Nothing is misspelled. It works perfectly. Its just the sale check that is being a bit weird?.. Even if the asset is for sale(Forgot to mention in the topic. I’m using this model to test: Building kit - Roblox) it returns false

I think you may have to check for Both IsForSale and IsPublicDomain so if one of them is true, continue

if TABLE["IsForSale"] == true or TABLE["IsPublicDomain"] == true then
	-- // DO STUFF
end

Because IsPublicDomain checks if the model can be taken for free, whislt I think IsForSale determines if you can buy it for a specific amount of robux

1 Like