I made a Server and Local script to award a tool into the player’s backpack upon purchasing my DevProduct.
My problem is that I don’t want the player to die or reset to get the item.
The LocalScript is in a TextButton, and this is it:
local MPS = game:GetService("MarketplaceService")
local id = 3253090966
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
MPS:PromptProductPurchase(player, id)
end)
The ServerScript is in ServerScriptService, and this is also it:
local MPS = game:GetService("MarketplaceService")
local tool = game.ServerStorage.RocketLauncher
MPS.ProcessReceipt = function(receiptInfo)
if receiptInfo.Product == 3253090966 then
local player = game.Players:GetPlayerByUserId(receiptInfo.PlayerID)
tool:Clone()
tool.Parent = player.Backpack
return Enum.ProductPurchaseDecision.PurchaseGranted
end
end