There is no errors when entering or someone buying but i put this at the top of the MAIN PART of Kohls Admin Script:

MarketplaceService = Game:GetService("MarketplaceService")
MarketplaceService.ProcessReceipt = function(receiptInfo)
players = game.Players:GetPlayers()

for i=1,#players do
	if players[i].userId == receiptInfo.PlayerId then
		if receiptInfo.ProductId == GamePassId then
			table.insert(admins,players[i].Name)
		end
		if receiptInfo.ProductId == GamePassId1 then
			table.insert(owners,players[i].Name)
		end
	end
end
	return Enum.ProductPurchaseDecision.PurchaseGranted	
end

What it is supposed to do, right away when somone buys a gamepass it will automatically give them admin.

What is wrong with it?

4 comments

0

Please edit your post and use the Lua code formatting button.

0

There

0

Check to make sure that you're no using ProcessReceipt anywhere else or it might overwrite this one.

0

No there isn't