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

Make npc repeat player dialogue?

Asked by 3 years ago
Edited 3 years ago

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

1
go slow one at a time and learn the chat service CrypxticDoge 135 — 3y
0
^^ recommended Omq_ItzJasmin 666 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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)

Chat:Chat()

Player.Chatted

hope this helps

0
it should be the npc's head btw mroaan 95 — 3y
0
otherwise it wont work mroaan 95 — 3y
0
so basically change NPC (at line 5) to NPC.Head NGC4637 602 — 3y
0
Thanks! and how would I spawn a new npc for every new player? joejoejoebob0 -9 — 3y
0
Where do I put this script? On the npc or like in server script service or sum? joejoejoebob0 -9 — 3y
Ad

Answer this question