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!
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.