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

Marketplace Service keeps saying you dont own the gamepass even though you do?

Hi everyone!

I was making a thing that is supposed to give you an item when you buy the gamepass. I use a script that puts another script inside however many image labels (buyable gamepasses) there are in the gui. The image label has values called "Gamepass ID", and "Price", a text label called "ItemName", and a text button called "Buy". Here is the script that is supposed to be inside the text button"

isInAdjusts = script.Parent.Name == "Adjusts"
ms = game:GetService("MarketplaceService")

if isInAdjusts == false then
	image = script.Parent.Parent
	price = image:FindFirstChild("Price")
	gamepassID = image:FindFirstChild("Gamepass ID")
	
	image.Buy.Text = tostring(price.Value) .. " RS"
	script.Parent.MouseButton1Click:Connect(function()
		ms:PromptGamePassPurchase(game.Players.LocalPlayer, gamepassID.Value)
	end)
end

The script works, but the market place service never actually thinks you have it, so you can rebuy it (you can buy it once, and if you click it again, you have the option to buy it again for some reason). Because of this, another script that is supposed to give you the item, doesnt (because the "UserOwnsGamePassAsync" always returns false). Can someone help?

Any help is appreciated.

1 comment

0

another thing i would like to mention is that i do not own the gamepass, probably bc this is a group game. i dont know if this is the reason but i would like to point that out

1 answer

local plr = game.Players.LocalPlayer local button = script.Parent local MarketplaceService = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:Connect(function(click) MarketplaceService:PromptGamePassPurchase(plr, insert gamepass id) end)

this is a working script for me, so when you press a button, it will prompt up the "will u buy gamepass" and if u do own it it will say something like "you own the gamepass, you wont be charged"

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