regiving a item, after respawn?
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
01 | local MarketplaceService = game:GetService( "MarketplaceService" ) |
02 | local Players = game:GetService( "Players" ) |
04 | local BoomboxID = 9595857 |
06 | game.Players.PlayerAdded:Connect( function (player) |
07 | local success, message = pcall ( function () |
08 | hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, BoomboxID) |
11 | print ( "Player has the gamepass" ) |
13 | local boombox = game.ReplicatedStorage.BoomBox:Clone() |
14 | boombox.Parent = player.Backpack |
19 | local function onPromptGamePassPurchaseFinished(player, PurchasedPassID, PurchaseSuccess) |
20 | if PurchaseSuccess = = true and PurchasedPassID = = BoomboxID then |
21 | print (player.Name .. "Purchased Gamepass" ) |
23 | local boombox = game.ReplicatedStorage.BoomBox:Clone() |
24 | boombox.Parent = player.Backpack |
29 | MarketplaceService.PromptGamePassPurchaseFinished:Connect(onPromptGamePassPurchaseFinished) |