"unable to cast value to object"

I am trying to make a promptproductpurchase block, and it gives me an error on this line:

game:GetService("MarketplaceService"):PromptProductPurchase(player.UserId, ITEM_ID_HERE)

Player is defined as game.Players:GetPlayerFromCharacter(obj.Parent)
Object is the object that touched the block. (to prompt purchase)

You need to give the player as the first arg, not the userid.

1 Like