#Gamepass Prompt Issue
52 messages · Page 1 of 1 (latest)
Roblox is a global platform that brings people together through play.
This is made by Roblox
Not you
Lmao
Change the ID
To yours
Ya
Send me your gamepass link
The numbers after https://www.roblox.com/library/
is the ID you want to put in
What
879792421
That is your ID
I think
** You are now Level 1! **
Roblox is so stupid sometimes...
** You are now Level 2! **
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
** You are now Level 2! **
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