Gear giver gamepass not giving gear and not returning boolean values

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.

Get rid of the Clone() on all of these, you need to clone them each time a player is added and they have the gamepass not just once.

1 Like

Alright, I went ahead and did so, unfortunately I’m still not getting any output. Here’s what the script looks like now:

--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 1.2k$
local ID_bb = 14537695 -- boombox gamepass 500$

--GEAR LOCALS--
local Boombox = game.ServerStorage.Gear.BoomBox
local Punch = game.ServerStorage.Gear.Punch
local GrabPlayer = game.ServerStorage.Gear.GrabPlayer

--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:Clone()
		Punch.Parent = player.StarterPack:Clone()
		
		GrabPlayer.Parent = player.Backpack:Clone()
		GrabPlayer.Parent = player.StarterPack:Clone()
	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:Clone()
		Punch.Parent = player.StarterPack:Clone()

		GrabPlayer.Parent = player.Backpack:Clone()
		GrabPlayer.Parent = player.StarterPack:Clone()
		
	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:Clone()
		Boombox.Parent = player.StarterPack:Clone()

	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:Clone()
		Boombox.Parent = player.StarterPack:Clone()

	end
end

MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished2)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished4)

You’re cloning the players backpack.
Try this,

local PunchClone,GrabClone = Punch:Clone(),GrabPlayer:Clone()
PunchClone.Parent = player.StarterPack	
GrabClone.Parent = player.StarterPack

for _,Tool in pairs(player.StarterPack:GetChildren()) do
    if Tool:IsA("Tool") then
        if not player.Backpack:FindFirstChild(Tool.Name) then
            local Clone = Tool:Clone()
            Clone.Parent = player.Backpack
        end
    end
end

Just modify these correctly for each tool and different lines.

Edit: Heres your script reworked

--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 1.2k$
local ID_bb = 14537695 -- boombox gamepass 500$

--GEAR LOCALS--
local Boombox = game.ServerStorage.Gear.BoomBox
local Punch = game.ServerStorage.Gear.Punch
local GrabPlayer = game.ServerStorage.Gear.GrabPlayer

--BOUNCER GAMEPASS--
game.Players.PlayerAdded:Connect(function(player)
	local success, message = pcall (function()
		hasPass2 = MarketplaceService:UserOwnsGamePassAsync(player.UserId, ID_bncr)
	end)

	if hasPass2  then
		local PunchClone,GrabClone = Punch:Clone(),GrabPlayer:Clone()
        PunchClone.Parent = player.StarterPack	
        GrabClone.Parent = player.StarterPack

        for _,Tool in pairs(player.StarterPack:GetChildren()) do
            if Tool:IsA("Tool") then
                if not player.Backpack:FindFirstChild(Tool.Name) then
                    local Clone = Tool:Clone()
                    Clone.Parent = player.Backpack
                end
            end
        end
	end
end)

local function onPromptGamePassPurchaseFinished2(player, purchasedPassID, purchaseSuccess)
	if purchaseSuccess == true and purchasedPassID == ID_bncr then
		local PunchClone,GrabClone = Punch:Clone(),GrabPlayer:Clone()
        PunchClone.Parent = player.StarterPack	
        GrabClone.Parent = player.StarterPack

        for _,Tool in pairs(player.StarterPack:GetChildren()) do
            if Tool:IsA("Tool") then
                if not player.Backpack:FindFirstChild(Tool.Name) then
                    local Clone = Tool:Clone()
                    Clone.Parent = player.Backpack
                end
            end
        end
		
	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
		local BoomboxClone = Boombox:Clone()
        BoomboxClone.Parent = player.StarterPack	

        for _,Tool in pairs(player.StarterPack:GetChildren()) do
            if Tool:IsA("Tool") then
                if not player.Backpack:FindFirstChild(Tool.Name) then
                    local Clone = Tool:Clone()
                    Clone.Parent = player.Backpack
                end
            end
        end
	end
end)

local function onPromptGamePassPurchaseFinished4(player, purchasedPassID, purchaseSuccess)
	if purchaseSuccess == true and purchasedPassID == ID_bb then
		local BoomboxClone = Boombox:Clone()
        BoomboxClone.Parent = player.StarterPack	

        for _,Tool in pairs(player.StarterPack:GetChildren()) do
            if Tool:IsA("Tool") then
                if not player.Backpack:FindFirstChild(Tool.Name) then
                    local Clone = Tool:Clone()
                    Clone.Parent = player.Backpack
                end
            end
        end
	end
end

MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished2)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished4)
1 Like

Man, still not getting an return of values anywhere, I’m clueless. I put prints everywhere to see if there’s any response at all but there is absolutely nothing being fired. I’m going to relocate all these scripts into the individual buttons to see if that changes anything. I really appreciate your help, I’ll get back to you when I resituated the scripts. Thanks!

2 Likes

Yeah that, didn’t work. This doesn’t make any sense.

1 Like