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

How do I make a script start based off a DialogChoice?

Asked by 3 years ago

Hello. I've been trying to make a script that only activates when you say something to an NPC, (using Dialog and DialogChoices). So far, the only two tutorial scripts I've been able to find are on the Roblox website and a random YouTube Video. I have tried to make this script with both, but I couldn't get either one to even respond to me.

The way Roblox Developer told me to do it:

script.Parent.Dialog.DialogChoiceSelected:connect(function(player,choice)
    if choice.Name == "Bye" then
        print("PLEASE WORK PLEASE WORK")
    end
end)

And the random YouTube Video:

function EndConvo(player,choice)
    if choice.Name == "Bye" then
        print("PLEASE WORK PLEASE WORK")
    end
end

script.Parent.Dialog.DialogChoiceSelected:Connect(EndConvo)

Both of these should print "PLEASE WORK PLEASE WORK" but neither of them printed anything. I should also mention that both of these were placed in the parent of the dialog. And yes, I made extra certain that I put it in the right spot and named the DialogChoice "Bye".

What am I doing wrong? Thank you for reading.

Answer this question