Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a speed game pass purchasable by clicking a button?

I was wondering if there was a way that I could make a super speed game pass that can be bought during the game by clicking a text button on the side of the screen. I've tried this script but it didn't work:

local id = 8958899

game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased) if purchased and ido == id then plr.Character.Humanoid.WalkSpeed = 40 end end) game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then char.Humanoid.WalkSpeed = 200 end end) end)

1 answer

local MarketplaceService = game:GetService("MarketplaceService") MarketplaceService:PromptGamePassPurchase(player, gamePassID)

This discussion is preserved as it was. New answers, comments, and votes are closed.