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

i am trying to make a game pass shop but when i test it it does not show the right product?

local productId = 5118935	 -- Change to the ID of your developer product.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
	game:GetService("MarketplaceService"):PromptProductPurchase(player,productId)
end)

5118935 is the id when i test it shows a chicken model please help

4 comments

0

Probably typed wrong id

0

i tested it over and over with the right id

0

Are you sure? (Cuz I’ve never heard of a bug relating to wrong ids showing) Also, :connect is deprecated. Use :Connect instead.

0

I can tell you didn't make that.

1 answer

Can u accept my answer if this works?

local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")
local plr = Players.LocalPlayer

local productId = 5118935

script.Parent.MouseButton1Click:Connect(function()
    MarketplaceService:PromptProductPurchase(plr.UserId ,productId)
end)

2 comments

0

i do not think it has to do with coding because it did not work and adding userid broke it and your plr before userid the p is in caps so i had to fix it there but thanks for trying :)

0

This seems right, although if it doesn’t work, get rid of Players and plr when defining at the top, and add plr in the function.

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