I want to prompt up a developer product purchase when a player clicks a block.
I already got the part of the purchase itself but I am not sure how to script the part with ClickDetector.
local sword = game.ServerStorage.Sword
local mpService = game:getService("MarketplaceService")
mpService.ProcessReceipt = function(purchaseInfo)
local plr = game:getService("Players"):GetPlayerByUserId(purchaseInfo.PlayerId)
if purchaseInfo.ProductId == 49078483 then
local Sword = sword:Clone()
Sword.Parent = plr.Backpack
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
How should I script that?