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.
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"