Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why Is My Developer Product Not Working? [Solved]

Hello, I'm trying to make an in-game developer product purchase when you press a button but it doesn't work and I don't know why because it doesn't output any errors.

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer

local ProductID = 642376877

script.Parent.MouseButton1Click:Connect(function()	
	MarketplaceService:PromptProductPurchase(Player, ProductID)
end)

Help Would Be Really Appreciated

4 comments

0

I tested this code and it is working .. are you using ServerScript or LocalScript?

0

LocalScript

0

It should work

0

I just solved it.

2 answers

this script should work fine? i tested it with a local script and it works fine proof

2 comments

0

Somehow it doesn't work for me

0

I just solved it, The problem was the button because it has a shadow and the shadow is blocking the button so I just put the script inside the shadow and it worked. Thanks for trying to help me.

local Player = game.Players.LocalPlayer 
local ProductID = 642376877 
script.Parent.MouseButton1Down:Connect(function(Prompt) 
game:GetService("MarketplaceService"):PromptProductPurchase(Player, ProductID)
end)

Also, ensure that it is a LocalScript and is inside the purchase button.

2 comments

0

I just solved it, The problem was the button because it has a shadow and the shadow is blocking the button so I just put the script inside the shadow and it worked. Thanks for trying to help me.

0

No problem. Sorry I'm a bit late to reply!

This discussion is preserved as it was. New answers, comments, and votes are closed.