Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Developer Products?? [[IMPORTANT]] [closed]

Asked by 10 years ago

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

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?

1 answer

Log in to vote
1
Answered by 10 years ago

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)
0
@Ravenkiller Where it says productID do I put the gear or Developer Product?? Realixty 0 — 10y
1
That is the ID of the DeveloperProduct, in the Server side script you need to clone the tool into the Player's backpack. RaverKiller 668 — 10y
0
How do I do that? Realixty 0 — 10y
1
Place a copy of the tool in ServerStorage and do something like this: local Tool = game:GetService("ServerStorage")['ToolName']:Clone() Tool.Parent = Player.Backpack -- Change ToolName with the tool's name (v is the Player in the second script) RaverKiller 668 — 10y
View all comments (6 more)
0
Still doesn't work! :C Realixty 0 — 10y
0
Do you get any errors in the output ? RaverKiller 668 — 10y
0
Nope. Can you write the whole script for me in like a PM and I'll edit it? Realixty 0 — 10y
0
I will edit my answer on here.. RaverKiller 668 — 10y
0
ok thanks Realixty 0 — 10y
0
And....it still doesnt work. Realixty 0 — 10y
Ad