Trying to make a quest system using an NPC but I'm having no luck with the simplest thing.
This script:
script.Parent.DialogChoiceSelected:Connect(function(player,choice) print(player.Name,choice.Name) end)
Prints nothing and returns no errors when I talk to the NPC.
I started off by looking at the Wiki page for it and I saw nothing wrong with what I did. I tried it in a local script to see if it was something FE and it also printed and returned nothing. I'm assuming it's a simple thing I'm doing wrong but I don't know what.
Here is a picture of where the script is:
Edit: Keep it a LocalScript, but replace it with this code: <pre>script.Parent.DialogChoiceSelected:Connect(function(choice) local playerName = game.Players.LocalPlayer.Name print(playerName) print(choice.Name) end)</pre> Let's hope this works, because I don't have time to answer this thoroughly.
Edit: Keep it a LocalScript, but replace it with this code:
script.Parent.DialogChoiceSelected:Connect(function(choice) local playerName = game.Players.LocalPlayer.Name print(playerName) print(choice.Name) end) Let’s hope this works, because I don’t have time to answer this thoroughly.
Problem in this script is:
script.Parent
If you add your choice next to:
script.Parent["Name Of Choice"]
It will select choice not dialog, or you can instert this script to choice, but if you insert this script to dialog it will define choice as dialog and it will not work.