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

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

Asked by 4 years ago

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.

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 JustAnotherGaming 48 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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"

Ad

Answer this question