Script giving more gears than needed?
So I was trying to make a script for a gamepass gear giver and for some reason, whenever the purchase goes through, it returns more gears than needed. I had this problem with products and now it's with gears.
02 | mpservice = game:GetService( "MarketplaceService" ) |
04 | rbcarpet = game.Lighting:WaitForChild( "RainbowMagicCarpet" ) |
09 | local pla = game:GetService( "Players" ):GetPlayerFromCharacter(hit.Parent) |
11 | if mpservice:UserOwnsGamePassAsync(pla.UserId, passid) then |
12 | rbcarpet:Clone().Parent = pla.Backpack |
13 | print ( "they own gamepass and get tool" ) |
15 | mpservice:PromptGamePassPurchase(pla, passid) |
16 | mpservice.PromptGamePassPurchaseFinished:Connect( function (player, gamePassId, wasPurchased) |
18 | rbcarpet:Clone().Parent = pla.Backpack |
19 | print ( "they bought gamepass and got tool" ) |
21 | print ( "they just said no lol" ) |
32 | script.Parent.Touched:connect(onTouch) |