I wanted to make a NPC called Dr.Copper follow a player when I used a dialogue. I also wanted him to stop following if the player told him to. This is the script I used:
function follow(choice) if (choice == script.Parent.Follow) then script.Parent.Parent.Parent.Following.Disabled=false elseif (choice == script.Parent.StopFollow) then script.Parent.Parent.Parent.Following.Disabled=true end end script.Parent.DialogChoiceSelected:Connect(follow)