local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 28475378
local Tool = script.Boombox
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
local ToolClone = Tool:Clone()
ToolClone.Parent = plr.Backpack
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
end
end)
end)
local MarketplaceService = game:GetService("MarketplaceService")
MarketplaceService.PromptPurchaseFinished:Connect(function(player, assetId, isPurchased)
if isPurchased then
print(player.Name .. " bought an item with AssetID: " .. assetId)
--give them the item
else
print(player.Name .. " didn't buy an item with AssetID: " .. assetId)
end
end)
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local GamepassId = 28475378
local Tool = script.Boombox
MarketPlaceService.PromptGamePassPurchaseFinished:Connect(function(Player, PassId, DidPurchase)
if PassId == GamepassId then
if DidPurchase then
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
end
end
end)
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
end
end)
end)
The “.PromptGamePassPurchaseFinished” event is for handling gamepass purchases, you were using the variant for developer products instead.
Yeah, I must’ve attached the wrong explanation to the wrong code, his issue is occurring because he omitted the “was purchased” parameter which represents whether or not the user purchased the gamepass.