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

Marketplace Show Gamepass is Not for Sale?

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?

1 comment

0

Use PromptGamePassPurchase

1 answer

✓ Accepted answer
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.

4 comments

0

you spelt id wrong so it wouldn't be fine

0

Oops my auto-correct lol.

0

Fixed it.

1

Ah, Just one Simple Mistake, And I was not fully aware that Was a feature, Thanks a much!

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