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

Why won't this script prompt a gamepass purchase? [SOLVED]

The script is located in StarterGui>Admin(ScreenGUI)>TextButton>Script It's supposed to prompt a purchase for my admin gamepass

id = 216703137 


player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player,id)
end)

1 answer

✓ Accepted answer

You can only use the LocalPlayer property of the Players service from a LocalScript. So, move the contents of the script to a LocalScript and you're good to go.

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