I want a block to spawn whenever someone buys a dev product. However, the block is not spawning when I buy the dev product. I have tried to add prints into the function, but they are not running either. Here is my code in a ProximityPrompt in a part in the workspace.
local MPS = game:GetService("MarketplaceService")
local productID = 2679561268
local ProxPrompt = script.Parent
ProxPrompt.Triggered:Connect(function(plr)
MPS:PromptProductPurchase(plr, productID)
MPS.PromptPurchaseFinished:Connect(function(plr, productID, isPurchased)
if isPurchased == true then
print(plr.."has purchased a block!")
local newBlock = Instance.new("Part")
newBlock.Parent = workspace
newBlock.CFrame = Vector3.new(80, 80, 0)
newBlock.Color = Color3.new(math.random(0, 255), math.random(0, 255), math.random(0, 255))
else
print(plr.."canceled the purchase.")
end
end)
end)