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

Button to prompt gamepass purchase is prompting different item?

This LocalScript inside a text button is supposed to prompt the player to buy the gamepass with the ID: 5412979. When I click it, it either says the item is not currently for sale or prompts me to buy a different item. Here is the script:

local productId = 5412979 -- change to your Gamepass product ID
local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function() --DONT CHANGE THIS
	game:GetService("MarketplaceService"):PromptPurchase(player, productId)
end)

Any help is appreciated!

1 answer

✓ Accepted answer

First off, I wouldn't use free model scripts. Sometimes they are outdated and don't work. I personally would do it myself or follow a 2020 youtube tutorial.

I would also check that you have got the right ID.

C: Hope it helps :D

Edit: Did the script come as a model or was it just a script? If it came with some parts or as a model then its probably a virus. Copy the code, delete the model and create a new script and paste the code in. DO NOT KEEP ANY OF THE OLD SCRIPTS/MODELS.

5 comments

0

Would not recommend watching a video for programming help, anything could be wrong and you won't know until you copy down all the code from the video by hand, which would just be really disappointing. Better to use a forum like this or the official devForum.

0

yeah but at least you can see what the script maker is writing so there won’t be any viruses.

0

Thank you for all your help!

0

np

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