Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I implement Game Pass Prompting correctly? [SOLVED]

Hi, I'm having problems with the Game Pass purchase system. Namely, the code seems to work correctly in Roblox Studio and on iOS, but not on PC.

I have arranged the GUI as seen:

Explorer Layout (tbs 1-4 are textbuttons)

On-Screen Layout (two more items down the list)

Now, when I click on the Gravity Coil buy, I get the usual prompt and it works every time I click. As soon as I click another buy button it doesn't work anymore. If I click one of the other buttons instead of the Gravity Coil one it doesn't work at all. I have tried rearranging but the behavior is always the same.

Each local script looks like this:

local item_id = 12345678
script.Parent.MouseButton1Down:Connect(function()
	game:GetService('MarketplaceService'):PromptGamePassPurchase(game.Players.LocalPlayer, item_id)
	print("prompt thingy")
end)
game.GetService.PromptGamePassPurchaseFinished()

I added the last line for good measure but it doesn't seem to resolve anything. I think the problem is the code as I am new and don't understand the specifics well enough. Always open to new ways to reiterate the scripts as long as they work correctly. Help please and thanks in advance!

3 comments

0

on line 6 , I dont see a reason why that line is there. You didnt create an event with it and you also not waiting until the event is fire , so I think you should take that out.

0

Overall , your code looks great ! Are there any errors? is line 4 printing?

0

Yeah, it prints and everything. As I said, I put line 6 for good measure even though I knew it would probably not do anything.

1 answer

Ok, I solved this. Problem was it worked with every Game Pass EXCEPT for one. Must be a bug. I will be deleting that game pass and making a new one to have a different id. Hopefully it works out and has nothing with the GUI or the code. PM me on Roblox if you guys have similar problems.

This discussion is preserved as it was. New answers, comments, and votes are closed.