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

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

Asked by 4 years ago

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)
0
on line 12 its `player.UserId` not `player` Leamir 3138 — 4y
0
That's not true. UserIds are only needed within Async calls. Ziffixture 6913 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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)
Ad

Answer this question