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

Gamepass says "item is not for sale" but it is and shows random picture?

My gamepass doesn't work tis says its not fore sale but it is

Script

--gravity coil
game.Players.PlayerAdded:Connect(function(p)
	if game:GetService("MarketplaceService"):PlayerOwnsAsset(p,5700504) then
		local coil = game:GetService("ServerStorage"):WaitForChild("GravityCoil"):Clone()
		coil.Parent = p.StarterPack
		local coil2 = coil:Clone()
		coil2.Parent = p.Backpack
	end
end)

local script

local player = game.Players.LocalPlayer
local id = 5700504

script.Parent.MouseButton1Click:Connect(function()
	game:GetService("MarketplaceService"):PromptPurchase(player,id)
end)

Plz help!?

1 answer

✓ Accepted answer

Difference between Dev products and Game Passes


The problem here is that Dev products and Game passes have completely different functions and events in MarketPlaceService PlayerOwnsGamePassAsync , PromptGamePassPurchase, and PromptGamePassPurchaseFinished for gamepasses and PromptPurchaseFinished, PromptPurchase, and PlayerOwnsAsset for dev products

Another thing to note is that the PlayerOwnsGamePassAsync function uses a player's user id instead of a player object

local mps = game:GetService("MarketPlaceService")

print(mps:PlayerOwnsGamePassAsync(UserId,GamePassId))--prints a boolean value

3 comments

0

How do I use promptgamepasspurchasefinished?

0

its an event

0

so MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(...)

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