this is what i got so far, and its working but there is just one problem whenever someone respawn they'll lose the item and are forced to rejoin and I also got 1 major flaw, that it sometimes doesn't run on flooded servers
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local BoomboxID = 9595857
game.Players.PlayerAdded:Connect(function(player)
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, BoomboxID)
end)
if hasPass then
print("Player has the gamepass")
local boombox = game.ReplicatedStorage.BoomBox:Clone()
boombox.Parent = player.Backpack
end
end)
local function onPromptGamePassPurchaseFinished(player, PurchasedPassID, PurchaseSuccess)
if PurchaseSuccess == true and PurchasedPassID == BoomboxID then
print(player.Name .. "Purchased Gamepass")
local boombox = game.ReplicatedStorage.BoomBox:Clone()
boombox.Parent = player.Backpack
end
end
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished)

1 comment
wow thanks for your fast response! thats exactly what i was looking for!!