Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I sell a dev product through GUI and give the player a gear for one life?

Hey all. There's not much to say accept that this is in a TextButton. Here is the current script and it does not work.

local plr = script.Parent.Parent.Parent

local function buyItem(button)
	button.MouseButton1Click:connect(function()
		local marketId = button["market"].Value
		link:PromptProductPurchase(plr,20282186) 
		link.ProcessReceipt = function(receiptInfo)
			if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
				game.Lighting.GravityCoil:Clone().Parent = plr.Backpack
			end
		end
	end)
end

Thanks for the help everyone.

Also, the TextButton is in a ScreenGui named "Shop" > Frame > TextButton > Script.

1 answer

plr.Character.Humanoid.Died:connect(function(die)
	plr.Backpack.GravityCoil:Destroy()
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.