Why Is This Script That Gives Gamepasses Only Give The Items When The Player Leaves And Rejoins?
I have a script that is supposed to give gamepasses when the player clicks a button.
(local button script)
1 | script.Parent.MouseButton 1 Click:Connect( function () |
2 | game:GetService( "MarketplaceService" ):PromptGamePassPurchase(game.Players.LocalPlayer, 15413257 ) |
(gamepass giving script, in workspace)
01 | local MarketPlaceService = game:GetService( "MarketplaceService" ) |
03 | game.Players.PlayerAdded:Connect( function (player) |
05 | if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, 15413257 ) then |
07 | game.ServerStorage.Tools.SpeedCoil:Clone().Parent = player:WaitForChild( "Backpack" ) |
08 | game.ServerStorage.Tools.SpeedCoil:Clone().Parent = player:WaitForChild( "StarterGear" ) |
The scripts work but the gamepass giving script only gives the speed coil when the player rejoins the game, but I want it to give the weapon to the player instantly. (Putting the speed coil in replicated storage breaks the speed coil.) Please help.
Thank you!