Why isn't this script prompting the player to purchase the developer pruduct?
I am trying to make it so that when the part is clicked (via a ClickDetector), it will prompt the player who clicked to purchase a developer product, but it does not work, why?
There are no errors, and the id of the developer product is correct.
My script is not disabled
I use a server-sided script inside a Union with a clickdetector inside the Union as well.
My coding is as follows:
local MarketplaceService = game:GetService("MarketplaceService")
local productId = 47847411
script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)
local player = playerWhoClicked.Name
MarketplaceService:PromptProductPurchase(player, productId)
end)
Any help is greatly appreciated!

2 comments
This will give you an error as you are giving a string where an object is required.
But it didnt :P