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

GUI Gamepass Buy Button: Showing T-Shirt, not gamepass?

I have made a gamepass shop in which if a person clicks a button, they buy a gamepass. For some reason, it shows a T-Shirt instead of the gamepass when I click the buy button to test it. I am not sure why it does this.

CODE PUT INSIDE THE BUTTON:

local productId = 4897669
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function() 
	Game:GetService("MarketplaceService"):PromptPurchase(player, productId)
end)

Please help!

1 answer

✓ Accepted answer

###This is because you are using the wrong method. PromptPurchase is for things like clothing. Use PromptGamePassPurchase instead.

local productId = 4897669
local player = game:GetService("Players").LocalPlayer

script.Parent.MouseButton1Click:Connect(function() -- :connect is deprecated, use :Connect
    Game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end)


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