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

Marketplace Show Gamepass is Not for Sale?

Asked by 4 years ago
Edited 4 years ago

As attempt, The script Works Fine, But Fails to Market the Gamepass Sales Event for the Players.

And The Gamepass is for Sale as well.

Gamepass

Gyazo

while not _G["GameDatabase"] do wait() end
while not _G["GameDatabase"].ready do wait() end
local CheckBought = _G["GameDatabase"].action["CheckBought"]

local player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local pname = player.Name

local pass_val = "PassTwoMore"
local pass_id = 7199111

function UpdatePassInfo()
    if CheckBought(pname, pass_val) then
        script.Parent.BuyBtt.Visible = false
        script.Parent.Bought.Visible = true
    else
        script.Parent.BuyBtt.Visible = true
        script.Parent.Bought.Visible = false
    end
end
UpdatePassInfo()
_G["GameDatabase"].pinfo[pname].changed.Event:connect(UpdatePassInfo)

script.Parent.BuyBtt.MouseButton1Click:connect(function()
    game:GetService("MarketplaceService"):PromptPurchase(player, pass_id)
end)

Is there By chance, The MarketplaceService is not a supportive method now?

0
Use PromptGamePassPurchase PrismaticFruits 842 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local plr = game.Players.LocalPlayer
id = GpIdHere
local ms = game:GetService("Marketplace service")
ms:PromptGamePassPurchase(plr,id)
repeat wait() until ms:UserOwnsGamePassAsync(plr.UserId,id)
--do whatever

Put that in a local script in StarterGui and it should be fine.

0
you spelt id wrong so it wouldn't be fine AnasBahauddin1978 715 — 4y
0
Oops my auto-correct lol. PrismaticFruits 842 — 4y
0
Fixed it. PrismaticFruits 842 — 4y
1
Ah, Just one Simple Mistake, And I was not fully aware that Was a feature, Thanks a much! S0NIC_Dev 61 — 4y
Ad

Answer this question