I'm making a shop GUI and when I click the button it pops up with a buy option and when you buy the gear (WITH ROBUX) it gives you the gear.
Someone help??? thanks
This is the sort of thing that you are looking at.. (Client side / LocalScript) - Place in TextButton
local player = game.Players.LocalPlayer local MarketplaceService = Game:GetService("MarketplaceService") local Button = script.Parent local productId = 0 -- Put your gear ID here. Button.MouseButton1Click:connect(function() MarketplaceService:PromptProductPurchase(player, productId) end)
(Server side / Script) - Place in Workspace
local MarketplaceService = Game:GetService("MarketplaceService") local Tool = game:GetService("ServerStorage")['ToolName'] -- Place tool in ServerStorage and change name here. MarketplaceService.ProcessReceipt = function(receiptInfo) for _, v in pairs(game.Players:GetChildren()) do if v.userId == receiptInfo.PlayerId then local T = Tool:Clone() T.Parent = v.Backpack end end return Enum.ProductPurchaseDecision.PurchaseGranted end)
Closed as Not Constructive by BlueTaslem
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?