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
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( (
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
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
````
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