Prompt Purchase won't work

I’m trying to make a script for when you click a part it prompts you to purchase a dev product.
There are no errors, it just won’t prompt you to buy it (no GUI pops up or anything) I’ve definitely published it and the script is local

the script


local MPS = game:GetService("MarketplaceService")


local Click = script.Parent.ClickDetector

local ItemId = 1122288911


game.Workspace.AllowThirdPartySales = true
Click.MouseClick:Connect(function(plr)
	local H = plr.Character:FindFirstChild('Humanoid')	
	if 	H and H.Health > 0 then
		
		MPS:PromptProductPurchase(plr, ItemId)
	end
end)

layout
image

the dev product

PromptGamePassPurchase MarketplaceService | Documentation - Roblox Creator Hub

Prompting a Developer Product Purchase Developer Products | Documentation - Roblox Creator Hub

I’ve looked at that but it’s really unclear what I need to do for my specific script. I’m just looking for a script that prompts a dev product once you click the clickdetector

1 Like

Check you have enabled API Services in your game settings

1 Like

If you mean this
image
It’s not working.
Perhaps its a problem with the dev product itself?

1 Like

You shouldn’t need access to the API anyways for a developer product unless once it’s bought your saving data to a datastore.

Figured it out! It should’ve been in a normal script (I think because it already detects who clicks it) But thanks everyone for trying to help :smiley: :+1: