A lot of games have a store where you can talk with a humanoid to prompt some sort of purchase of a gamepass. The gamepass can also be continuously purchased even if it has been bought before. I'm trying to find a script to work like this but there's no luck. Does anyone know a good script for this?
The best script I could find and tweak was this, but it doesn't even work:
local id = 134889473 -- insert id here, I used the Minion lol it's cheap and good.
local Dialog = script.Parent.Parent
player = game.Players.LocalPlayer
Dialog.DialogChoiceSelected:connect(function(player,Choice)
if not player then return end
if Choice.Name == "DialogChoice" then
game:GetService("GamepassService"):PromptPurchase(player,id)
end
end)

2 comments
what'a the parent of this script ? and it is a localscript or a server script
The parent is Workspace and this is a localscript