#Gamepass Prompt Issue

52 messages · Page 1 of 1 (latest)

autumn flint
#

Bro check if the Gamepass is yours

#

This is made by Roblox

#

Not you

#

Lmao

#

Change the ID

#

To yours

#

Ya

#

Send me your gamepass link

#

is the ID you want to put in

#

What

#

879792421

#

That is your ID

#

I think

tawny elkBOT
#

studio** You are now Level 1! **studio

autumn flint
#

Idk

#

Roblox is silly

#

Ok

smoky crest
smoky crest
#

Roblox is so stupid sometimes...

pure dome
#

turn this on

#

@fallen wing

tawny elkBOT
#

studio** You are now Level 2! **studio

pure dome
#

I have 0 idea, but I always turn that on or the problems might occur like in your case.

#

and I tested ur code

#

which works perfectly fine for me

#

I teste4d it out without the mouseclick and thats when it worked

#

but it didnt work whenever I clicked on it

#

also why are u trying to do it from local script?

#
local MarketplaceService = game.MarketplaceService
local GamepassID = 879792421
local GamepassPartClickDetector = script.Parent.ClickDetector


GamepassPartClickDetector.MouseClick:Connect(function(Player)
    local HasGamepass = false
    local Success, Result = pcall(function()
        HasGamepass = MarketplaceService:UserOwnsGamePassAsync(Player.UserId, GamepassID)
    end)


    if HasGamepass == true then
        print("The player already has the gamepass. The gamepass prompt has not been prompted on their screen.")
    elseif HasGamepass == false then

        local Success, Result = pcall(function()
            MarketplaceService:PromptGamePassPurchase(Player, GamepassID)
        end)

        print("The player does not have the gamepass. The gamepass prompt has been prompted on their screen.")
    end
end)

put a script inside the part and paste this code in it

#

it works

#

nope

#

GamePassPrompt is individual that is why it asks your for a plr userid

#

yeahh... lol

tawny elkBOT
#

studio** You are now Level 2! **studio

pure dome
#

so put a script inside the part and paste that script in

#

gimme sec

#

that is not the case

#
local MarketplaceService = game.MarketplaceService
local GamepassID = 879792421
local GamepassPartClickDetector = script.Parent.ClickDetector


GamepassPartClickDetector.MouseClick:Connect(function(Player)
    local HasGamepass = false
    local Success, Result = pcall(function()
        HasGamepass = MarketplaceService:UserOwnsGamePassAsync(Player.UserId, GamepassID)
    end)


    if HasGamepass == true then
        print("The player already has the gamepass. The gamepass prompt has not been prompted on their screen.")
    elseif HasGamepass == false then

        local Success, Result = pcall(function()
            MarketplaceService:PromptGamePassPurchase(Player, GamepassID)
        end)

        print("The player does not have the gamepass. The gamepass prompt has been prompted on their screen.")
        
        
        MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, id, isPurchased)
            if isPurchased and id == GamepassID and plr  == Player then
                local Sword = game.ReplicatedStorage.ClassicSword:Clone()
                Sword.Parent = Player.Backpack
            end
        end)
    end
end)
#

this gives u a sword too

#

once purchased

#

yes

#

nope, 2 scripts only necessary if you going to have a lot of gamepasses with different results

#

but u can manage that with 1 script also

#

generally try to have less scripts, but not so much that you get lost in them

#

and things break over things

#

lol

#

having 2 scripts are not wrong, but doesn't look good