Trying to make one game pass but the ID isnt the same

Everything works fine the problem is I am trying to paste my gamepass ID on roblox but when you test on Roblox Studio this IDs doesnt match. Like this

SSS script



local mps = game:GetService("MarketplaceService")


local coinsProductIDs = 
	{
		[21814745] = 10,
		[21815193] = 100,
		[21815215] = 1000,
		[21815232] = 10000,
	}

mps.ProcessReceipt = function(purchaseInfo)


	local plrPurchased = game.Players:GetPlayerByUserId(purchaseInfo.PlayerId)

	if not plrPurchased then

		return Enum.ProductPurchaseDecision.NotProcessedYet
	end


	for productID, coinsGiven in pairs(coinsProductIDs) do

		if purchaseInfo.ProductId == productID then


			plrPurchased.toolLeaderstats.Credits.Value = plrPurchased.toolLeaderstats.Credits.Value + coinsGiven

			return Enum.ProductPurchaseDecision.PurchaseGranted
		end
	end
end

Local script (inside the GUIs for buy)

local mps = game:GetService("MarketplaceService")

local plr = game.Players.LocalPlayer


local coinsProductIDs = 
	{
		21814745,
		21815193,
		21815215,
		21815232,
	}


local purchase10CoinsBtn = script.Parent.BuyCredits1
local purchase100CoinsBtn = script.Parent.BuyCredits2
local purchase1000CoinsBtn = script.Parent.BuyCredits3
local purchase10000CoinsBtn = script.Parent.BuyCredits4


local function purchaseCoinsFunction(key)


	local idToPurchase = coinsProductIDs[key]

	mps:PromptProductPurchase(plr, idToPurchase)
end


purchase10CoinsBtn.MouseButton1Click:Connect(function()

	purchaseCoinsFunction(1)
end)

purchase100CoinsBtn.MouseButton1Click:Connect(function()

	purchaseCoinsFunction(2)
end)

purchase1000CoinsBtn.MouseButton1Click:Connect(function()

	purchaseCoinsFunction(3)
end)

purchase10000CoinsBtn.MouseButton1Click:Connect(function()

	purchaseCoinsFunction(4)
end)

I will show you.

Test pass - Roblox < this is one gamepass I have on my game, was you can see the ID is “21814745” but in game is something really random…


I dont know why my game pass doesnt come to the screen and this random gamepass shows up.

Same thing with others buttons.

You’re saying gamepass, but this appears to be for developer products? I’m a touch confused by what you’re trying to display.

If you’re trying to prompt a purchase for a gamepass, use this instead:
https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/PromptGamePassPurchase

3 Likes

Gamepasses and developer products are two different things and as such have different id’s, different methods of activating them and different methods of creating them. Your “credits” are a developer product, because they can be purchased multiple times. I assume the issue might be that you created a gamepass instead? If so, make sure you create a developer product by following the first 3 steps on this page here.

3 Likes

I would think it was a gamepass/library id issue but the corresponding ID is

which means you have a virus in your game. Use something like GameGuard to find it.

Its not a virus, like @C_Sharper and @TigerLeo77 have said, the problem is that the OP created a gamepass, and is using the developer products prompt in his scripts.

gamepass with OP’s id:
https://www.roblox.com/game-pass/21814745

That’s an asset, not a gamepass or a developer product. Either way how exactly would a t-shirt be a virus?

Oh I was using other thing… Thank you a lot but how I can change the image of the dev product?

Edit: Nvm I found it.

bro my gamepass page uses same id