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

Can somebody help me with my gamepass not working?

Asked by 5 years ago
Edited 5 years ago

I made a donation game. for my group and sadly it does not work I have set it up correctly and everything but when I click something to buy it prompts a purchase but it is a totally different thing to what I set it too.

Here is the script.

-- Enomphia
local a = 4753874
local b = 4753876
local c = 4753878
local d = 4753880
local e = 4753882

local LocalPlayer = game.Players.LocalPlayer

script.Parent['1'].MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(LocalPlayer, a)
end)

script.Parent['2'].MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(LocalPlayer, b)
end)

script.Parent['3'].MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(LocalPlayer, c)
end)

script.Parent['4'].MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(LocalPlayer, d)
end)

script.Parent['5'].MouseButton1Click:Connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(LocalPlayer, e)
end)

Check it out here: https://www.roblox.com/games/2037472475/DonationCenter

Thanks, Enomphia

3 answers

Log in to vote
1
Answered by
SCP774 191
5 years ago

You shouldn't use PromptPurchase, it'll sometime be confused by ROBLOX and not work. For gamepasses, you should use PromptGamepassPurchase. https://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PromptGamePassPurchase For developer products, you should use PromptProductPurchase. https://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PromptProductPurchase

0
Ok Thanks! :D Enomphia 39 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Boy, you're maybe using wrong ID's...

Log in to vote
0
Answered by
Qawstar 32
5 years ago
Edited 5 years ago

ROBLOX doesn't support/use the PromptPurchase, you should use instead PromptGamepassPurchase.

You can learn more by visiting the ROBLOX Wiki.

Answer this question