So I am trying to prompt players with a purchase for a product called "Crystals" and this is the code I put in.

local function crystalPurchase(player)
	game:GetService("MarketplaceService"):PromptProductPurchase(player, crystalOfferID.Value)		
	print("Crystal purchase prompted")
end

And when the player clicks the button its connected. I have tried making Marketplace Service a variable and using plr instead and also,

crystalOfferID.Value

is a variable for a Number Value inside my script with the products ID

I have also tried putting in the ID plain or in a variable and it will say

"Unable to cast value to Object"?

2 comments

0

You need to post more code. Where are you calling crystalPurchase

0

IS there supposed to be a Promt purchase code in it? Like the product id?