Cant sell gamepass ingame

for some reason every time i try to sell my gamepass ingame it fails and it works fine on the website can you send some templates that i can try before making this to complicated? hope i can get it working

2 Likes

What do you mean templates? Try sending a picture of your script/gui

1 Like
id = 11153778

player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()

game:GetService("MarketplaceService"):PromptPurchase(player,id)

end)
2 Likes

Do you have a Gamepass Shop GUI?

1 Like

yes i do i hate needing to type 30 characters…

1 Like

Is it enabled?feywghebwfbwefebyfebwfywbfbwf

1 Like

the buttons show up but when i hit buy its says “this item is not for sale” but it works on the website

1 Like

show me the script for the gui.

1 Like

what lgvkjgtfckytfkytfkytfkyfluygfluygluyg

1 Like

give me an example fsdfesdfesf

1 Like

go ahead then jqwertyujkioujyhgtfrdeswetrdyfug

1 Like

You should use MarketplaceService:PromptGamePassPurchase() instead of :PromptPurchase. Your script would look something like the following:

local id = 11153778

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player,id)
end)

For more information on the MarketplaceService, click here.

3 Likes

ummm image

once published it worked… gerfsefs

To stop that error you can visit “Game Settings” in Roblox Studio. The icon looks like the one below.
image

From there, you can go to “Security” along the side.
image

Then, turn on “Allow Third Party Sales” and click “Save”.

However, do this at your own risk, as it will mean that free models and malicious scripts can potentially prompt purchases to other items which are not part of the game.