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

Dialog Gamepass service?

Asked by 9 years ago

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)
0
what'a the parent of this script ? and it is a localscript or a server script XToonLinkX123 580 — 9y
0
The parent is Workspace and this is a localscript HurricaneOtto 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I have the problem! Right here: local Dialog = script.Parent.Parent Since the script is in Workspace, Dialog = game. You put this script 2 layers down from the dialog you want to use.

0
uh, could you elaborate a little more on that? It's very vague to me. The script is in the dialog actually already, it still doesnt work. HurricaneOtto 0 — 9y
0
Oh, yes, Hierachy goes like this: Dialog(starter)- Dialog Choice - (something) - script connieoop 10 — 9y
Ad

Answer this question