Gamepass Displaying as a Product

In my game, when the player clicks on an ImageButton, the game asks the player to purchase a gamepass. However, it says that it’s a product when it really is a gamepass, and I do not know why this happens.

The script is a bit long. Click here to see it.

This is the script inside of the ImageButton:

local market = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local userid = player.UserId
local passid = 7976960
local jumpScript = game.Workspace.DoupleJumpPass
local nice = game.Workspace.Nice
local debounce = false
local TweenService = game:GetService("TweenService")
local part = script.Parent.Parent.OwnText
local thanks = script.Parent.Parent.ThanksText
local tweenInfo = TweenInfo.new(
	.8, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	0, -- RepeatCount (when less than zero the tween will loop indefinitely)
    true, -- Reverses (tween will reverse once reaching it's goal)
    4 -- DelayTime
)

local tween = TweenService:Create(part, tweenInfo, {TextTransparency = 1})
local tween2 = TweenService:Create(part, tweenInfo, {TextStrokeTransparency = 1})
local tween3 = TweenService:Create(part, tweenInfo, {TextTransparency = 1})

script.Parent.MouseButton1Click:Connect(function()
	local ownpass = market:UserOwnsGamePassAsync(userid, passid)
    if ownpass == true then
    	if not debounce then
	    	debounce = true
	    	print("Player owns pass.")
	    	part.Visible = true
		    tween:Play()
		    tween2:Play()
	    	wait(5)
	    	part.Visible = false
	    	wait(.1)
	    	part.TextTransparency = 0
	    	part.TextStrokeTransparency = .5
	    	debounce = false
    	end
    else
		market:PromptGamePassPurchase(player, passid)
			market.PromptGamePassPurchaseFinished:Connect(function(player, purchasePassID, purchaseSuccess)
	    	    	if purchaseSuccess == true and purchasePassID == passid then
		    		local playerScript = jumpScript.DoubleJump:Clone()
			    	playerScript.Parent = player.Backpack
			    	nice:Play()
			    	print("Thank you for purchasing!")
				    thanks.Visible = true
			    	tween3:Play()
		    		wait(5)
			    	thanks.Visible = false
		    	end
	    	end)
    	print("Wanna buy some stuff?")
	end
end)
  1. What do you want to achieve? I want the player to be able to purchase a gamepass (not product) when they click an image.

  2. What is the issue? It shows “product” instead of “gamepass” for some reason.

  3. What solutions have you tried so far? I tried looking for similar topics, but I had found no results giving me my answer.

product
Notice how it says product? I swear it’s a gamepass.

Nothing appears to be wrong with the script, and the only thing that isn’t working as intended is this gamepass and product swap. Any help is greatly appreciated.

1 Like

Hey so, first off

Indeed, this is not needed, just do

if market:UserOwnsGamePassAsync(userid, passid) then

About

Try removing that check, I think it’s not really needed, and are you sure your gamepass it’s a gamepass and not a product?

I am sure that it is a gamepass. It’s type shows as “Game Pass” when I viewed it in my own inventory.

Let me show you a script I made, similar to this, also if you are sure then, just make a new gamepass.

workspace.PoliceShops.SwatGEAR.Event.OnServerEvent:Connect(function(plr)
	if market:UserOwnsGamePassAsync(plr.UserId, 7978798)  then
--do stuff
		
	elseif not  market:UserOwnsGamePassAsync(plr.UserId, 7978798) then
		
		wait(0.4)
		market:PromptGamePassPurchase(plr, 7978798)
		
	end
end)

Would that script make a difference as to whether it shows “product” or gamepass"?

The gamepass I used in my script is a new gamepass.

Yes it would make a difference, it says gamepass or product.

I tried it out, and it did not work.

Well, I really don’t have an idea, it works for me

When that pop up shows up, game passes are always considered products, nothing is wrong with it you are fine.

Picture for proof (Jailbreak Game-pass): Roblox 1_13_2020 9_07_47 PM

It still prompts the player to buy it again if they click the image again.

Are you saying it does not give the user the game-pass?

If you’re testing in Studio, it will allow you to purchase it over and over without taking Robux from your account.

1 Like

Go back to your old code, I didn’t knew it showed as product lol.

It does give the player the gamepass, but it still asks them if they want to buy it or not despite them having it.

Do you mean it pops up repeatedly without clicking the button or always pop up when you click the button? if when clicking the button that is because of studio allowing you to purchase it for free infinitely like @Spooce had said.

I had one of my friends help me test it, and it still asks you to buy it again regardless.

It pops up again when you click the button again. It still asks the player to buy it again when not in studio.

Does it steal your robux at all? It might be a bug if it is stealing robux, and not giving you the game pass.

BTW I recommend making another topic on this, since I solved your problem before and this is not the question asked in the topic we are discussing right now.

I do not know f it does take robux or not, but I’m assuming it does. It does give you the gamepass however.

If it is asking you to buy it again when you already have the game pass, then this is a roblox bug and should be reported, otherwise if it just pops up saying “game pass already owned” then you should be fine.