How Should I Deal With Giving This Tool Without Resetting The Player?

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

I’m not sure why you think this is an issue. The tool will appear in their backpack for immediate use




It doesn’t.

You can’t seperate these 2

tool:Clone()
tool.Parent = player.Backpack

But do this

tool:Clone().Parent = player.Backpack
3 Likes

you should do
tool:Clone().Parent = player.Backpack

I still don’t get the item for some reason.

also it should be ProductId not Product

1 Like

and PlayerId not PlayerID

aaaaaaaaaaaaaa

1 Like