local gampass_id = 35168372
script.Parent.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, gampass_id)
end)
If you want to make a gamepass for speed use this
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 |
03 | local speed = 30 |
04 |
05 | wait( 1 ) |
06 | local ownsGamepass = game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(plr.UserId, 35168372 ) |
07 |
08 | if ownsGamepass then |
09 | plr.Character.Humanoid.WalkSpeed = speed |
10 | end |
11 |
12 | end ) |
I think that's how it works..