Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Agios 10
9 years ago

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

Log in to vote
1
Answered by
DataStore 530 Moderation Voter
9 years ago

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.

Ad

Answer this question