The pictures explain most of it... First Picture (Lightshot), Second Picture (Also Lightshot), Third Picture (Yet Again, Lightshot)
So I really need help figuring out why I receive a random number of M1911's when I purchase the Developer Product.
+Rep to anyone who helps me, with logical/working answers.
If you don't feel like looking at the pictures (even though they explain everything better...),
Here is the LocalScript inside StarterPack:
local buyButton = game.Workspace.BuyButton.SurfaceGui.TextButton
local damageButton = game.Workspace.DamageButton.SurfaceGui.TextButton
local productId = 19635648
buyButton.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(game.Players.LocalPlayer, productId)
end)
damageButton.MouseButton1Click:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health - 40
end)
Here is the Script inside Workspace.BuyButton:
local MarketplaceService = Game:GetService("MarketplaceService")
local ds = game:GetService("DataStoreService"):GetDataStore("PurchaseHistory")
local productId = 19635648
MarketplaceService.ProcessReceipt = function(receiptInfo)
for i, player in ipairs(game.Players:GetChildren()) do
if player.userId == receiptInfo.PlayerId then
if receiptInfo.ProductId == productId then
game.Lighting:FindFirstChild("M1911"):Clone().Parent = player.Backpack
game.Workspace.DisplayScreen.SurfaceGui.TextBox.Text = player.Name .. " has purchased an illegal M1911."
wait(2)
weapons = game.Lighting:FindFirstChild("M1911")
local c = game.Players:FindFirstChild(player.Name).Backpack:GetChildren()
for i = 1,#c do
if c[i].Name ~= "M1911" then
for i = 1, #weapons do
if weapons[i].className == "Tool" then
weapons[i]:clone().Parent = player.Backpack
end
end
end
end
end
end
end
local playerProductKey = "player_" .. receiptInfo.PlayerId .. "_purchase_" .. receiptInfo.PurchaseId
ds:IncrementAsync(playerProductKey, 1)
return Enum.ProductPurchaseDecision.PurchaseGranted
end

7 comments
Please post your code in your question, not through a picture.
I did it so everyone understood what code went where. Please remove the negative rep... I was trying to make it easier for everyone reading it, so nobody got confused.
Could you also try and help me here?
Are there any errors...? Or is the M1911 model just bugged?
It has a few issues. I'm not entirely sure of your aim.
If you look at the prntscr images, you will see exactly, as it explain everything.
Bumping it.