NPC Dialog not work

Hi, why this will not work ? …

script.Parent.DialogChoiceSelected:connect(function(player,choice)
	print(player.Name,choice.Name)
end)

What errors show up when you look at output?

Are you running the code in a server side script? If so, DialogChoiceSelected can only be ran through a local script or module script, as shown here: Dialog | Documentation - Roblox Creator Hub

I don’t have any error…

:slight_smile:

in localscript and normal script it’s not work ^^

Judging from the script.Parent part, I assume you parented the LocalScript to the dialog. It won’t run there!!!

Instead, you should parent the LocalScript to a place such as StarterPlayer > StarterPlayerScripts
image
then reference the path to the dialog manually, i.e.

workspace:WaitForChild("SomeNPC"):WaitForChild("Head"):WaitForChild("Dialog").DialogChoiceSelected:Connect(function(player, choice)
    print(player.Name,"chose",choice)
end)