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

Why isn't this developer Product shop doesn't work?

Asked by 10 years ago

I got everything sorted out except from giving the Player the gear when he purchase the Dev Product. So Basically the script is suppose to give player the gear if they buy the Developer Product. But it doesn't seems to be giving the Player the gear when they buy it can anyone tell me what wrong with this?

local plr = script.Parent.Parent.Parent.Parent.Parent

local link = game:GetService("MarketplaceService")
deb = 0


script.Parent.MouseButton1Click:connect(function()
local marketId = 21055716 --Here Developer Product ID
link:PromptProductPurchase(plr,marketId)
link.ProcessReceipt = function(receiptInfo)
if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == plr.userId then
if deb == 0 then
deb = 1
local c = game.Lighting.DualVenomshank:Clone()--Here where I'm clonning which is in workspace
    c.Parent = game.Lighting--This put the clone into the Lighting

local give = game.Lighting:FindFirstChild("DualVenomshank")--Here where the script search for "DaulVenomshank"
    give.Parent = game.StarterPack--Here it where it post to give the Player Who bought the "Dev Product" the gear 
wait(1)
deb = 0
end
end
end
end)
0
..........Why do you make a clone, put that in lighting, search for that clone, and then parent it to StarterPack(which will give it to EVERY PLAYER IN THE ENTIRE GAME WHEN THEY SPAWN) iaz3 190 — 10y
0
I told the script to make the Clone so it can be purchase multiple times in the same server and if I make the weapon go in the Backpack the gear will go after the player dies faruque7722 5 — 10y

1 answer

Log in to vote
0
Answered by
iaz3 190
10 years ago

Please look at http://wiki.roblox.com/index.php?title=Developer_product and http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/ProcessReceipt and reply if you can not figure it out from there.

As for giving it to the player, assuming plr is the Player and c is a clone of the item then you would do this

c.Parent = plr.Backpack
Ad

Answer this question