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

Dialog Gamepass service?

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

0

what'a the parent of this script ? and it is a localscript or a server script

0

The parent is Workspace and this is a localscript

1 answer

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.

2 comments

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.

0

Oh, yes, Hierachy goes like this: Dialog(starter)- Dialog Choice - (something) - script

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