I’m trying to make a script so when someone presses a GUI button and buys the prompted dev product it will make some parts appear for a few seconds.
the script that promotes the dev product works but the script that is suppose to detect it won’t work and I don’t know why.
here is the button script it is in StarterPlayerScripts
local productId = 1197770885 – Change to the ID of your developer product.
local player = game.Players.LocalPlayer
game.workspace.Stages.Stage8Peral.AppearDevProduct.SurfaceGui.TextButton.MouseButton1Click:Connect(function()
game:GetService(“MarketplaceService”):PromptProductPurchase(player, productId)
end)
Here is the Promot script it is in ServerScriptService
local MPS = game:GetService(“MarketplaceService”)
MPS.ProcessReceipt = function(receiptInfo)
if receiptInfo.ProductId == 1197770885 then – replace with your ID here
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerId)-- transparency becomes 0 -- transparency becomes 1end
end