local shop = {creditshop:WaitForChild("10Credits"),creditshop:WaitForChild("50Credits")}


for _, v in pairs (shop[1]) do
    v.MouseButton1Click:connect(function()
		local passId = 21545568
		game:GetService("MarketplaceService"):PromptProductPurchase(player,passId)
		game:GetService("MarketplaceService").ProcessReceipt = function(receiptInfo)
			if Enum.ProductPurchaseDecision.PurchaseGranted and receiptInfo.PlayerId == player.userId then
				player.Credits.Value = player.Credits.Value + 10
				wait(1)
			end
		end
    end)
end

5 comments

2

Please give us a summary of your problem in the body.

0

well it just isnt working. I cant test in studio cause it uses dev products, so I don't know whats wrong. I want it so if the 10credits button is clicked then do stuff

0

Well, you really don't need to use a table for this. Get rid of the for loop, and just make it so when they click a 10 Credits button and they but it it awards them 10 Credits, same with 50. Tables make it less efficient, actually.

0

4 down votes, wow sorry retards for asking a question, a legitement question. Morons.

0

Well, you posted code with no explanation of the problem what so ever. Don't expect up votes for a poorly written question.