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

Im making a GUI for an Admin gamepass on my game and it doesnt work. Why doesnt it work?

So im making a GUI for my gamepass on my game. And when I test it out, theres an error in my output saying "PromptProductPurchase is not a valid member of Marketplace Service". I don't know what im doing wrong. heres my script, I think the error is on line 12

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")


local productID = 9134966 

local button = script.Parent


button.MouseButton1Down:Connect(function()
	local player = Players.LocalPlayer
	MarketplaceService:PromtProductPurchase(player, productID)
end)

2 comments

0

on line 12 its player.UserId not player

0

That's not true. UserIds are only needed within Async calls.

1 answer

✓ Accepted answer

Problem:

You Forgot the "p" in prompt

Soution:

local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")


local productID = 9134966 

local button = script.Parent


button.MouseButton1Down:Connect(function()
    local player = Players.LocalPlayer
    MarketplaceService:PromptProductPurchase(player, productID) -- here
end)

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