Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Button to prompt gamepass purchase is prompting different item?

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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.

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. SteamG00B 1633 — 4y
0
yeah but at least you can see what the script maker is writing so there won’t be any viruses. KingIce1310 23 — 4y
0
Thank you for all your help! OrbitOps 34 — 4y
0
np KingIce1310 23 — 4y
Ad

Answer this question