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

Why is the title just this? [2]

Asked by
c0des 207 Moderation Voter
11 years ago

Because Yolo. That's why. Why else? I mean really, why else?

1 answer

Log in to vote
2
Answered by
Dummiez 360 Moderation Voter
11 years ago

Added an if not statement to check if that tool is already in the Backpack. That way it will prevent the player from having multiple copies of Obitor.. or whatever that is lol.

01local MarketplaceService = Game:GetService("MarketplaceService")
02local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
03local productId = 19645570
04 
05MarketplaceService.ProcessReceipt = function(receiptInfo)
06 
07    for i, player in ipairs(game.Players:GetChildren()) do
08 
09        if player.userId == receiptInfo.PlayerId then
10 
11            if receiptInfo.ProductId == productId then
12                if not player.Backpack:findFirstChild("Obitor") then
13                game.Lighting:FindFirstChild("Obitor"):Clone().Parent = player.Backpack
14                game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased an illegal Obitor."
15                end
View all 23 lines...
0
Thank you very much. c0des 207 — 11y
Ad

Answer this question