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

How Do I Make Multiple Developer Products?

Asked by 4 years ago

Halp? Okay so, I know how to make a single one, and have it works like right now, I have an annihilate all players button on make game, its a developer's product and works, However, It works in 2 scripts. and if I have 2 in the same game, They interact with eachother and its really annoying. i'll give you script 1 and then the script inside of that script

--script1

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local productID = 1075804768 
script.Parent.MouseButton1Click:Connect(function(promptPurchase)
    local player = Players.LocalPlayer
    MarketplaceService:PromptProductPurchase(player, productID)
end)

And then the script inside of script1

--script2

local MarketplaceService = game:GetService("MarketplaceService")
function processReceipt(receiptInfo)
    local player = game:GetService("Players"):GetPlayerByUserId(receiptInfo.PlayerId)
    if not player then
        return Enum.ProductPurchaseDecision.NotProcessedYet
    end
    -- script below controls what happens if bought
        print(player.Name .. " just bought " .. receiptInfo.ProductId)
         workspace.Meteorite.Transparency = 0
    wait(10)   
    for i,v in pairs(game.Players:GetPlayers()) do
        v.Character.Humanoid.Health = 0
    end

    workspace.Meteorite.Transparency = 1
    return Enum.ProductPurchaseDecision.PurchaseGranted
end
MarketplaceService.ProcessReceipt = processReceipt

can someone help? I'm in no DIRE NEED it would just help improve

Answer this question