Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

MarketplaceService not returning an asset?

Hey everyone, I don't know if this is because it is currently midnight or not but for some reason this is always returning nil even though when I tested it in the command bar it works fine.

And before anyone asks here is the asset: https://www.roblox.com/library/2007144377/Hawk-T2

function script.Parent.GetAsset.OnServerInvoke(id)
	local asset
	local success = pcall(function()
		asset = game:GetService("MarketplaceService"):GetProductInfo(id)
	end)
	if success then
		return asset
	end
	return nil
end

Custom Error: Unable to get asset from ID "2007144377"

Asset id checks out.

Thanks for the help to anyone that replies!

1 answer

You need an equal sign after success.

1 comment

0

Technically they don't. If success then is a fine code. It basically is: if success == true then.

This discussion is preserved as it was. New answers, comments, and votes are closed.