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

How do I make a NPC follow me with a dialogue?

Asked by 4 years ago

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)

Answer this question