Seriously need some help on this one, I need a savior. I’ve looked up on forums and YouTube and I can’t find an answer. I’m sure it’s a stupid little mistake that I can’t find, but I literally can’t find anything.
I have 5 gamepasses, there are two of them that give you gear when you purchase them (Bouncer & Boombox). The prompt shows up when you click on the buttons, but after you press purchase, nothing is returning anything at all. No errors, no gear, no output once so ever.
gamepassHandler script located in ServerScriptStorage
--SERVICE LOCALS--
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
--OTHER LOCALS--
local MainFrame = script.Parent.Frame
local player = game.Players.LocalPlayer
--BUTTON LOCALS--
local GP_bncr = MainFrame.ScrollingFrame.bouncer.br_button
local GP_bb = MainFrame.ScrollingFrame.boombox.bb_button
--ID LOCALS--
local ID_bncr = 17791929 --BOUNCER gamepass ID
local ID_bb = 14537695 --BOOMBOX gamepass ID
--GEAR--
local Boombox = game.ServerStorage.Gear.BoomBox:Clone()
local Punch = game.ServerStorage.Gear.Punch:Clone()
local GrabPlayer = game.ServerStorage.Gear.GrabPlayer:Clone()
--BOUNCER GAMEPASS--
game.Players.PlayerAdded:Connect(function(player)
local success, message = pcall (function()
hasPass2 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_bncr)
end)
if hasPass2 then
print("Player has BOUNCER gamepass")
Punch.Parent = player.Backpack
Punch.Parent = player.StarterPack
GrabPlayer.Parent = player.Backpack
GrabPlayer.Parent = player.StarterPack
end
end)
local function onPromptGamePassPurchaseFinished2(player, purchasedPassID, purchaseSuccess)
if purchaseSuccess == true and purchasedPassID == ID_bncr then
print(player.Name .. " purchased BOUNCER gamepass!")
Punch.Parent = player.Backpack
Punch.Parent = player.StarterPack
GrabPlayer.Parent = player.Backpack
GrabPlayer.Parent = player.StarterPack
end
end
--BOOMBOX GAMEPASS--
game.Players.PlayerAdded:Connect(function(player)
local success, message = pcall (function()
hasPass4 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_bb)
end)
if hasPass4 then
print("Player has BOOMBOX gamepass")
Boombox.Parent = player.Backpack
Boombox.Parent = player.StarterPack
end
end)
local function onPromptGamePassPurchaseFinished4(player, purchasedPassID, purchaseSuccess)
if purchaseSuccess == true and purchasedPassID == ID_bb then
print(player.Name .. " purchased BOOMBOX gamepass!")
Boombox.Parent = player.Backpack
Boombox.Parent = player.StarterPack
end
end
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished2)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished4)
gamepassScript local script located inside StarterGui.shopMenu
(technically no issue with this script, but just in case)
local MarketplaceService = game:GetService("MarketplaceService")
local ServerStorage = game:GetService("ServerStorage")
local MainFrame = script.Parent.Frame
local player = game.Players.LocalPlayer
local GP_mod = MainFrame.ScrollingFrame.moderator.md_button
local GP_bncr = MainFrame.ScrollingFrame.bouncer.br_button
local GP_bar = MainFrame.ScrollingFrame.barista.bt_button
local GP_cr = MainFrame.ScrollingFrame.customRad.cr_button
local GP_bb = MainFrame.ScrollingFrame.boombox.bb_button
local ID_mod = 17792695 -- moderator gamepass 19k$
local ID_bncr = 17791929 -- bouncer gamepass 1.2k$
local ID_bar = 17792178 -- barista gamepass 50$
local ID_cr = 14536083 -- custom radio gamepass 10$
local ID_bb = 14537695 -- boombox gamepass 500$
-- MODERATOR GAMEPASS
GP_mod.MouseButton1Down:Connect(function()
local sucess, message = pcall(function()
hasPass1 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_mod)
end)
if hasPass1 then
print("Player already has MODERATOR gamepass")
else
MarketplaceService:PromptGamePassPurchase(player, ID_mod)
end
end)
-- BOUNCER GAMEPASS
GP_bncr.MouseButton1Down:Connect(function()
local sucess, message = pcall(function()
hasPass2 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_bncr)
end)
if hasPass2 then
print("Player already has BOUNCER gamepass")
else
MarketplaceService:PromptGamePassPurchase(player, ID_bncr)
end
end)
-- BARISTA GAMEPASS
GP_bar.MouseButton1Down:Connect(function()
local sucess, message = pcall(function()
hasPass3 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_bar)
end)
if hasPass3 then
print("Player already has BARISTA gamepass")
else
MarketplaceService:PromptGamePassPurchase(player, ID_bar)
end
end)
-- BOOMBOX GAMEPASS
GP_bb.MouseButton1Down:Connect(function()
local sucess, message = pcall(function()
hasPass4 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_bb)
end)
if hasPass4 then
print("Player already has BOOMBOX gamepass")
else
MarketplaceService:PromptGamePassPurchase(player, ID_bb)
end
end)
-- CUSTOM RADIO GAMEPASS
GP_cr.MouseButton1Down:Connect(function()
local sucess, message = pcall(function()
hasPass5 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_cr)
end)
if hasPass5 then
print("Player already has CUSTOM RADIO gamepass")
else
MarketplaceService:PromptGamePassPurchase(player, ID_cr)
end
end)
I’m lost of ideas to figure out how to fix this. Some other important information to note is Third Party Sales are in fact enabled, and this is a group game. I feel like this is a group game issue that I don’t understand. Any help is greatly appreciated!!!
Edit: Also if there’s simply a better and more efficient way to do all of this, that would be even more helpful. I think where the issue lies is within the PromptGamePassPurchaseFinished function, I haven’t got that to work at all.