I made a script so I don't have to update the game everyday to put up a new gift for the game to sell to players. I tested it myself (Deleted the gift and joined the game) but it did not prompt me to buy the free gift. Can someone help? [The gift is onsale]
game.Players.PlayerAdded:connect(function(plr)
if not game.MarketplaceService:PlayerOwnsAsset(plr,582409069) then
local passStats = game.MarketplaceService:GetProductInfo(582409069)
if passStats.IsForSale then
game.MarketplaceService:PromptPurchase(plr,582409069)
end
end
end)
EDIT : The gift is a decal asset. So someone from the ROBLOX Discord suggested that I should use print to find out where the code doesn't work. I found out that it was on the passStats.IsForSale. It returned to false, even though the asset was onsale. Please help.

2 comments
Still doesn't work. It said an error "MarketplaceService.GetProductInfo() failed because rawProductInfo was empty"
The wiki said Enum.InfoType.Product is only used on Developer Products. This isn't a developer product but a decal (which is an asset)