Hi all, I've been having some trouble with regards to the above problem. In-game, there will be a sign with the gamepass. I'm having trouble with scripting something that will prompt the purchase of it. I appreciate any help!
✓ ANSWER ACCEPTED
Prompt Gamepass Purchase on Click?
1 answer
✓ Accepted answer
Do something like this:
local part = script.Parent
local detector = part.ClickDetector
local function promptPurchase(player)
local service = game:GetService("MarketplaceService")
service:PromptGamePassPurchase(player, "Gamepass ID goes here in number format")
end
detector.MouseClick:Connect(promtPurchase)
This is a basic script which prompts the purchase of a gamepass when a part is clicked. I'm pretty sure you can modify this script to suit your needs.
1 comment
0
Thank you!
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Can you post the script you tried?
Yes. The problem was with the ID - it's not a gamepass id.
https://pastebin.com/Q9WCuxWu