PromptProductPurchase returns "Unable to cast value to Object"

Hi guys, I have a quick problem which probably only needs a quick fix, but I can’t seem to find what it is. I’ve scrolled through the forum and roblox website articles looking for answers but found nothing helpful… The output gives me an error that states: “Unable to cast value to Object”. This is on Line 4

script.Parent.TextButton.MouseButton1Click:Connect(function()
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, 9456086) then
		OpenShop()
	else
		game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer.UserId, 9456086)
	end
end)

MarketplaceService:PromptProductPurchase takes a player, not a user ID.

1 Like

Easy question, easy answer! Thank you very much. does that mean I also can remove it from the UserOwnsGamePassAsync? (I dont think so but still asking)

No. This one still requires an ID.

1 Like

No.

1 Like