I would like an npc to repeat what I say automatically. I have included an example of what I would like but it does not work and is just an example. I also need an npc that repeats player dialogue for everyone who enters the game so it will create a new one when they enter and repeat only their dialogue. I have tried to make my own scripts and also find them on the internet to no avail. Thanks! Image
COMMUNITY QUESTION
Make npc repeat player dialogue?
1 answer
You can used the Chatted event to detect when you speak, and then use the ChatService to make the NPC speak. For example;
local ChatService = game:GetService('Chat')
local player = -- your player
local NPC = -- your npc
player.Chatted:Connect(function(msg)
ChatService:Chat(NPC,msg,Enum.ChatColor.Blue) -- any color you want
end)
hope this helps
5 comments
0
it should be the npc's head btw
0
otherwise it wont work
0
so basically change NPC (at line 5) to NPC.Head
0
Thanks! and how would I spawn a new npc for every new player?
0
Where do I put this script? On the npc or like in server script service or sum?
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
go slow one at a time and learn the chat service
^^ recommended