Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I make an NPC talk?

I want to make an NPC talk without any dialog choices. I've already got the walking down but I don't know how to make him talk by itself. I don't want you to have to click on a question mark above its head, I just want to to go ahead and say a few sentences in sequence. What is the best way to do this? I have already tried messing with dialog but I still can't figure it out.

2 answers

✓ Accepted answer

ROBLOX has a Chat service, that allows to "simulate speech" without necessarily doing so via Dialog. It's pretty self-explanatory, so here's an idea of what the function call you need to make looks like, along with the parameters and their classNames.

Chat ( Instance partOrCharacter, string message, ChatColor color = Blue )

More on this service and its methods here

3 comments

0

Thank you

0

Yup

0

Thx

As i know, you need to get Chat service.

to make the npc talking some sentences without any action from character, you need to get that service:

local chat = game:GetService("Chat")
local head = script.Parent.Head

while true do
chat:Chat(head, "I'm talking, can anyone hear me?", "Red")
wait(3)
chat:Chat(head, "Hello?", "Red")
wait(3)
chat:Chat(head, "OMG, I will destroy you!!!", "Red") -- you can change the color, just type it's name
end

This discussion is preserved as it was. New answers, comments, and votes are closed.